Extension:FeaturedFeeds

From mediawiki.org
This page is a translated version of the page Extension:FeaturedFeeds and the translation is 83% complete.
Other languages:
MediaWiki 拡張機能マニュアル
OOjs UI icon advanced-invert.svg
FeaturedFeeds
リリースの状態: 安定
px
実装 データ抽出, API , フック
説明 Adds syndication feeds of wiki's featured content
作者 Max Semenik (MaxSemトーク)
最新バージョン continuous updates
MediaWiki 1.19+
PHP 5.4+
データベースの変更 いいえ
ライセンス WTFPL 2.0
ダウンロード
CHANGELOG
  • $wgFeaturedFeedsDefaults
  • $wgDisplayFeedsInSidebar
  • $wgFeaturedFeeds
translatewiki.net で翻訳を利用できる場合は、FeaturedFeeds 拡張機能の翻訳にご協力ください

使用状況とバージョン マトリクスを確認してください。

問題点 未解決のタスク · バグを報告

FeaturedFeeds is an extension that creates daily feeds (Atom or RSS) of wiki's featured content (ranging from Featured Articles to Media of the Day). The feeds are added to site's main page and are available via the featuredfeed API module. See also: Extension:FeaturedFeeds/WMF deployment .

Using FeaturedFeeds

This extension requires that wikis use an automated process to publish their featured content daily (or at least very often).

ダウンロード

拡張機能は、Git から直接取得できる場合があります [?]:

  • コードを参照
  • 一部の拡張機能には安定版リリースのタグがあります。
    • タグを参照
    • タグを選択します
    • 「スナップショット」をクリックします
  • 各ブランチは過去の MediaWiki リリースと関連付けられています。 最新のアルファ バージョンを含む「master」ブランチもあります (MediaWiki のアルファ バージョンが必要な場合用)。

スナップショットを展開して、MediaWiki インストレーション内の extensions/FeaturedFeeds/ ディレクトリに配置します。

git に馴染みがあり、かつサーバーにシェルでアクセスできる場合は、拡張機能を以下のようにして取得することもできます:

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/FeaturedFeeds.git

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のFeaturedFeedsという名前のディレクトリ内に配置します。
  • 以下のコードを LocalSettings.php の末尾に追加します:
    wfLoadExtension( 'FeaturedFeeds' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

A wiki must have some means of caching set up to use FeaturedFeeds, or everything will be super slow.

設定

Variable name Description
$wgFeaturedFeeds Contains array of feed definitions in the following format:
'feed name' => [
	'page' => <message name>,
	'title' => <message name>,
	'description' => <message name>,
	'entryName' => <message name>,
]

Mandatory items:

'page'
Name of the interface message that contains an expression that evaluates to the title of the page with today's feed entry. For example, for English Wikipedia's featured articles feed it could contain Wikipedia:Today's featured article/{{#time:F j, Y}} that evaluates (using ParserFunctions, but ordinary date/time magic words may be used as well) to Wikipedia:Today's featured article/8月 12, 2022. This message always uses content language.
'title'
Name of the interface message that contains feed title, for example "My Page of the Day Feed".
'description'
A longer description of the feed, used for ‎<subtitle> Atom element, and ‎<description> RSS element.
'entryName'
Name of the interface message that contains heading of feed's individual entries.

Also see below for optional settings.

$wgFeaturedFeedsDefaults Provides default values for some parameters of every feed from $wgFeaturedFeeds.

Default value:

[
	'limit' => 10,
	'inUserLanguage' => false,
]
'limit'
Maximum number of entries (ie number of days) in the feed.
'inUserLanguage'
Whether user's preferred language should be honored by the feed. For example, it doesn't make much sense to have English Wikipedia's featured articles feed in languages other than English as the content is always in English anyway. But Commons' picture of the day feed contains images and their descriptions that are available in many languages, so it actually benefits from its description's localisation.
$wgDisplayFeedsInSidebar Whether links to feeds should be displayed in sidebar on main page

On-site configuration

See the full subpage for details on the Wikimedia projects configuration


Message names

Each feed has the following messages controlling its behavior (replace * with feed name, chosen among those above):

Message Description Example
ffeed-*-page Title of the page that contains day's featured content.
Has one optional parameter, $1, which gets substituted with feed language code for use in multilingual feeds (currently, only on Commons).
Wikipedia:Today's featured article/{{#time:F j, Y}}
ffeed-*-title Feed name Wikipedia featured articles feed
ffeed-*-short-title Short feed name, could be used on sidebar in the future Featured articles
ffeed-*-desc More lengthy feed description Best articles on Wikipedia!!!
ffeed-*-entry Title of each day's entry {{CURRENTMONTHNAME}} {{CURRENTDAY}} Wikipedia featured article

How to set up a feed

Create a page named MediaWiki:Ffeed-*-page containing the page title (again, replace * with the feed's name). Two cases are possible here:

  • The wiki has a new page for each day, e.g. Wikipedia:Today's featured article/8月 12, 2022 on the English Wikipedia. In such case, the title can use date and time magic words or #time parser functions to incorporate the date in the page title. The title in the example here is Wikipedia:Today's featured article/{{#time:F j, Y}}.
  • The wiki uses a single template that uses date magic internally to display proper content. In such cases, either point MediaWiki:Ffeed-*-page to that template directly, or, if it has ‎<noinclude> sections not intended for readers to see, point it to a page that contains a transclusion of the said template and nothing else.
If you need to translate or tweak interface messages of a feed, do that before creating MediaWiki:Ffeed-*-page, otherwise your new feed might take up to one hour to catch up these changes.

How to publish feeds in the sidebar

Just create page MediaWiki:Ffeed-enable-sidebar-links with content other than a dash (-) or an empty string. A section called "Featured content feeds" will appear in the sidebar on the main page.


API module

www.mediawiki.org has no featured feeds, so the generated API documentation on this wiki is not very useful.

Instead, see the generated API documentation on enwiki, which lists the feeds it provides and has a working example.