Description Usage Arguments Details Value Author(s) See Also Examples
lists all links (to wikipedia and to external url) that are present in a specific wikipedia page.
1 |
page |
numeric identifier or character title of the specific wikipedia page |
domain |
a character value specifying the language of the wikipedia url.The default value is "en" for "english language". |
This function uses the MediaWiki API query syntax: "prop=links". For more details, see http://www.mediawiki.org/wiki/API:Properties#links_.2F_pl.
an object of class linksClass
containing:
call
the command line
page
title, identification number, and domain of the Wikipedia page
links
a data frame containing title
, the titles of the linked pages,
ns
, numbers of the namespaces (identification of the type of pages, defining nscat et nssubj, the two next variables),
nscat
, the categories of linked pages (Subject, Talk, or Virtual),
nssubj
, the subjects of the linked pages (Main Article, User, Wikipedia, File, MediaWiki, Template, Help, Category, Protal, Book, Draft, Education Program, TimedText, Module, Topic, Special, Media, Other).
For more details about namespace, see http://www.mediawiki.org/wiki/Help:Namespaces and http://en.wikipedia.org/wiki/Wikipedia:Namespace#Subject_namespaces
extlinks
a vector containing the list of url of external links. If there is no external link in the page, this item is not created.
testWikiPage
a list of four elements,
takeOnlyFirst
a boolean indicating if the class of page
parameter is invalid,
for example vector, list, matrix..., and in that case, only the first element is considered.
redirPage
title of the redirected url. This item is NULL if the page is not redirected.
test
an integer with value:
4 for invalid domain,
3 for an empty parameter page,
2 when Wikipedia does not have an article with this exact name,
1 for ambiguous page, direct or redirect,
0 for valid an unambiguous page, direct or redirect.
warnMessage
is a vector of warning messages.
Avner Bar-Hen, Louise Baschet, Francois-Xavier Jollois, Jeremie Riou
print.linksClass backLinks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# a simple example
links("Louis Pasteur") # default domain : en
# with a redirected page
links.Obama <- links(page ="Obama")
links.Obama
# warning message
# a simple example with page specified by its page ID number
links(page = 976, domain = "fr" )
# with a page that not exist (at the moment of the redaction of this help page)
links("zzzzz")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.