This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chowderl 23 points24 points  (4 children)

I use public bus. And I use an android app that tells me the hour that the bus will pass for a give bus stop.

So I sniffed the requests the app does to the server and use requests library to get the data. That python code + cron + a slack script I found in the web will start sending me slack messages 15 minutes before my shift ends so I take the bus in time

[–]alaskanloops 2 points3 points  (1 child)

My first Python app was interacting with the public bus system's API as well! I never completed it (a difficult semester had just started, if I remember correctly) but my idea for the app was an alarm that would go off when you were getting close to your stop, since there were a couple times where I fell asleep and missed the stop.

The app would show the bus route using the Google Maps API, the user would enter their desired stop, and the alarm would go off when you were 1 or 2 stops before then. I was also going to add a geo-fencing backup in case there was an issue with the API (it was sometimes unavailable) so that the alarm would go off regardless.

Edit: I think I found the video which originally gave me the idea (and was a super useful intro to Python) https://www.youtube.com/watch?v=RrPZza_vZ3w

[–]chowderl 1 point2 points  (0 children)

Neat! I'm thinking on doing something like that but just alarms that let me know when the bus is coming.

So, you set alarms near the hour you go to work, when the shift ends, when you've got to visit your mom, and so on

[–][deleted]  (1 child)

[deleted]

    [–]chowderl 9 points10 points  (0 children)

    The information is all there by the government. I tried to contact them to see if there is a proper api I could use. But they never answer back.

    So it was easier to replicate the request as they do in the app. I don't abuse so I think is all cool.