Gamepedia Help Wiki
Azxiana (talk | contribs)
No edit summary
mNo edit summary
 
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
  +
{{Extension infobox
The '''RSSPie''' extension fetches and displays RSS feeds on a wiki page using a simple tagging format.
 
   
  +
| version = 2.1.0
==Download==
 
  +
| author = {{*}}Alexia E. Smith and Hydra Wiki Platform Team
{{ExtensionGitDownload}}
 
  +
| link = [https://gitlab.com/hydrawiki/extensions/rsspie GitLab]
 
  +
| desc =
==Installation==
 
  +
RSS extension based on the SimplePie library.
{{ExtensionInstall}}
 
  +
| gp =yes
  +
| default =yes
  +
| ucp = yes
  +
}}
 
The '''RSSPie''' extension fetches and displays RSS feeds, such as a game's news or changes to wiki pages, on a wiki page using a simple tagging format.
   
 
==Usage==
 
==Usage==
Line 30: Line 35:
 
Truncates long descriptions automatically to the specified character length.
 
Truncates long descriptions automatically to the specified character length.
 
|-
 
|-
| <code>dateFormat="''y/m/d H:i''"</code>
+
| <code>dateFormat="''Y/m/d H:i''"</code>
| Default: y/m/d H:i
+
| Default: Y/m/d H:i
 
Formats the date using PHP formatting guidelines. Please see the [http://www.php.net/manual/en/function.date.php PHP date] documentation for formatting information.
 
Formats the date using PHP formatting guidelines. Please see the [http://www.php.net/manual/en/function.date.php PHP date] documentation for formatting information.
  +
|-
  +
| <code>filterIn="''example,words''"</code>
  +
| Default: (None)
  +
Comma delimited list of search words to filter into the display. If the item in the feed contains any of the word(s) the item will be shown.
  +
|-
  +
| <code>filterOut="''example,words''"</code>
  +
| Default: (None)
  +
Comma delimited list of search words to filter out of the display. If the item in the feed contains any of the word(s) the item will be hidden. Any feed items that get caught by filterOut will hide regardless if they get caught by the filterIn parameter.
 
|}
 
|}
  +
  +
==Whitelisting feeds==
  +
Before a feed can be used, it must be whitelisted. Whitelisting RSS feeds is controlled through the protected [[Mediawiki:Rss_Whitelist]] page. Simply insert one filter per line. A fully qualified URL may be entered or a partial URL using * wildcards. Adding * to its own line will whitelist all URLs.
  +
  +
Here are some examples of whitelisting. Note that the comments should not be included.
  +
<pre>
  +
https://www.gamepedia.com/news.rss -- A specific rss feed on one site
  +
*/news.rss -- Any news.rss feed from any site
  +
https://www.gamepedia.com/*.rss -- Any feeds ending in .rss on one site
  +
https://www.gamepedia.com/* -- Any feeds from one site
  +
</pre>
  +
 
===Example===
 
This example displays a feed from [https://www.gamepedia.com Gampedia's home page] with a maximum of six items displayed.
 
<pre><rss max="6">https://www.gamepedia.com/news.rss</rss></pre>
 
<rss max="6">https://www.gamepedia.com/news.rss</rss>
  +
  +
  +
  +
<hr/>
  +
  +
  +
Another common use is creating a feed of a wiki's [[Special:RecentChanges|recent changes]], like so:
  +
<pre><rss max="5 - M-d-y">https://help.gamepedia.com/api.php?hidebots=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom</rss></pre>
  +
<rss max="5 - M-d-y">https://help.gamepedia.com/api.php?hidebots=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom</rss>
   
 
==Template for items in feeds==
 
==Template for items in feeds==
Line 52: Line 90:
 
Default [[Mediawiki:Rss_item_template]] template:
 
Default [[Mediawiki:Rss_item_template]] template:
 
<pre><nowiki>
 
<pre><nowiki>
  +
<div class='rss_item'>
 
'''<span class='plainlinks'>[{{{link}}} {{{title}}}]</span> - {{{author}}} - <span class='date_epoch'>{{{date}}}</span>'''
 
'''<span class='plainlinks'>[{{{link}}} {{{title}}}]</span> - {{{author}}} - <span class='date_epoch'>{{{date}}}</span>'''
 
: {{{description}}}
 
: {{{description}}}
  +
</div>
 
</nowiki></pre>
 
</nowiki></pre>
   
 
==Configuration settings==
===Example===
 
This example displays a feed from [http://www.gamepedia.com Gampedia's home page] with a maximum of six items displayed.
 
<pre><rss max="6">http://www.gamepedia.com/news.rss</rss></pre>
 
<rss max="6">http://www.gamepedia.com/news.rss</rss>
 
 
==Configuration Settings==
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|--
 
|--
Line 72: Line 107:
 
| Cache feed information for the specified amount of seconds. Note: Very short durations will increase server load and the number of requests made to the remote host.
 
| Cache feed information for the specified amount of seconds. Note: Very short durations will increase server load and the number of requests made to the remote host.
 
|}
 
|}
  +
  +
==Migration from [[:mediawikiwiki:Extension:RSS|Extension:RSS]]==
  +
* The date attribute was renamed to dateFormat. Please make sure to update the format to a [http://www.php.net/manual/en/function.date.php PHP date] compatible format.
  +
* The template attribute was renamed to itemTemplate and is the only template that needs to be edited. Simply copying the contents of Mediawiki:Rss-item to Mediawiki:Rss_item_template should suffice.
  +
  +
[[Category:Custom Gamepedia extensions]]
  +
  +
<!-- Extension prefix in other languages:
  +
  +
[[de:Erweiterung:{{subst:BASEPAGENAME}}]]
  +
[[es:Extensión:{{subst:BASEPAGENAME}}]]
  +
[[fr:Extension:{{subst:BASEPAGENAME}}]]
  +
[[it:Estensione:{{subst:BASEPAGENAME}}]]
  +
[[nl:Uitbreiding:{{subst:BASEPAGENAME}}]]
  +
[[pl:Rozszerzenie:{{subst:BASEPAGENAME}}]]
  +
[[pt:Extensão:{{subst:BASEPAGENAME}}]]
  +
[[ru:Расширение:{{subst:BASEPAGENAME}}]]
  +
[[zh:扩展:{{subst:BASEPAGENAME}}]]
  +
-->

Latest revision as of 19:17, 3 December 2020

The RSSPie extension fetches and displays RSS feeds, such as a game's news or changes to wiki pages, on a wiki page using a simple tagging format.

Usage

Each RSS feed must use its own set of <rss> element tags. There are optional parameters available for the rss opening tag.

Parameters in the RSS tag
Attribute Description
itemTemplate="PageName" Default: Mediawiki:Rss_item_template
 Item template is used to define the display template for individual items in a feed.  It requires a complete page name including namespace if needed.
max="X" Default: 5
 Show only X number of items from a feed.
sort="newest" Sort direction for feed items. Sorts newest first by default and can be set to oldest.
descriptionLength="200" Default: 200
 Truncates long descriptions automatically to the specified character length.
dateFormat="Y/m/d H:i" Default: Y/m/d H:i
 Formats the date using PHP formatting guidelines.  Please see the PHP date documentation for formatting information.
filterIn="example,words" Default: (None)
 Comma delimited list of search words to filter into the display.  If the item in the feed contains any of the word(s) the item will be shown.
filterOut="example,words" Default: (None)
 Comma delimited list of search words to filter out of the display.  If the item in the feed contains any of the word(s) the item will be hidden.  Any feed items that get caught by filterOut will hide regardless if they get caught by the filterIn parameter.

Whitelisting feeds

Before a feed can be used, it must be whitelisted. Whitelisting RSS feeds is controlled through the protected Mediawiki:Rss_Whitelist page. Simply insert one filter per line. A fully qualified URL may be entered or a partial URL using * wildcards. Adding * to its own line will whitelist all URLs.

Here are some examples of whitelisting. Note that the comments should not be included.

https://www.gamepedia.com/news.rss -- A specific rss feed on one site
*/news.rss -- Any news.rss feed from any site
https://www.gamepedia.com/*.rss -- Any feeds ending in .rss on one site
https://www.gamepedia.com/* -- Any feeds from one site

Example

This example displays a feed from Gampedia's home page with a maximum of six items displayed.

<rss max="6">https://www.gamepedia.com/news.rss</rss>





Another common use is creating a feed of a wiki's recent changes, like so:

<rss max="5 - M-d-y">https://help.gamepedia.com/api.php?hidebots=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom</rss>

UserProfile:DenysTv - 2024/04/18 12:39

DenysTv edited the Discord account on UserProfile:DenysTv's profile. denystv...

Template for items in feeds

NOTE:
Prof hydra Editing the item template is not required, but allows customization on how the information is displayed.

The template parser will substitute five pieces of information for each feed item as needed. {{{link}}} - The URL

{{{title}}} - Item Title

{{{author}}} - Author's Name

{{{date}}} - Epoch Date(Note: Display formatting is handled by Javascript in the browser.)

{{{description}}} - Full description or summarized content.


Default Mediawiki:Rss_item_template template:

<div class='rss_item'>
'''<span class='plainlinks'>[{{{link}}} {{{title}}}]</span> - {{{author}}} - <span class='date_epoch'>{{{date}}}</span>'''
: {{{description}}}
</div>

Configuration settings

Variable Default Value Description
$rpCacheDuration Default: 3600 seconds (One Hour) Cache feed information for the specified amount of seconds. Note: Very short durations will increase server load and the number of requests made to the remote host.

Migration from Extension:RSS

  • The date attribute was renamed to dateFormat. Please make sure to update the format to a PHP date compatible format.
  • The template attribute was renamed to itemTemplate and is the only template that needs to be edited. Simply copying the contents of Mediawiki:Rss-item to Mediawiki:Rss_item_template should suffice.