This project will require you to use cookies to scrape [login to view URL], which is an ASP.NET site.
Deliverable is a short bit of python code. You may use outside python libraries like mechanize and your favorite html parser. (My favorite is lxml.)
Deliverable contains a function:
createListOfRoutes(dt, departure_request_code, arrival_request_code)
where
* dt is a [login to view URL] date of departure
* departure_request_code indicates the departure station (e.g., New York's departure_request_code is "37")
* arrival_request_code indicates the arrival station
createListOfRoutes returns an array of all one-way schedules and prices for the search day. Each schedule/price option is a dictionary in the following format:
{
'price': 9.0,
'book_string' : '.',
'legs' : [{
'routeName' : 'MegaBus NE',
'mode' : 'bus',
'departure_result_code' : 'New York, Penn Station 31st St. and 8th. Ave',
'arrival_result_code' : 'Boston, South Station',
'departureTime' : [login to view URL](2010, 4, 8, 1, 30),
'arrivalTime' : [login to view URL](2010, 4, 8, 5, 45),
'provider' : ''
}]
}
Note that 'book_string' should always be '.' (a period), 'mode' should always be 'bus' and 'provider' should always be '' (empty string). Also, please note that routeName should change based on the route.