Extension talk:RSS

Jump to navigation Jump to search

About this board

It is preferred that you open a regular bug report for new issues.
Check the manual page for the new parameters $wgRSSUrlWhitelist and $wgRSSUrlNumberOfAllowedRedirects.
Check the archived version of the page for problems which has been reported with earlier versions.

Along with your question, please indicate versions from your wiki's version page

checklist: MediaWiki components
check your wiki's version page

for component

what version do you run?
MediaWiki version and revision
RSS extension version and revision

Please study the MediaWiki debug manual. Before reporting here, please always check your logfiles for obvious problems such as missing files due to wrong include paths and so. Add the following line temporarily to your LocalSettings.php and try to log in with OpenID

$wgDebugLogFile = "/tmp/{$wgSitename}-debug.log"; // my wiki's debug logfile - comment the line after use
Warning: Make sure to have the debug file unaccessible for the public, and via the web, as the debug file may contain confidential information such as cookies.
It is preferred that you open a regular bug report for new issues.

Could I use {{{1}}} in RSS feed URL ?

Alexandroslee (talkcontribs)

how could I use a dynamic RSSfeed URL ?

I had a template such as template:newsfeed

then call as {{template:newsfeed|123456}}

and I setup template:newsfeed like this

<rss max="6" template="newsfeed">www.abc.com/rssfeed?no={{{1}}}</rss>

but seem the RSSfeed URL won't work {{{1}}} ?

then change to direct number like this

<rss max="6" template="newsfeed">www.abc.com/rssfeed?no=123456</rss>

the news show ,

but I need the dynamic RSSfeed URL

how could I use a dynamic RSSfeed URL ?

This post was hidden by Alexandroslee (history)
This post was hidden by Alexandroslee (history)
Alexandroslee (talkcontribs)

there is templet:$1 of MediaWiki:Rss-item

How can i do ?

It4history (talkcontribs)

I solved this problem by hacking code in the file RSSHooks.php

I added at line 27 just after "public static function renderRss..."

$input = $parser->replaceVariables($input);

Reply to "Could I use {{{1}}} in RSS feed URL ?"

could we have a Parser Tag for Templates of RSS

Alexandroslee (talkcontribs)

Just like embed video have Parser Tag for Templates like this

