From 004f0fc4c643828b97a4fc97516b0a7d22818c3c Mon Sep 17 00:00:00 2001 From: Wei Cheng Date: Sat, 3 Jan 2015 13:33:52 +0800 Subject: [PATCH] Updated URL for publictransport.sg to mytransport.sg --- tasks/compare-publictransport-streetdirectory.js | 4 ++-- tasks/fetch-bus-services.js | 4 ++-- tasks/fetch-bus-stops-routes.js | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/compare-publictransport-streetdirectory.js b/tasks/compare-publictransport-streetdirectory.js index e9b4d269..082c2fe7 100644 --- a/tasks/compare-publictransport-streetdirectory.js +++ b/tasks/compare-publictransport-streetdirectory.js @@ -5,7 +5,7 @@ var cheerio = require('cheerio'); module.exports = function(grunt){ - grunt.registerTask('comparePTSD', 'Compare publictransport.sg to streetdirectory.com', function(){ + grunt.registerTask('comparePTSD', 'Compare mytransport.sg to streetdirectory.com', function(){ var data = grunt.file.readJSON('data/2/bus-services.json'); var services = data.services.map(function(s){ @@ -14,7 +14,7 @@ module.exports = function(grunt){ grunt.log.writeln(service); grunt.util.async.parallel([ function(done){ - needle.head('http://www.publictransport.sg/content/publictransport/en/homepage/Ajax/map_ajaxlib.getBusRouteByServiceId.' + service + '.html', function(err, res){ + needle.head('http://www.mytransport.sg/content/mytransport/ajax_lib/map_ajaxlib.getBusRouteByServiceId.' + service + '.html', function(err, res){ var len = parseInt(res.headers['content-length'], 10); var exists = len > 2000; // Exists when length is > 2K done(null, exists); diff --git a/tasks/fetch-bus-services.js b/tasks/fetch-bus-services.js index 122d9b09..9ce74738 100644 --- a/tasks/fetch-bus-services.js +++ b/tasks/fetch-bus-services.js @@ -11,8 +11,8 @@ module.exports = function(grunt){ grunt.util.async.parallel([ function(done){ - grunt.log.writeln('Request to publictransport.sg'); - needle.get('http://www.publictransport.sg/content/publictransport/en/homepage/map.html', function(err, res, body){ + grunt.log.writeln('Request to mytransport.sg'); + needle.get('http://www.mytransport.sg/content/mytransport/map.html', function(err, res, body){ var $ = cheerio.load(body); var data = { diff --git a/tasks/fetch-bus-stops-routes.js b/tasks/fetch-bus-stops-routes.js index 00384515..52df76a1 100644 --- a/tasks/fetch-bus-stops-routes.js +++ b/tasks/fetch-bus-stops-routes.js @@ -5,7 +5,7 @@ var cheerio = require('cheerio'); module.exports = function(grunt){ - grunt.registerTask('fetchBusStopsRoutes', 'Fetch bus stops and routes from publictransport.sg', function(){ + grunt.registerTask('fetchBusStopsRoutes', 'Fetch bus stops and routes from mytransport.sg', function(){ var badlines = {}; // Store the bad route lines, report 'em var stops = {}; // Store ALL the bus stops var _ = grunt.util._; @@ -17,7 +17,7 @@ module.exports = function(grunt){ return function(allDone){ grunt.util.async.parallel([ function(done){ - needle.get('http://www.publictransport.sg/content/publictransport/en/homepage/Ajax/map_ajaxlib.getBusRouteByServiceId.' + service + '.html', function(err, res, body){ + needle.get('http://www.mytransport.sg/content/mytransport/ajax_lib/map_ajaxlib.getBusRouteByServiceId.' + service + '.html', function(err, res, body){ var $ = cheerio.load(body); var routeStops = { 1: [], 2: [] }; @@ -50,7 +50,7 @@ module.exports = function(grunt){ }); }, function(done){ - needle.get('http://www.publictransport.sg/kml/busroutes/' + service + '-1.kml', function(err, res, body){ + needle.get('http://www.mytransport.sg/kml/busroutes/' + service + '-1.kml', function(err, res, body){ if (err) throw err; if (res.statusCode != 200) throw new Error('Status code: ' + res.statusCode); @@ -77,7 +77,7 @@ module.exports = function(grunt){ done(null, []); return; } - needle.get('http://www.publictransport.sg/kml/busroutes/' + service + '-2.kml', function(err, res, body){ + needle.get('http://www.mytransport.sg/kml/busroutes/' + service + '-2.kml', function(err, res, body){ if (err) throw err; if (res.statusCode != 200) throw new Error('Status code: ' + res.statusCode);