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

mw.get(pagetitle) returns HTML. Json? #27

Open
paulmmay opened this issue Jan 8, 2012 · 4 comments
Open

mw.get(pagetitle) returns HTML. Json? #27

paulmmay opened this issue Jan 8, 2012 · 4 comments

Comments

@paulmmay
Copy link

paulmmay commented Jan 8, 2012

Hello

Given that MediaWiki can return Json, XML and other more parseable formats - could you add this into the utils? It should be pretty straightforward.

Thanks

@jpatokal
Copy link
Owner

If it's that straightforward, send me a pull request ;)

@aaronmase
Copy link

+1

@jpatokal
Copy link
Owner

jpatokal commented Feb 5, 2012

Since the smiley apparently wasn't enough: no, it's not that straightforward. The code currently assumes that API responses are always XML and parses them accordingly to check for errors, warnings, continuation etc etc. It's thus not possible to "just" return JSON, because the library has no capability to understand anything other than XML at the moment, and I don't see any easy way of adding such capability.

But again, if you think you can make this happen, code contributions are more than welcome.

@aaronmase
Copy link

I think XML is fine and retrieving it in other forms might be outside the scope of this gem in that case.

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

3 participants