DIYtraffic - Instructions for Installation

From DIYcity

Jump to: navigation, search

We've written bunch of code we're referring to as the DIYtraffic Bot. It's a little app written in java that you can run on your server. It is able to do basically two things: 1. Check for updates from Yahoo! traffic for a city you specify, then post those updates to a Twitter account, also specified by you. 2. Check for direct messages sent to that Twitter account from another Twitter user, and (assuming the message has a query in it), search the most recent statuses for that query, and send a couple of direct messages back to the user containing the matching statuses.

If that's suitable for your needs, then setting up your own DIYtraffic Bot is easy! Just follow these steps:

1. First you'll need a Twitter account to host a feed of your local traffic information. Head on over to Twitter and create one. Even if you already have a personal Twitter acccount, you're definitely going to want to create a dedicated one for use by the DIYtraffic Bot. Make sure to name it something like traffic_<your-city-name-or-airport-code> so it is easily recognizable as a traffic feed.

2. If you want, you can attach a Twittbot (http://www.twittbot.com) to your Twitter account. The Twittbot is a nifty service which makes it possible for any @replies sent to your Twitter account to be posted as a status updated by the account. This effectively lets anyone report traffic information to your local traffic Twitter acccount. Check out the Twittbot site for more information on how to do this. Note: this isn't required, but it makes the system more effective by encouraging everyone to participate.

3. Download the source files, which contain an executable .jar file, some instructions, and a sample configuration file [note: i still need to write these instructions]. It was built against Java Runtime Environment (JRE) 6, so any server which has this version of Java should be able to run the code.

4. Edit the supplied sample config file to include your city's information and the username and password for the dedicated Twitter account you created.

5. Fire up the server! There are instructions on how to do this in the README file.

6. Make sure to edit this wiki page and include your city's Twitter feed name and information so that others can easily find it.

If the functionality provided by the core DIYtraffic Bot server isn't sufficient for your needs -- e.g. if you want to integrate the updates with Facebook, or prefer to use a local source of traffic information -- then you should consider building your own components to integrate with the DIYtraffic Bot! It's flexible enough to take updates from anywhere and post them to anywhere, provided that you write the bits of code which interface with the sources or services you're interested in. Check out the DIYtraffic source code repository hosted at gitHub. It's really well documented with code comments and Javadocs, and there are even instructions on how to build your own components.

If you build something cool, be sure to contribute it back to the repository and tell us about it, so we can include it in the next release. Good luck!

Personal tools