From 3fbb3ce6c8446bc4a269d59f57794994498dc434 Mon Sep 17 00:00:00 2001 From: Anton Sarukhanov <code@ant.sr> Date: Thu, 9 Jul 2015 20:45:53 -0400 Subject: [PATCH] fixes --- README.md | 7 +++++++ ajax.php | 4 ++-- cron/nextbus.php | 4 ++-- daemon | 4 ++-- js/script.js | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e69de29..47ea78b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,7 @@ +## Rutgers Bus Map + +### Installation + +* Copy working MySQL DB +* Move daemon to /etc/init.d/busmap and customize +* # pear install system_daemon diff --git a/ajax.php b/ajax.php index 1b8ec2c..718b89b 100644 --- a/ajax.php +++ b/ajax.php @@ -16,7 +16,7 @@ if ($_GET['command'] == "vehicleLocations") { $db = dbc(); // MAX age of a bus location to return - $maxAge = 60; + $maxAge = 120; $time = 0; if (isset($_GET['t'])) $time = $db->real_escape_string((int)$_GET['t']); @@ -131,4 +131,4 @@ function cleanRouteName($name) { return $name; } -?> \ No newline at end of file +?> diff --git a/cron/nextbus.php b/cron/nextbus.php index fd2d9d5..38b2bd2 100644 --- a/cron/nextbus.php +++ b/cron/nextbus.php @@ -27,7 +27,7 @@ $fetchData = array( "vehicleLocations" => array( "url" => "http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=rutgers&t=0", "refetch" => 3, // only fetch if our data is this stale - "dropStale" => 60, // data older than this will be wiped + "dropStale" => 120, // data older than this will be wiped "dbQueries" => function($dbConn, $xml) { // do things and return an array of database queries, or false. $queries = array("TRUNCATE TABLE `vehicleLocations`"); @@ -94,4 +94,4 @@ function sanitize($string) { return preg_replace($pattern,"",$string); } -?> \ No newline at end of file +?> diff --git a/daemon b/daemon index 32e0682..2f1bda0 100755 --- a/daemon +++ b/daemon @@ -19,10 +19,10 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="RU Bus Map" NAME=busmapDaemon.php -DAEMON=/home/anton/www/rutge.rs/cron/busmapDaemon.php +DAEMON=/var/www/rutge.rs/cron/busmapDaemon.php DAEMON_ARGS="" PIDFILE=/var/run/busmap/busmap.pid -SCRIPTNAME=/etc/init.d/busmapDaemon.php +SCRIPTNAME=/etc/init.d/busmap # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 diff --git a/js/script.js b/js/script.js index 043e3e0..67d4989 100644 --- a/js/script.js +++ b/js/script.js @@ -330,7 +330,7 @@ function updateMapVehicles(routes,vehicles) { window.busMarkers[vehicles[i]['routeTag']][i] = L.marker([vehicles[i]['lat'], vehicles[i]['lon']], { icon: L.icon({ - iconUrl: 'https://busmap.antsar-static.com/img/bus.png', + iconUrl: 'https://rutgers.antsar-static.com/img/bus.png', iconSize: [21,25], iconAnchor: [10,12], }), @@ -387,4 +387,4 @@ function ol( object ) { } } return length; -}; \ No newline at end of file +}; -- GitLab