OneBusAway / onebusaway-gtfs-realtime-from-nextbus-cli

Produce GTFS-realtime data from a NextBus API data source.
Other
16 stars 9 forks source link

fix broken urls #2

Open jayenashar opened 11 years ago

bdferris commented 11 years ago

Do you happen to know of an example agency id and route tag that was causing the URL parser to fail?

jayenashar commented 11 years ago

sf-muni K OWL

(there were a few with spaces)

bdferris commented 11 years ago

In that case, I think the proper fix would be to actually construct a valid URL. For example, we can replace all the spaces in the route tag with "+" to make it a valid URL:

String url = "http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a="

Note the addition of .replace(' ', '+') to the routeTag. This code would give you a URL like:

http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=sf-muni&r=K+OWL

Which does seem to work correctly. Any chance you'd be willing to make this change to your commit?

Also, any chance you could revert the changes to the imports at the top of the file? I'm assuming your IDE has a different import style than the existing code.

jayenashar commented 11 years ago

The reason for using URI.toASCIIString() is to do the appropriate conversions for me. + when appropriate, %20 when appropriate.

My IDE is set to change the headers on the files it touches. It's probably easier for you to just close this request and make appropriate changes in your IDE as you see fit.

jayenashar commented 11 years ago

just added a bunch more commits to this branch to fix various things.

CLAassistant commented 4 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Jayen Ashar seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.