Philadelphia, or filthadelphia, has a large litter and waste management problem. Moreover, many posit this problem to the lack of public waste bins.

What it does

Using the Twitter api and the Google maps api it returns the nearest public waste bin to the user who tweeted at it. The dataset of public waste bin locations can be found at opendataphilly. The bot gathers the users geo-coordinates and passes these to the Google Maps api. The Google Maps api then finds the distance from 900 waste bins to the user's current location. After the bot has found the shortest path it returns the location as well as a Google Maps route/link to direct them to the waste bin.

Challenges I ran into

The biggest challenge has been working with the Google Maps Api. Additionally, this bot is quite intensive. I am quickly using up my number of free api calls and after these are used up this project will be quite expensive. There are roughly 900 public waste bins scattered throughout the city and via the Google maps api this bot is basically implementing a "shortest path" algorithm to find the nearest waste bin. But it has to look at 900 waste bins for every tweet it receives. I've discovered a way to solve this which leverages zipcodes to narrow down the number of bins the Google Maps api has to process but unfortunately have run out of time to implement it.

Accomplishments that I'm proud of

This is my first time working with an api and I managed to make two interact with each other.

What I learned

  • More Python
  • How to interact with api's
  • Google Maps api
  • Twitter api
  • How to build a Twitter bot

What's next for Trash Man

  • Implementing the zipcode solution I mentioned
  • Hosting
Share this project: