Class: Wikiscript::Client
- Inherits:
-
Object
- Object
- Wikiscript::Client
- Includes:
- LogUtils::Logging
- Defined in:
- lib/wikiscript/client.rb
Constant Summary collapse
- SITE_BASE =
'https://{lang}.wikipedia.org/w/index.php'
Instance Method Summary collapse
-
#text(title, lang: Wikiscript.lang) ⇒ Object
change to: wikitext or raw why? why not? or to raw? why? why not?.
Instance Method Details
#text(title, lang: Wikiscript.lang) ⇒ Object
change to: wikitext or raw why? why not? or to raw? why? why not?
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wikiscript/client.rb', line 13 def text( title, lang: Wikiscript.lang ) ## todo/fix: convert spaces to _ if not present for wikipedia page title - why ?? why not ??? ## note: replace lang w/ lang config if present e.g. ## http://{lang}.wikipedia.org/w/index.php # becomes # http://en.wikipedia.org/w/index.php or # http://de.wikipedia.org/w/index.php etc base_url = SITE_BASE.sub( "{lang}", lang ) params = { action: 'raw', title: title } get( base_url, params ) end |