tangled
alpha
login
or
join now
cuducos.me
/
desanda-catarina
0
fork
atom
🥴 Um quem é quem na assembleia que faz Santa Catarina andar pra trás
desanda.online
0
fork
atom
overview
issues
pulls
pipelines
Fixes bad data with prefix
Eduardo Cuducos
3 months ago
9681cb56
3c14526a
+5
-7
2 changed files
expand all
collapse all
unified
split
.gitignore
main.go
+1
.gitignore
···
1
1
+
.env
1
2
site/
2
3
tse/*.zip
+4
-7
main.go
···
232
232
return ""
233
233
}
234
234
235
235
-
func getBillsForPerson(name string) []Bill {
235
235
+
func getBillsFor(name string) []Bill {
236
236
return []Bill{
237
237
{Name: quotas.name, Vote: getVoteFor(name, quotas)},
238
238
{Name: cameras.name, Vote: getVoteFor(name, cameras)},
···
359
359
}
360
360
g.Go(func() error {
361
361
id := row[idIdx]
362
362
-
name := row[nameIdx]
363
363
-
p := Person{ID: id, Name: name, Party: row[partyIdx], Votes: getBillsForPerson(name)}
364
364
-
362
362
+
p := Person{ID: id, Name: row[nameIdx], Party: row[partyIdx]}
363
363
+
p.Name = strings.TrimPrefix(strings.TrimSpace(p.Name), "A ")
364
364
+
p.Votes = getBillsFor(p.Name)
365
365
ok := false
366
366
for _, b := range p.Votes {
367
367
if b.Vote != "" {
···
372
372
if !ok {
373
373
return nil
374
374
}
375
375
-
376
375
u, ok, err := urlFor(client, p.Name)
377
376
if err != nil || !ok {
378
377
return nil
379
378
}
380
379
p.URL = u
381
381
-
382
380
pic, err := copyPhotoFrom(id, "tse/foto_cand2022_SC_div.zip")
383
381
if err == nil && pic != "" {
384
382
p.Photo = &pic
385
383
}
386
386
-
387
384
var us []SocialMedia
388
385
var sg errgroup.Group
389
386
c := make(chan string, len(m[id]))