Extension:PageViewInfo

From mediawiki.org
This page is a translated version of the page Extension:PageViewInfo and the translation is 100% complete.
Manuel des extensions MediaWiki
PageViewInfo
État de la version : stable
Implémentation MyWiki
Description Provides fancy looking graphs of Wikimedia page view data
Auteur(s) Kunal Mehta (Legoktmdiscussion)
Politique de compatibilité Versions ponctuelles alignées avec MediaWiki. Le master n'est pas compatible arrière.
MediaWiki 1.29+
PHP 5.5+
Modifie la base
de données
Non
Licence Licence publique générale GNU v3.0 ou supérieur
Téléchargement
  • $wgPageViewApiMaxDays
  • $wgPageViewInfoWikimediaEndpoint
  • $wgPageViewInfoWikimediaRequestLimit
  • $wgPageViewInfoWikimediaDomain
MediaWiki\Extensions\PageViewInfo\PageViewService
Téléchargements trimestriels 39 (Ranked 109th)
Utilisé par les wikis publics 867 (Ranked 295th)
Traduire l’extension PageViewInfo sur translatewiki.net si elle y est disponible
Rôle Vagrant pageviewinfo
Problèmes Tâches ouvertes · Signaler un bogue

L'extension PageViewInfo fournit des modules API pour accéder aux données relatives aux pages vues et ajoute des graphiques d'apparence sophistiquée à l'interface "Informations sur la page".

Elle ne collecte pas les données, ni ne les stocke ; elle s'appuie sur la classe PageViewService qui doit être implémentée dans chaque backend de collecte des données.

Installation

  • Nécessite l'extension de Graph si vous voulez voir les graphiques sophistiqués
  • Téléchargez et placez le(s) fichier(s) dans un répertoire appelé PageViewInfo dans votre dossier extensions/.
    Les développeurs et les contributeurs au code doivent à la place installer l'extension à partir de Git en utilisant:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageViewInfo
  • Ajoutez le code suivant à la fin de votre fichier LocalSettings.php  :
    wfLoadExtension( 'PageViewInfo' );
    
  • Yes Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.


Installation Vagrant :

  • Si vous utilisez Vagrant , installez avec vagrant roles enable pageviewinfo --provision

Développement local

For local development, you can point the extension at Wikimedia production using the following additions to LocalSettings.php:

$wgPageViewInfoWikimediaDomain = "en.wikipedia.org";

When enabled, visiting MediaWiki?action=info on your local development server will show page views for the MediaWiki article on English Wikipedia rather than on your local site.

When the Graph extension is enabled, clicking the number of page views will open an overlay displaying a graph of page views.

API

prop=pageviews (pvip)

(main | query | pageviews)

Shows per-page pageview data (the number of daily pageviews for each of the last pvipdays days).

The result format is page title (with underscores) => date (Ymd) => count.

Specific parameters:
Other general parameters are available.
pvipmetric

The metric to use for counting views. Depending on what backend is used, not all metrics might be supported. You can use the siteinfo API (action=query&meta=siteinfo) to check, under pageviewservice-supported-metrics / <module name>

pageviews
Plain pageviews.
One of the following values: pageviews
Default: pageviews
pvipdays

The number of days to show.

Type: integer
The value must be between 1 and 60.
Default: 60
pvipcontinue

When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.

Example:
Show pageview statistics for the main page.
api.php?action=query&titles=Main_Page&prop=pageviews [open in sandbox]

meta=siteviews (pvis)

(main | query | siteviews)

Shows sitewide pageview data (daily pageview totals for each of the last pvisdays days).

The result format is date (Ymd) => count.

Specific parameters:
Other general parameters are available.
pvismetric

The metric to use for counting views. Depending on what backend is used, not all metrics might be supported. You can use the siteinfo API (action=query&meta=siteinfo) to check, under pageviewservice-supported-metrics / <module name>

pageviews
Plain pageviews.
uniques
Unique visitors.
One of the following values: pageviews, uniques
Default: pageviews
pvisdays

The number of days to show.

Type: integer
The value must be between 1 and 60.
Default: 60

list=mostviewed (pvim)

(main | query | mostviewed)
  • This module requires read rights.
  • This module can be used as a generator.
  • Source: PageViewInfo
  • License: GPL-3.0-or-later

Lists the most viewed pages (based on last day's pageview count).

Specific parameters:
Other general parameters are available.
pvimmetric

The metric to use for counting views. Depending on what backend is used, not all metrics might be supported. You can use the siteinfo API (action=query&meta=siteinfo) to check, under pageviewservice-supported-metrics / <module name>

pageviews
Plain pageviews.
One of the following values: pageviews
Default: pageviews
pvimlimit

The number of pages to return.

Type: integer or max
The value must be between 1 and 500.
Default: 10
pvimoffset

When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.

Type: integer
Default: 0


Intégration communautaire

Currently, PageViewService class is only implemented for the Wikimedia Pageview API in this extension. You must install an additional, community-maintained extension to use other data collection backend.

Si vous avez implémenté votre propre PageViewService, veuillez l'indiquer ici.

Voir aussi