-
Notifications
You must be signed in to change notification settings - Fork 16
Retrieving pages
zverok edited this page Jun 16, 2015
·
8 revisions
# One page
Infoboxer.wikipedia.get('Argentina')
# also aliased is Infoboxer.wp
# Several pages (in one API request)
Infoboxer.wikipedia.get('Argentina', 'Bolivia', 'Chile')
# From non-English Wikipedia
Infoboxer.wikipedia('fr').get('Argentine')
# or, if it looks cleaner for you
Infoboxer.wikipedia(:fr).get('Argentine')
Infoboxer.wiktionary.get('test')
Infoboxer.wikiquote.get('Vonnegut')
Wikia hosts a lot of of interesting Wikis, all published under copyleft and very interesting to stud. So, Infoboxer provides shortcut for this, too:
# Default language
Infoboxer.wikia('tardis').get('Eleventh Doctor')
# Other language:
Infoboxer.wikia('tardis', :fr).get('Onzième Docteur')
As simple as that:
Infoboxer.wiki('mydomain.com').get('My Product')
Note: this assumes you have api.php
installed as usual at /w/api.php
.
If it is not so, use slightly more verbose version with full api URL:
Infoboxer.wiki('http://mydomain.com/myapipath/api.php').get('My Product')