1

Fixes and tweaks

This commit is contained in:
Alex Yatskov 2015-09-20 12:20:05 +09:00
parent 9fbd6ce67c
commit 3079c89b67
3 changed files with 2908 additions and 7 deletions

View File

@ -153,11 +153,8 @@ func collateData(reviews []review) map[uint64]*restaurant {
var rest *restaurant
if rest, _ = restaurants[hash.Sum64()]; rest == nil {
restaurants[hash.Sum64()] = &restaurant{
name: rev.name,
address: rev.address,
latitude: rev.latitude,
longitude: rev.longitude}
rest = &restaurant{name: rev.name, address: rev.address, latitude: rev.latitude, longitude: rev.longitude}
restaurants[hash.Sum64()] = rest
}
rest.reviews = append(rest.reviews, rev)

File diff suppressed because it is too large Load Diff

View File

@ -155,10 +155,10 @@ func scrape(url string, scr scraper) ([]review, error) {
defer wg.Done()
for rev := range out {
if rev.err == nil {
log.Print(color.GreenString(rev.name))
log.Print(color.GreenString(rev.url))
reviews = append(reviews, rev)
} else {
log.Printf("%s (%s)", color.YellowString(rev.name), color.RedString(rev.err.Error()))
log.Printf("%s (%s)", color.YellowString(rev.url), color.RedString(rev.err.Error()))
}
}
}()