Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template#expand #57

Open
zverok opened this issue Jan 2, 2016 · 0 comments
Open

Template#expand #57

zverok opened this issue Jan 2, 2016 · 0 comments
Milestone

Comments

@zverok
Copy link
Contributor

zverok commented Jan 2, 2016

Usage example:

wp.get('Iceland').infobox.fetch('population_estimate').text # => empty

It fetches link to {{Ispop}} -- it is too complex to be parsed by Infoboxer itself to extract data, but parsing can be delegated to Wikipedia itself.

# MediaWiktory code
wikipedia.expandtemplates.
  text('{{Ispop}}').prop(:wikitext).perform.raw.
  expandtemplates.wikitext # => "329,100"

# so, Infoboxer should can call it like, just
wp.get('Iceland').infobox.
  fetch('population_estimate').templates.first.expand # => "329,100"

Unfortunately, require #19 to be implemented for all non-trivial templates.

@zverok zverok modified the milestone: 0.3.0 Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant