Name changes
This commit is contained in:
parent
3b701b0f91
commit
baaaa1ebf7
@ -43,7 +43,7 @@ type review struct {
|
|||||||
|
|
||||||
type profiler interface {
|
type profiler interface {
|
||||||
index(doc *goquery.Document) (string, []string)
|
index(doc *goquery.Document) (string, []string)
|
||||||
profile(doc *goquery.Document) *review
|
review(doc *goquery.Document) *review
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeAbsUrl(ref, base string) (string, error) {
|
func makeAbsUrl(ref, base string) (string, error) {
|
||||||
@ -84,7 +84,7 @@ func scrapeReview(url string, out chan review, cache *webCache, group *sync.Wait
|
|||||||
doc, err := cache.load(url)
|
doc, err := cache.load(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to scrape review at %s (%v)", url, err)
|
log.Printf("failed to scrape review at %s (%v)", url, err)
|
||||||
} else if r := prof.profile(doc); r != nil {
|
} else if r := prof.review(doc); r != nil {
|
||||||
r.url = url
|
r.url = url
|
||||||
out <- *r
|
out <- *r
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ func (tabelog) index(doc *goquery.Document) (string, []string) {
|
|||||||
return nextIndexUrl, reviewUrls
|
return nextIndexUrl, reviewUrls
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tabelog) profile(doc *goquery.Document) *review {
|
func (tabelog) review(doc *goquery.Document) *review {
|
||||||
var r review
|
var r review
|
||||||
|
|
||||||
r.name = doc.Find("a.rd-header__rst-name-main").Text()
|
r.name = doc.Find("a.rd-header__rst-name-main").Text()
|
||||||
|
Loading…
Reference in New Issue
Block a user