These perl scripts are kinda hackish, but at least they're better than they were... Anyway, here's how to use them: * Install the following Perl modules: - HTML::Tree - HTML::Format - HTML::TableContentParser - Time::ParseDate * Grab the HTML from the MTA for the route you want to process. e.g.: $ wget -O 31-week.html http://www.mtamaryland.com/schedules/view_html_schedule.cfm?i=219 $ wget -O 31-sat.html http://www.mtamaryland.com/schedules/view_html_schedule.cfm?i=227 $ wget -O 31-sun.html http://www.mtamaryland.com/schedules/view_html_schedule.cfm?i=228 * Run parse-html to turn the HTML pages into CSV files. $ parse-html.pl 31-week.html > 31-week.csv $ parse-html.pl 31-sat.html > 31-sat.csv $ parse-html.pl 31-sun.html > 31-sun.csv * Check the resultant CSV files for any problems. In particular, you need to make sure that the stop names are the same for all of the files. Other problems I've run into include - Different name (spelling, etc.) for the same stop on the inbound and outbound legs of the same route. - Bad data in the HTML (invalid time, etc.) Generally, to fix these, you'll have to edit the HTML and rerun the parser. * Make sure the CSV files don't duplicate information. I don't currently handle cases where that occurs. (e.g., half of the times in a particular direction on a particular day are in one file, and the other half are in another file.) This means that you can't currently get the entire 23 schedule in a single database. Note that the Light Rail schedules might break this, since they put out one direction per page, but last I checked, they didn't even have the full scheduled available for me to test. * Once everything is ready, merge the CSV files: $ merge-csv 31-week.csv 31-sat.csv 31-sun.csv > 31.csv * Make sure the data fits trainsched's constraints. In particular, stop names must be no longer than 20 characters, and day names must be no longer than 9 characters. Edit the CSV to fix these, if need be. * Run csv2trainschedpdb on the CSV file. $ csv2trainschedpdb 31.csv 31.pdb 'Bus: 31' * Sync the resulting PDB to your Palm.