I wrote a plugin for an IRC/Campfire bot that leverages the ESPN API using CoffeeScript. The bot is called hubot and was originally developed by GitHub who then open sourced the project. The bot allows for interactivity from chat room members by allowing members to query the bot for specific information via different plugins. In this case I used the ESPN API to create a plugin which retrieves the headlines and team pages JSON data (the only data I found that I could currently retrieve) and displays the queried information to the user. So essentially, a user could enter the chat room and type 'sportbot espn nfl chargers' to retrieve the ESPN home page for the San Diego Chargers. In this case, sportbot is the name of the bot that is idling in the chat room and is running the code via Heroku. In the other case, the user could simply type 'sportbot espn headline' to get a random latest headline from ESPN.
This plugin is pretty simple. I would like to use the ESPN API in combination with Facebook/Twitter for another side project a little more advanced, but I am not sure with the current public API limitations.
You can find the source code for my CoffeeScript plugin on my public GitHub Page.
Message edited by Mike Wilcox 9 months ago
9 months ago
I forgot to mention that I currently have a bot running this script on irc.freenode.net in room #MLB-talk. When you enter the room you can type 'sportbot help' to see a list of all the commands.
Please sign in to add a post.