FTB-Gamepedia / MediaWiki-Butt-Ruby

A Ruby library for the MediaWiki API
https://rubygems.org/gems/mediawiki-butt
MIT License
9 stars 2 forks source link

How do I get a category URL? (article URL too) #82

Closed Nakilon closed 3 years ago

Nakilon commented 3 years ago

So I get categories as Strings like this:

wiki.get_all_categories

Now how do I get the URL for a category? Instead of building the "https://..." string manually.

elifoster commented 3 years ago

Category URL is not a property for that API action: https://www.mediawiki.org/w/api.php?action=help&modules=query%2Ballcategories

Nakilon commented 3 years ago

I didn't ask if it's a property of that API action. Seems like you just don't know the answer. Ok.

elifoster commented 3 years ago

You can build the URL accurately using siteinfo queries (specifically get_server and get_article_path), but there isn't a way to return full URLs directly from query methods that return article names.

Nakilon commented 3 years ago

Thank you.