diff --git a/.gitignore b/.gitignore index c508035..9de8bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ search-scrape -web_cache +webcache diff --git a/scrape.go b/scrape.go index ef3d3f9..478b1aa 100644 --- a/scrape.go +++ b/scrape.go @@ -23,5 +23,5 @@ package main func main() { - scrapeTabelog("http://tabelog.com/en/kanagawa/rstLst/1/", "tabelog.json", "web_cache") + scrapeTabelog("http://tabelog.com/en/kanagawa/rstLst/1/", "tabelog.json", "webcache") } diff --git a/webcache.go b/webcache.go index d6afedd..a2e554b 100644 --- a/webcache.go +++ b/webcache.go @@ -49,7 +49,7 @@ func newWebCache(baseDir string) (*webCache, error) { func (c *webCache) urlToLocal(url string) string { hash := md5.New() hash.Write([]byte(url)) - return path.Join(c.baseDir, fmt.Sprintf("%x", hash.Sum(nil))) + return path.Join(c.baseDir, fmt.Sprintf("%x.html", hash.Sum(nil))) } func (c *webCache) fetchUrl(url string) (*goquery.Document, error) {