Extension:PageViewInfo
リリースの状態: 安定 |
|
|---|---|
| 実装 | 自分のウィキ |
| 説明 | Provides an API of Wikimedia page view data |
| 作者 | Kunal Mehta (Legoktmトーク) |
| 互換性の方針 | MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。 |
| MediaWiki | 1.29+ |
| PHP | 5.5+ |
| データベースの変更 | いいえ |
| ライセンス | GNU 一般公衆利用許諾書 3.0 以降 |
| ダウンロード | |
|
|
|
MediaWiki\Extensions\PageViewInfo\PageViewService
|
|
| translatewiki.net で翻訳を利用できる場合は、PageViewInfo 拡張機能の翻訳にご協力ください | |
| Vagrant role | pageviewinfo |
| 問題点 | 未解決のタスク · バグを報告 |
PageViewInfo拡張機能は、ページビュー関連のデータにアクセスするためのAPIモジュールを提供し、「ページ情報」のインターフェイスに見やすいグラフを追加します。
データ収集や保存自体は行わず、データ収集バックエンドごとに実装が必要なPageViewServiceクラスに依存する。
インストール
- ダウンロードして、ファイルを
extensions/フォルダー内のPageViewInfoという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageViewInfo
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'PageViewInfo' );
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
Vagrantでのインストール:
- Vagrantを使用している場合は、
vagrant roles enable pageviewinfo --provisionでインストールしてください。
Local development
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.
API
prop=pageviews (pvip)
- This module requires read rights.
- Source: PageViewInfo
- License: GPL-3.0-or-later
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.
- 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 which ones are supported, under pageviewservice-supported-metrics / module name (siteviews, mostviewed, etc.)
- 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.
- Show pageview statistics for the main page.
- api.php?action=query&titles=Main_Page&prop=pageviews [open in sandbox]
meta=siteviews (pvis)
- This module requires read rights.
- Source: PageViewInfo
- License: GPL-3.0-or-later
Shows sitewide pageview data (daily pageview totals for each of the last pvisdays days).
The result format is date (Ymd) => count.
- 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 which ones are supported, under pageviewservice-supported-metrics / module name (siteviews, mostviewed, etc.)
- 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
- Show sitewide pageview totals.
- api.php?action=query&meta=siteviews [open in sandbox]
- Show sitewide unique visitor totals.
- api.php?action=query&meta=siteviews&pvismetric=uniques [open in sandbox]
list=mostviewed (pvim)
- 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).
- 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 which ones are supported, under pageviewservice-supported-metrics / module name (siteviews, mostviewed, etc.)
- 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
- List the top 10 pages.
- api.php?action=query&list=mostviewed [open in sandbox]
- Show pageview data for each of the top 10 pages.
- api.php?action=query&generator=mostviewed&prop=pageviews [open in sandbox]
コミュニティ インテグレーション
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.
- Extension:PageViewInfoGA - Supports Google Analytics integration.
- Extension:Plausible
独自の PageViewService を実装した場合は、ここに記載してください。
関連項目
| この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
