1
This commit is contained in:
Alex Yatskov 2015-08-23 15:36:37 +09:00
parent 51e6a08eff
commit f0c8b6479b
4 changed files with 30 additions and 9323 deletions

20
cache/geocache.json vendored
View File

@ -2011,6 +2011,10 @@
"Latitude": 35.5295726,
"Longitude": 139.6986515
},
"2-1 Fujimicho Naka-ku Yokohama Kanagawa": {
"Latitude": 35.4400805,
"Longitude": 139.6328372
},
"2-1 Higashidacho, Kawasaki-ku | 2F Matsui Bldg., Kawasaki 210-0005, Kanagawa Prefecture": {
"Latitude": 35.5286247,
"Longitude": 139.7023059
@ -3007,6 +3011,10 @@
"Latitude": 35.5301614,
"Longitude": 139.7005458
},
"2-4-19 Shinyokohama Kohoku-ku Yokohama Kanagawa": {
"Latitude": 35.5086251,
"Longitude": 139.6162458
},
"2-4-3 Fujigaoka, Aoba-ku | Fujigaoka Hall B1F, Yokohama 227-0043, Kanagawa Prefecture": {
"Latitude": 35.5443709,
"Longitude": 139.5273234
@ -3219,6 +3227,10 @@
"Latitude": 35.5284589,
"Longitude": 139.7006264
},
"2-7-8 Isago Kawasaki-ku Kawasaki Kanagawa": {
"Latitude": 35.5285672,
"Longitude": 139.7006625
},
"2-7-8 Minamisaiwai Nishi-ku Yokohama Kanagawa": {
"Latitude": 35.4635478,
"Longitude": 139.617538
@ -3975,6 +3987,10 @@
"Latitude": 35.441597,
"Longitude": 139.6611352
},
"3-4-29 Isogo Isogo-ku Yokohama Kanagawa": {
"Latitude": 35.4032608,
"Longitude": 139.6189689
},
"3-4-3 Akiya, Yokosuka 240-0105, Kanagawa Prefecture": {
"Latitude": 35.2400862,
"Longitude": 139.5993922
@ -4511,6 +4527,10 @@
"Latitude": 35.508616,
"Longitude": 139.4448664
},
"4-50-5 Nakasaiwaicho Saiwai-ku Kawasaki Kanagawa": {
"Latitude": 35.5317585,
"Longitude": 139.6926631
},
"4-52 Tokiwacho Naka-ku Yokohama Kanagawa": {
"Latitude": 35.4463769,
"Longitude": 139.6358089

File diff suppressed because it is too large Load Diff

View File

@ -122,11 +122,11 @@ func dumpData(dbPath string, restaraunts []restaurant) error {
atmospheric FLOAT NOT NULL,
latitude FLOAT NOT NULL,
longitude FLOAT NOT NULL,
distanceToStn FLOAT NOT NULL,
closestStn VARCHAR(100) NOT NULL,
closestStnDist FLOAT NOT NULL,
closestStnName VARCHAR(100) NOT NULL,
accessCount INT NOT NULL,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
) DEFAULT CHARACTER SET utf8`)
id INT PRIMARY KEY
)`)
if err != nil {
return err
@ -156,7 +156,8 @@ func dumpData(dbPath string, restaraunts []restaurant) error {
r.longitude,
r.latitude,
r.closestStnDist,
r.closestStnName)
r.closestStnName,
0)
if err != nil {
return err
@ -171,7 +172,7 @@ func dumpData(dbPath string, restaraunts []restaurant) error {
DROP TABLE IF EXISTS categories;
CREATE TABLE categories(
description VARCHAR(200) NOT NULL,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY))`)
id INT PRIMARY KEY)`)
if err != nil {
return err
@ -192,7 +193,7 @@ func dumpData(dbPath string, restaraunts []restaurant) error {
CREATE TABLE history(
date DATETIME NOT NULL,
reviewId INT NOT NULL,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
id INT PRIMARY KEY,
FOREIGN KEY(reviewId) REFERENCES reviews(id))`)
if err != nil {

View File

@ -140,8 +140,8 @@ func scrapeIndex(indexUrl string, out chan restaurant, wc *webCache, scr scraper
}
func scrape(url string, wc *webCache, gc *geoCache, scr scraper) []restaurant {
out := make(chan restaurant)
in := make(chan restaurant)
out := make(chan restaurant, 128)
in := make(chan restaurant, 128)
go scrapeIndex(url, in, wc, scr)
go decodeReviews(in, out, gc)