Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var data_collection;
for (var i in jsonbody.rest)
{
jsonbody.rest[i]["savedtime"] = new Date().toISOString();
data_collection.save(jsonbody.rest[i] , function(err, saved) {
if( err || !saved ) console.log("Rest not saved: " + err);
else ;
});
}
// curl http://<host>/api/crawlGnavi?area=PREF47 #PREF47=Okinawa
app.get('/api/crawlGnavi', function (req, res) {
var cursor = "cursor";
var prefecture = "" + req.query.area;
db = mongodbManager.getConnection([cursor, prefecture]);
data_collection = db.collection(prefecture);
startCrawling(req.query.area);
res.send('Started crawling pref:' + req.query.area);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.