Skip to contents

Parse a MediaWiki page url into its component parts (wiki name, wiki type, and page title). Supports both static page urls and their equivalent API calls.

Usage

wt_wiki_url_parse(url)

Arguments

url

(character) MediaWiki page url.

Value

a list with elements:

  • wiki - wiki language

  • type - wikipedia type

  • page - page name

See also

Other MediaWiki functions: wt_wiki_page_parse(), wt_wiki_page(), wt_wiki_url_build()

Examples

wt_wiki_url_parse(url="https://en.wikipedia.org/wiki/Malus_domestica")
#> $wiki
#> [1] "en"
#> 
#> $type
#> [1] "wikipedia"
#> 
#> $page
#> [1] "Malus_domestica"
#> 
wt_wiki_url_parse("https://en.wikipedia.org/w/api.php?page=Malus_domestica")
#> $wiki
#> [1] "en"
#> 
#> $type
#> [1] "wikipedia"
#> 
#> $page
#> [1] "Malus_domestica"
#>