muffinista / Really Simple History Api
A Really Simple History API that pulls data from wikipedia to do a 'this day in history' type thing
Stars: ✭ 35
Programming Languages
ruby
36898 projects - #4 most used programming language
Really Simple History API
What is it?
I wanted to write a 'this day in history' twitter bot, which posts events which happened on this day. There's a few people on Twitter doing this already, but I am lazy and wanted to automate it.
Luckily, Wikipedia has entries for each day of the year. I wrote a parser to turn this into JSON data, and a very simple Sinatra app to spit out that data for any given day.
Just for kicks, I wrote a pretty simple JS interface as well. You can see it in action on the Today's History page.
How To Use
- Check out the code
- Run parse-wikipedia.rb -- This downloads data from Wikipedia for each day of the year and parses it into the JSON output.
- Get today's history in JSON format at /date.
- Get another day's history in JSON at /date/month/day where month and day are numbers. For example, /date/2/14 to get the history for February 14th.
- The data is split into births, deaths, and events. Each element is a hash with one 'text' field. I might add a URL or some other fields later.
- Take a look at the API javascript or the history ticker to see the code in use.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].