Module:Présence en ligne
Apparence
[voir] [modifier] [historique] [purger]
Utilisation
[modifier le code]Ce module est utilisé dans le modèle:Réseaux sociaux.
Fonctions exportables :
fonction(frame)
– description (courte description defonction(frame)
et autres informations pertinentes).fonction2()
– description2 (courte description defonction2()
et autres informations pertinentes).
Autres fonctions :
fonction()
– description2 (courte description defonction()
et autres informations pertinentes).
Modules externes et autres éléments dont ce module a besoin pour fonctionner :
mw.title
– description (courte description expliquant la dépendance de ce module externe).
Exemples
[modifier le code]Pour des exemples, voir la page de test permettant de tester diverses modifications apportées.
La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis sa sous-page de documentation. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local p = {}
local wikidata = require "Module:Wikidata"
local bases = {
-- { nom, propriété Wikidata, format URL}
{"''Aftonbladet''", "P3479", "http://www.aftonbladet.se/tagg/$1"},
{"Ameblo", "P3502", "https://ameblo.jp/$1/"},
{"BBC News", "P6200", "https://www.bbc.co.uk/news/topics/$1/"},
{"''Courrier international''", "P5551", "https://www.courrierinternational.com/sujet/$1"},
{"''Dagens Næringsliv''", "P4167", "https://www.dn.no/topic/$1"},
{"''Dagens Nyheter''", "P3509", "https://www.dn.se/om/$1/"},
{"Dailymotion", "P2942", "http://www.dailymotion.com/$1"},
{"''L'Express''", "P6620", "https://www.lexpress.fr/infos/pers/$1.html"},
{"Facebook <small>(compte)</small>", "P2013", "https://www.facebook.com/$1"},
{"Facebook <small>(page du lieu)</small>", "P1997", "https://www.facebook.com/pages/-/$1"},
{"''Le Figaro''", "P6621", "http://plus.lefigaro.fr/tag/$1"},
{"Facebook <small>(page)</small>", "P4003", "https://www.facebook.com/$1"},
{"Flickr", "P3267", "https://www.flickr.com/photos/$1"},
{"Funk", "P6418", "https://www.funk.net/channel/$1"},
{"Giphy", "P4013", "https://giphy.com/$1"},
{"GitHub", "P2037", "https://github.com/$1"},
{"Google+", "P2847", "https://plus.google.com/$1"},
{"Google Actualités", "P5337", "https://news.google.com/topics/$1"},
{"''The Guardian''", "P3106", "https://www.theguardian.com/$1"},
{"Instagram <small>(compte)</small>", "P2003", "https://www.instagram.com/$1/"},
{"Instagram <small>(page du lieu)</small>", "P4173", "https://www.instagram.com/explore/locations/$1/"},
{"LinkedIn", "P2035", "https://www.linkedin.com/in/$1"},
{"LinkedIn", "P4264", "https://www.linkedin.com/company/$1/"},
{"LiveJournal", "P3258", "http://$1.livejournal.com/"},
{"Medium", "P3899", "https://medium.com/@$1"},
{"''Le Monde''", "P5558", "https://www.lemonde.fr/$1/"},
{"''Le Monde diplomatique''", "P3612", "http://www.monde-diplomatique.fr/index/$1"},
{"MySpace", "P3265", "https://myspace.com/$1"},
{"''The New York Times''", "P3221", "https://www.nytimes.com/topic/$1"},
{"''Objectif Gard''", "P6277", "http://www.objectifgard.com/tag/$1"},
{"Odnoklassniki", "P5163", "https://ok.ru/$1"},
{"''Le Parisien''", "P6622", "http://www.leparisien.fr/actus/$1"},
{"Pinterest", "P3836", "https://www.pinterest.com/$1/"},
{"Pressemappe 20. Jahrhundert", "P4293", "http://purl.org/pressemappe20/folder/$1"},
{"Quora", "P4411", "https://www.quora.com/profile/$1"},
{"Reddit", "P4265", "https://www.reddit.com/user/$1"},
{"RIA Novosti", "P6081", "https://ria.ru/spravka/00000000/$1.html"},
{"Sina Weibo", "P3579", "http://weibo.com/$1"},
{"SlideShare", "P4016", "https://www.slideshare.net/$1"},
{"Snapchat", "P2984", "https://www.snapchat.com/add/$1"},
{"TASS", "P6219", "https://tass.ru/info/$1"},
{"Telegram", "P3789", "https://t.me/$1"},
{"''The Times of India''", "P4204", "http://timesofindia.indiatimes.com/topic/$1"},
{"Tumblr", "P3943", "http://$1.tumblr.com/"},
{"Twitch", "P5797", "https://tools.wmflabs.org/wikidata-externalid-url/?p=5797&url_prefix=https://www.twitch.tv/&id=$1"},
{"Twitter", "P2002", "https://twitter.com/$1"},
{"Ustream", "P4017", "http://www.ustream.tv/$1"},
{"Vimeo", "P4015", "https://vimeo.com/$1"},
{"VKontakte", "P3185", "https://vk.com/$1"},
{"YouTube", "P2397", "https://www.youtube.com/channel/$1"},
{"YouTube", "P1651", "https://www.youtube.com/user/$1"},
{"SoundCloud", "P3040", "https://soundcloud.com/$1"},
}
function p.main(frame)
local id = frame.args.id
if id == "" then
id = nil
end
local entity = mw.wikibase.getEntityObject(id)
if not entity then
return nil
end
local vals = {}
for i, base in pairs(bases) do
local val = wikidata.formatStatements{entity = entity, text = base[1], property = base[2], urlpattern = base[3], numval = 1, addcat = true}
if val then
table.insert(vals, val)
end
end
if #vals == 0 then
return nil
end
local header = ''
if #vals > 1 then
header = "Présence dans des médias ou sur des [[Réseautage social|réseaux sociaux]] : "
else
header = "Présence dans un média ou sur un [[Réseautage social|réseau social]] : "
end
return wikidata.addLinkBack(header .. table.concat( vals, ' • ' ), entity, "identifiers" ) -- lien vers la section approriété de Wikidata
end
return p