Module: Infoboxer
- Extended by:
- Infoboxer
- Included in:
- Infoboxer
- Defined in:
- lib/infoboxer.rb,
lib/infoboxer/tree.rb,
lib/infoboxer/parser.rb,
lib/infoboxer/version.rb,
lib/infoboxer/tree/ref.rb,
lib/infoboxer/templates.rb,
lib/infoboxer/tree/html.rb,
lib/infoboxer/tree/list.rb,
lib/infoboxer/tree/node.rb,
lib/infoboxer/tree/text.rb,
lib/infoboxer/media_wiki.rb,
lib/infoboxer/navigation.rb,
lib/infoboxer/tree/image.rb,
lib/infoboxer/tree/nodes.rb,
lib/infoboxer/tree/table.rb,
lib/infoboxer/parser/html.rb,
lib/infoboxer/parser/util.rb,
lib/infoboxer/tree/inline.rb,
lib/infoboxer/parser/image.rb,
lib/infoboxer/parser/table.rb,
lib/infoboxer/parser/inline.rb,
lib/infoboxer/templates/set.rb,
lib/infoboxer/tree/compound.rb,
lib/infoboxer/tree/document.rb,
lib/infoboxer/tree/linkable.rb,
lib/infoboxer/tree/template.rb,
lib/infoboxer/tree/wikilink.rb,
lib/infoboxer/parser/context.rb,
lib/infoboxer/templates/base.rb,
lib/infoboxer/media_wiki/page.rb,
lib/infoboxer/parser/template.rb,
lib/infoboxer/tree/paragraphs.rb,
lib/infoboxer/media_wiki/traits.rb,
lib/infoboxer/navigation/lookup.rb,
lib/infoboxer/parser/paragraphs.rb,
lib/infoboxer/navigation/sections.rb,
lib/infoboxer/navigation/selector.rb,
lib/infoboxer/navigation/shortcuts.rb,
lib/infoboxer/definitions/en.wikipedia.org.rb
Overview
Main client module for entire infoboxer functionality. If you're lucky, there's no other classes/modules you need to instantiate or call directly. You just do:
Infoboxer.wp.get('List of radio telescopes')
# or
Infoboxer.wikiquote.get('Vonnegut')
...and have fully navigable Wiki information.
Please read wiki for extensive showcases and usage recommendations.
Here's main components list, which also can serve as a TOC for Infoboxer's functionality (we suggest to read their docs in this order):
- Tree -- nodes, of which Wikipedia AST is consisting; you'll be interested in basic Tree::Node functionality, as well as node classes list (which is useful for navigation);
- Navigation -- how to navigate the tree you have, basic way (children, parents, siblings) and hi-level shortcuts way (like all unnumbered list items in second level-3 section);
- Templates -- the most advanced data extraction from wikipedia definitely needs your undestanding of this (rather complicated) topic.
You also may be interested in (though may be never need to use them directly):
NB Infoboxer
module can also be included in other classes, like
this:
class MyDataGrabber
include Infoboxer
def initialize
wikipedia.get('Argentina')
end
end
Defined Under Namespace
Modules: Navigation, Templates, Tree Classes: MediaWiki, Parser
Constant Summary collapse
Class Method Summary collapse
-
.user_agent=(ua) ⇒ Object
Sets user agent string globally.
Instance Method Summary collapse
-
#commons(options = {}) ⇒ Object
Includeable version of #commons.
-
#species(options = {}) ⇒ Object
Includeable version of #species.
-
#wiki(api_url, options = {}) ⇒ MediaWiki
Default method for creating MediaWiki API client.
-
#wikia(*domains) ⇒ Object
Includeable version of #wikia.
-
#wikibooks(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikibooks.
-
#wikinews(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikinews.
-
#wikipedia(lang = 'en', options = {}) ⇒ Object
(also: #wp)
Includeable version of #wikipedia.
-
#wikiquote(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikiquote.
-
#wikisource(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikisource.
-
#wikiversity(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikiversity.
-
#wikivoyage(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikivoyage.
-
#wiktionary(lang = 'en', options = {}) ⇒ Object
Includeable version of #wiktionary.
Class Method Details
.user_agent=(ua) ⇒ Object
Sets user agent string globally. Default user agent is Infoboxer::MediaWiki::UA.
User agent can also be rewriten as an option to #wiki method (and its shortcuts like #wikipedia), or by using Infoboxer::MediaWiki#initialize explicitly.
233 234 235 |
# File 'lib/infoboxer.rb', line 233 def Infoboxer.user_agent=(ua) MediaWiki.user_agent = ua end |
Instance Method Details
#wiki(api_url, options = {}) ⇒ MediaWiki
Default method for creating MediaWiki API client.
77 78 79 |
# File 'lib/infoboxer.rb', line 77 def wiki(api_url, = {}) WIKIS[api_url] ||= MediaWiki.new(api_url, || {}) end |
#wikibooks(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikibooks
|
# File 'lib/infoboxer.rb', line 109
|
#wikinews(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikinews
|
# File 'lib/infoboxer.rb', line 134
|
#wikipedia(lang = 'en', options = {}) ⇒ Object Also known as: wp
Includeable version of #wikipedia
|
# File 'lib/infoboxer.rb', line 96
|
#wikiquote(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikiquote
|
# File 'lib/infoboxer.rb', line 114
|
#wikisource(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikisource
|
# File 'lib/infoboxer.rb', line 124
|
#wikiversity(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikiversity
|
# File 'lib/infoboxer.rb', line 119
|
#wikivoyage(lang = 'en', options = {}) ⇒ Object
Includeable version of #wikivoyage
|
# File 'lib/infoboxer.rb', line 129
|
#wiktionary(lang = 'en', options = {}) ⇒ Object
Includeable version of #wiktionary
|
# File 'lib/infoboxer.rb', line 145
|