-
Notifications
You must be signed in to change notification settings - Fork 16
Home
zverok edited this page Aug 7, 2015
·
7 revisions
Infoboxer is library targeting use of Wikipedia (or any other MediaWiki-based wiki) as a rich powerful data source.
It gets for you wiki pages, parses them and exposes data in easy navigable and queriable way. Like this:
Infoboxer.wikipedia.
get('Breaking Bad (season 1)').
sections('Episodes').templates(name: 'Episode table').
fetch('episodes').templates(name: /^Episode list/).
fetch_hashes('EpisodeNumber', 'EpisodeNumber2', 'Title', 'ShortSummary')
# => [{"EpisodeNumber"=>#<Var(EpisodeNumber): 1>, "EpisodeNumber2"=>#<Var(EpisodeNumber2): 1>, "Title"=>#<Var(Title): Pilot>, "ShortSummary"=>#<Var(ShortSummary): Walter White, a 50-year old che...>},
# {"EpisodeNumber"=>#<Var(EpisodeNumber): 2>, "EpisodeNumber2"=>#<Var(EpisodeNumber2): 2>, "Title"=>#<Var(Title): Cat's in the Bag...>, "ShortSummary"=>#<Var(ShortSummary): Walt and Jesse try to dispose o...>},
# ...and so on
See more of simple examples at Showcase, and proceed to Retrieving pages and Extracting data.