Extension:OpenGraphMeta

From mediawiki.org
This page is a translated version of the page Extension:OpenGraphMeta and the translation is 16% complete.
MediaWiki 拡張機能マニュアル
OpenGraphMeta
リリースの状態: ベータ
実装 データ抽出, パーサー関数
説明 Provides OpenGraph meta tags providing data for 3rd parties like Facebook to extract
作者 Daniel Friesen (Dantmanトーク)
最新バージョン 0.5.6
互換性の方針 master は後方互換性を維持しています。
MediaWiki 1.39+
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
Quarterly downloads 22 (Ranked 118th)
Public wikis using 5,841 (Ranked 42nd)
translatewiki.net で翻訳を利用できる場合は、OpenGraphMeta 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

The OpenGraphMeta extension provides OpenGraph protocol metadata for articles on the wiki for 3rd parties like Facebook to extract. The primary use for this extension is for any wiki that provides its users a button to "Like" pages on the wiki, especially if the wiki uses a custom default skin. As sometimes Facebook can extract undesirable parts from the page (known on some custom skins to potentially extract random images irrelevant to the content) providing this data gives Facebook clean data to display in likes, and cleans up the long title into a pair of clean site and page titles. A parser function {{#setmainimage:Filename.ext}} which also exports what it is passed so you can use it easily in a [[File:{{#setmainimage:Filename.ext}}|thumb|right|...]] format can be used to set the image in the article which you prefer Facebook to use when displaying information about the page on your wiki (hint: This works very nicely when you incorporate it into an infobox template making the infobox image the preferred image for 3rd parties to use).

This extension can also be paired with Extension:Description2 which extracts description information from articles, when both are installed OpenGraphMeta will make use of the information Description2 extracts.

We need to provide the ability to maximize the amount of information available of the shared content so that it is more descriptive, while still in compliance with our policy.

インストール

Try the development version, or choose the version that matches your version of MediaWiki if the trunk version breaks.
  • ダウンロードして、ファイルをextensions/フォルダー内のOpenGraphMetaという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenGraphMeta
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'OpenGraphMeta' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。


設定

In order to use Facebook Insights you must add the app ID to your page. Insights lets you view analytics for traffic to your site from Facebook. Find the app ID in your App Dashboard.[1]

$egFacebookAppId = 'YOUR_FACEBOOK_APP_ID_HERE'; // Optional
$egFacebookAdmins = 'FACEBOOK_ADMINS'; // Optional

The site name exposed in OpenGraphMeta metadata can be adjusted with the Opengraphmeta-site-name system message, if editing $wgSitename is undesired.

関連項目

References