VBScript to get the next two bus arrival times from NextBus.com. The primary motivation for this was to use it with Samurize
, a system monitoring and desktop enhancement engine for Windows
so that I could have the bus arrival times available for quick reference on screen instead of opening the website. A sample NextBus Samurize config is also available.
How Does It Work?
NextBus doesn't have an API so the page must be scraped. On the website, an iframe points to
For example, the URL for the Georgia Tech Green Route, heading to 14th Street, for the stop at Ferst Drive and Atlantic Drive is
= stop [where you'll board] and
= stop [where you'll disembark].
How Do I Use It?
Like mentioned above, the values of the parameters need to be read from the URL. There are three functions that you can use all of which take the same arguments -
(the boarding stop),
- Returns the first next arrival time in minutes. For example,
- Returns the second next arrival time in minutes. For example
- Returns both the arrival times, in minutes, separated by an ampersand (
) with a space before and after the ampersand. For example
17 & 56
You can find the script (
) in the NextBusScraper.zip attachment on this page, below.
There is also a sample Samurize config to display the NextBus times for the Georgia Tech Green Route - here's what it looks like:
attachment on this page. The Samurize Package (the .sam archive) is the same format as a ZIP archive so you can unzip it if you want and extract just the files you want/need. But importing the package using the Samurize Config Tool is the recommended way of getting started with minimal effort.