Permalink
Browse files

Updated URL for publictransport.sg to mytransport.sg

  • Loading branch information...
cpwc committed Jan 3, 2015
1 parent 531c34c commit 004f0fc4c643828b97a4fc97516b0a7d22818c3c
@@ -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);
@@ -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 = {
@@ -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);

0 comments on commit 004f0fc

Please sign in to comment.