Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A little parser for Wikipedia's "On This Day" block

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 COPYING
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 onthisday.gemspec
README.rdoc

On This Day

A simple ruby parser for Wikipedia's “On this day” box on the (english-language) homepage.

Usage

Install the gem

gem install onthisday

Then fetch the current news items

@onthisday = OnThisDay::Parser.new
items = @onthisday.items

Items have text

items.first.text #=> "French Revolution: Meeting on a tennis court near the Palace of Versailles, members of France's Third Estate took the Tennis Court Oath, pledging not to separate until a new constitution was established."

A year

items.first.year #=> 1789

And associated topics (other related wikipedia pages)

items.first.topics #=> ['French_Revolution', 'Palace_of_Versailles', 'Estates_of_the_realm', 'Tennis_Court_Oath', 'Constitution']
Something went wrong with that request. Please try again.