[−][src]Crate w_wiki
w-wiki
Conveniently shorten URLs using the w.wiki
service.
Only some Wikimedia projects are supported,
see the documentation
for more details.
w-wiki
's primary shorten
function is asynchronous.
let short_url = w_wiki::shorten("https://www.wikidata.org/wiki/Q575650") .await.unwrap();
If you plan on making multiple requests, a Client
is available that holds
connections.
let client = w_wiki::Client::new(); let short_url = client.shorten("https://www.wikidata.org/wiki/Q575650") .await.unwrap();
This library can be used by any MediaWiki wiki that has the UrlShortener extension installed.
let client = w_wiki::Client::new_for_api("https://example.org/w/api.php");
Structs
Client | Client if you need to customize the MediaWiki api.php endpoint |
MwError | API error info |
Enums
Error |
Functions
shorten | Shorten a URL using |