Skip to content

muffinista/really-simple-history-api

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
old
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

A Really Simple History API that pulls data from wikipedia to do a 'this day in history' type thing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published