{{#evt: service=youtube |id=https://www.youtube.com/watch?v=pSsYTj9kCHE |alignment=right }}

so I could setup a template like this
Template:embedvideo as

{{#evt: service=youtube |id=https://www.youtube.com/watch?v={{{1}}} |alignment=right }}

then I could call like this


if rss could have the Parser Tag for Templates

maybe we have one template

Template:cnn_rss as

{{#rss: max=10 |id=http://rss.cnn.com/rss/{{{1}}} |..... }}

so we would call like




could we?

Reply to "could we have a Parser Tag for Templates of RSS"

the elements "comments" seems can't pass the url ? what's worng I made?

Alexandroslee (talkcontribs)

I made a templet

[{{{comments}}} {{{author}}}] ''' [{{{link}}} {{{title}}}] ''' {{{description}}}

the elements :"link" pass the url as well, but the elements "comments" seems can't pass the url ? what's worng I made?

Alexandroslee (talkcontribs)


like this ?

CayceP (talkcontribs)

I think {{{comments}}} is not a valid call for the parser.

Alexandroslee (talkcontribs)

Oops! how could call the url pass throuth comment ?

CayceP (talkcontribs)

No idea. Probably by either manipulating the corresbonding .php file in your installtion yourself or by opening a change request in Phabricator.

Reply to "the elements "comments" seems can't pass the url ? what's worng I made?"

RSS.php not in git repo

Summary by CayceP

After install version 1.27 all problems had been solved!

JimHu (talkcontribs)

I'm guessing the installation section needs to be modified for those running <1.27?

CayceP (talkcontribs)

Yes, the file seems to be missing in the latest repository version. I tried to use the RSS.php from the version before but that threw an fatal exception in my installation. Couldn't get the lastest version to work at all in my 1.29.x installation.

Alexandroslee (talkcontribs)

Would you mind telling me how to find RSS.php ?

CayceP (talkcontribs)
Alexandroslee (talkcontribs)

Thanks a lot!

Alexandroslee (talkcontribs)

how to setup $wgRSSUrlWhitelist ?

show error message

"rss-empty-whitelist": " \"$1\" 不在允許訂閱白名單中。此白名單並無允許訂閱之 URL。",

"rss-empty-whitelist": "\"$1\" is not in the whitelist of allowed feeds. There are no allowed feed URLs in the whitelist.",

but I don't know how to setup $wgRSSUrlWhitelist ?

Alexandroslee (talkcontribs)

which file I could setup $wgRSSUrlWhitelist ? or when I edit the content?

URL whitelist of RSS Feeds, the whitelist is empty by default and no URLs are allowed. If there are items in the array, and the used feed URL isn't in the array, it will not be allowed.

Use array( "*" ) if you as admin want to allow anyone to use any feed Url.

CayceP (talkcontribs)

you need to define the array of allowed urls of $wgRSSUrlWhitelist in your wikis LocalSettings.php

Alexandroslee (talkcontribs)

seem setup in RSS.php but I still can't find it ?

is the first time seem there is RSS.php but the second time , disappear ?!

Alexandroslee (talkcontribs)

only version 1.27 has RSS.php

Alexandroslee (talkcontribs)

install version 1.27 had solve my problem! Thanks a lot !

Alexandroslee (talkcontribs)

Where can I edit the template MediaWiki:Rss-item which determines which item elements are used

{{ MediaWiki:Rss-feed \
 | title = {{{title}}} \
 | link = {{{link}}} \
 | date = {{{date}}} \
 | author = {{{author}}} \
 | description = {{{description}}} }}
CayceP (talkcontribs)

Looks for an article/page on your mediawiki called MediaWiki:Rss-item , if there is none, create a page/article and copy and paste the template content from your post and your should be done.

Alexandroslee (talkcontribs)

Thank you! after install version 1.27 all problems had been solved!

[RESOLVED WORKSFORME] "allow all URLs" wont work

Bawolff (talkcontribs)

Copying from a thead at Project:Support_desk - https://www.mediawiki.org/wiki/Thread:Project:Support_desk/Extension:RSS_-_"allow_all_URLs"_wont_work (Wikinaut asked me to do this so the issues for E:RSS stay organized, and LQT move feature hates me)


one problem solved, the next matter appears. Now I want to add a RSS feed extension to my Wiki. As for the installation part, no trouble. I downloaded it here:


According to the RSS.php I got the newest version from April 24th. Now as I wanted to test with the first feed I used this code:


First, I receive this error:

Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.

After refreshing, the error however changes to a more informative matter:

http://blog.wikimedia.org/feed/ is not in the whitelist of allowed feeds. There are no allowed feed URLs in the whitelist.

So I googled and I found what caused it - suprise - the URL wasn't added to the whitelist. I did that now and it looks something like this:

$wgRSSUrlWhitelist = "blog.wikimedia.org/feed/";

This should do it for a start. I'm not even thinking about using another feed, I just want to see those fancy WikiMedia news now. But unfortunatly, they wont appear.

http://blog.wikimedia.org/feed/ is not in the whitelist of allowed feeds. //blog.wikimedia.org/feed/ is the only allowed feed

I tried quite a few things:

* $wgRSSUrlWhitelist = "blog.wikimedia.org/feed/";
* $wgRSSUrlWhitelist = "http://blog.wikimedia.org/feed/";
* $wgRSSUrlWhitelist = "*";
* $wgRSSUrlWhitelist = array( "*" );
* $wgRSSUrlWhitelist = array("*");
* $wgRSSUrlWhitelist = array("blog.wikimedia.org/feed/");

Whatever I do, I don't get it to work. It beheaves very strangly, as I add the array ("*") and it still gives me the same error message with that the feed I want to use is not the one that is on the list (instead of telling me that there aren't any on that list at all). And yes, my WikiMedia version matches the requirements.

What can I do? Thanks in advance, hpH

Wikinaut (talkcontribs)

Hi, please indicate your exact versions:

PHP, MediaWiki, RSS extension.

In my reference installation. it works perfectly.

Make sure to have the correct order of statements (first: require...., then your parameters!) in order to really overwrite the built-in default settings for the whilelist with your wanted values:

require_once("$IP/extensions/RSS/RSS.php"); /* git version from https://github.com/Wikinaut/mediawiki-extension-RSS  */
$wgRSSUrlWhitelist = array( "*" ); /* see documentation for security issues */
$wgRSSUrlNumberOfAllowedRedirects = 1;
$wgRSSAllowLinkTag = true;
$wgAllowImageTag = true;
Wikinaut (talkcontribs)

The bug reporter answered:

Hey guys,

   MediaWiki: 1.19.1
   PHP: 5.3.15 (cgi-fcgi)
   MySQL: 5.1.61-0+squeeze1-log

Thats that. But I 'figured' out the whats the problem. It is as Bawolff stated, the hoster disabled the function to open the URLs. cURL wouldn't work either and their policy is to keep those ports closed. As long as I am at this provider I won't be able to use the RSS-extension. They mentioned fsockopen as an alternative, but I can't use that as I have not enough of some digital currency there.

Thanks though, as soon as I change the hoster I'll get back to you with feedback.‎15:24, 12 August 2012 (talkcontribs)

MediaWiki: 1.19.1

Does not worked with RSS cause function wfRandomString() not defined in GlobalFunctions.php

Reply to "[RESOLVED WORKSFORME] "allow all URLs" wont work"
أحمد (talkcontribs)

Is it possible to specify in mediawiki:Rss-item elements other than those specified by default to pass to mediawiki:Rss-feed? For example "category" and/or "dc:subject"?

أحمد (talkcontribs)

Also, I'm trying to understand how the system works:

If it is not possible to specify elements, what's the rationale behind a two-template design?

Why can't one just use the template that fleshes out feed items directly, processing only desired elements among those hardcoded in the extension and ignoring the rest?

Reply to "Other elements?"
أحمد (talkcontribs)

The naming of the default templates is somewhat confusing:

Mediawiki:Rss-item should be named Mediawiki:Rss-elements, since all it does is pass the items' elements selected for processing to the formatting template.

While Mediawiki:Rss-feed is the one that should be named Mediawiki:Rss-item since what it does is display/format one item per transclusion.

The feed, or channel according to RSS nomenclature, is comprised of the collection of items, each of which is represented by the latter template.

Reply to "Naming of default templates"

Failed to load RSS feed from https server. Error fetching URL: Peer certificate cannot be authenticated with known CA certificates

7 (talkcontribs)

Just wondering if anyone else had incurred this error before with this extension ? Does the RSS extension use cURL to get the feed ? I probably would have to get mod_ssl for my Wiki in order to connect to the SSL server but even then, the certificate may be bad. Does anyone know if I can make the extension, or if it uses cURL to somehow make it ignore the certificate in question ?

Shayne l (talkcontribs)
Jasper Deng (talkcontribs)

Did you try not using SSL? (talkcontribs)

Jasper - yeah, I did try running the server we wanted to get the feed from, on a non secure port (that is, an unencrypted port) but got what Shayne above is getting. Not sure what's up. Both servers sit behind a reverse proxy server and there's also an ldap server in the mix which users need to get authenticated with which involves cookies being dropped. Also some redirection is being done but noticed there is a parameter for redirection - which i used but still no good.

Wikinaut (talkcontribs)

The message

Error parsing XML for RSS

comes from older RSS extension versions. Apart from a possible SSL problem, you need to use the version indicated on the RSS article page:

2.15 r114168 (2012-03-19 (use revision r114168 in SVN))

Warning: the version in git is currently not up to date (due to pending code reviews).

Older versions did not correctly parse all kinds of feeds. A good way to check the extension is to copy the XML feeds from the original server to a different non-SSL server and then to let the RSS extension load from there.

This post was hidden by (history)
This post was hidden by (history)
Reply to "Failed to load RSS feed from https server. Error fetching URL: Peer certificate cannot be authenticated with known CA certificates"
2003:63:2F1B:A712:76D4:35FF:FEF7:1C46 (talkcontribs)

Using this extension with Google Feeds returns HTML code of intended thumbnails instead of descriptions, which can be removed by a template excluding descriptions altogether, e.g.: Template:Google-feed:

[{{{link}}} {{{title}}}]
{{{author}}} {{{date}}}

<rss template="Google-feed">http://news.google.com/news?pz=1&cf=all&ned=fr&hl=fr&q=iphone&output=rss</rss>

Or does anyone have better a solution to include descriptions without Google's HTML markup appearing in the output?

Yellowdog (talkcontribs)

Having tested various settings with images and HTML I can conclude including descriptions with Google feeds does not work. Only link, title and date works.

CayceP (talkcontribs)

I was able to fix this on my local XAMPP installation like this for Mediawiki 1.27.0 and RSS Version 2.25.0 (2014-03-28):PHP 5.6.23 (apache2handler), MySQL 5.5.39

in RSSParser.php remove the following if condition in line 403

if ( isset( $wgRSSAllowImageTag ) && $wgRSSAllowImageTag ) {

$extraInclude[] = "img";

} else {

$extraExclude[] = "img";


This way the images were displayed for my Google Feed.

So the block from line 394 should look like this:

protected function escapeTemplateParameter( $text ) { global $wgRSSAllowLinkTag, $wgRSSAllowImageTag; $extraInclude = array(); $extraExclude = array( "iframe" ); if ( isset( $wgRSSAllowLinkTag ) && $wgRSSAllowLinkTag ) { $extraInclude[] = "a"; } else { $extraExclude[] = "a"; }if ( ( isset( $wgRSSAllowLinkTag ) && $wgRSSAllowLinkTag ) || ( isset( $wgRSSAllowImageTag ) && $wgRSSAllowImageTag ) ) { $ret = Sanitizer::removeHTMLtags( $text, null, array(), $extraInclude, $extraExclude ); } else { // use the old escape method for a while $text = str_replace( array( '[', '|', ']', '\, 'ISBN ', 'RFC ', '://', "\n=", 'Template:', '', ), array( '[', '|', ']', ''', 'ISBN ', 'RFC ', '://', "\n=", '{{', '}}', ), htmlspecialchars( str_replace( "\n", "", $text ) ) );

// keep some basic layout tags

also change your LocalSettings.php to something like this:


require_once( "$IP/extensions/RSS/RSS.php" );

$wgRSSUrlWhitelist = array ("your Feed urls here" ,"etc");

$wgRSSAllowLinkTag = true;

$wgRSSItemMaxLength = 5000; //if the length is too short, the parsed URL will be trunctuated and result in HTML tags

$wgRSSDateDefaultFormat = "d-m-Y H:i";

$wgRSSCacheAge = 21600;

$wgAllowImageTag = true;

Yellowdog (talkcontribs)

Thanks I tested it and could get images to show up as well but for some reason the title was displayed twice and the image float was not properly aligned. Additionally, there were some html tags displayed in the output <nobr>more...</nobr> after the description. I'll use the more simplified output with the headings and the date after all and will give the use of images a miss until maybe there's an updated version of an RSS feeder.

CayceP (talkcontribs)

If your title is displayed twice, maybe it's the Rss-item template that calls the title twice?

I'm using two different templates since I use one feed for a news template via a google feed from a Google+ Community and one different feed with a different layout.Since Google+, to my knowledge still offer no RSS feed function for Google communities updates (only for personal profiles), my feed is generated by a Thirdparty page (gplusrss.com).

Maybe that's why it works for my feed and not for yours. Although, for security reasons I would prefer If I could get a rendered RSS feed without images or the image html tags from Google.My template looks like this for google feeds:

{{{date}}} [{{{link}}} {{{title}}}]


If you don't have a specified a special template, maybe check your MediaWiki:RSS-item article page if the duplicate title is called there because the If conditions now has changed.

2A04:2413:8301:200:B89C:7C8B:B7D6:5772 (talkcontribs)

Hi. Does anyone know how to strip html tags from description? I couldn't find the place in RSSParser.php, where to use the strip_tags() function.

CayceP (talkcontribs)

Look for Sanitizer::removeHTMLtags that where the regEx replac of the html tags happens in RSSparser.php

Reply to "Google Feeds"

<rss-error> when displaying page with RSS feed

3 (talkcontribs)

Hi all

I'm starting with this extension and am having a little difficulty.

MediaWiki 1.28

RSS 2.25

running on a system with laters version of XAMPP (for testing and development)

I have the simple code


with nothing else in the page and I get the <rss-error> message

In the page and the URL is whitelisted.

I've probably done something wrong, but I cant figure it out.

Thanks! Simon

Shirayuki (talkcontribs) (talkcontribs)

No, it doesn't

Reply to "<rss-error> when displaying page with RSS feed"