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.

RSS feed URL. History url and main url

Paladium (talkcontribs)
Reply to "RSS feed URL. History url and main url"

It is still unclear for me who to have RSS feed of my articles

Fokebox (talkcontribs)

Hello, I still cannot understand who to have RSS feed of my articles at my wiki website using this extension. Could you please let me know step by step tutorial?

Thank you!

Wikinaut (talkcontribs)

Please can describe _exactly_ what you want to achieve? Pls. post the mere RSS Feed Url, so that I can have look what is eventually going wrong.

Fokebox (talkcontribs)

I have installed extension to my wiki website: ru.wikijournal.org and need to generate RSS feed of some articles. And don't have any idea how I can have it with installed extension.

CayceP (talkcontribs)

So you want to generate RSS feeds from certain articles on your wiki? This is not what this extension is for. This extension actually displays RSS feeds from other websites inside any article(s) on your wiki - not the other way around.

PS: the last pages page automatically generates an RSS feed for new created pages. It can be usually be found on the left navigation of most default skins.

Check out the Main page of my wiki to see what this extenstion does in the "Aktuelles" section on the left (I use it for displaying news by importing an rss feen from a tumblr, a Facebook page and a subreddit) and "TV Termine" on the right for displaying upcoming airdates of episodes: https://spookyverse.de/wiki/Hauptseite

Reply to "It is still unclear for me who to have RSS feed of my articles"
2A02:2788:8E4:596:BC05:5A:5AC7:E96B (talkcontribs)

Qui a osé écrire cet article ? Avez-vous vu cette insanité de votre code qui n'entraînera qu'un plantage de votre LocalSettings.php ???!!!

require_once "$IP/extensions/RSS/RSS.php"; // Et quand vous allez dans les sources, il n'EXISTE AUCUN RSS.php !!!


CayceP (talkcontribs)

Sorry, I don't speak French. From what i understand, you seem to have the RSS folder with the extension not located in extenions/RSS/ (maybe in another subfolder? Be sure evertyhing is located in extenions/RSS/) Here is an exmaple of what you need to put into your LocalSettings.php to make this extension work in a wiki 1.27+:

#RSS Extension
wfLoadExtension( 'RSS' );
$wgRSSUrlWhitelist = array("https://somefeed1.com/somearticle.xml","https://gplusrss.com/rss/feed/12345",);
$wgRSSAllowLinkTag = true; //If you want to display images from the feed as well. large images won'te be downscaled so be aware.
$wgRSSItemMaxLength = 6000;
$wgRSSDateDefaultFormat = "d-m-Y H:i";
//if you are European and want to display your date like 28.06.2020
$wgRSSCacheAge = 10;
$wgAllowImageTag = true; //only needed if you want to display images

Reply to "Foutage de gueule ?"

Feed is not in the whitelist -- Where is RSS.php?

Summary by Leonardo Rocca

Use square brackets in the parameter syntax that whitelists the URLs in the LocalSettings.php file.

e.g. $wgRSSUrlWhitelist = [ 'URL' ]; (talkcontribs)


I've recently installed the extension and have been puzzled as to where I find the configuration file. I've been reading the manual and it says something about RSS.php, yet when I search through the extension folder, I can't find it. Where do I configure the extension? I need to add something to the whitelist.

Thank you ahead of time!

CayceP (talkcontribs) (talkcontribs)

Hey, thank you for the heads up!

So far the only setting I wanted to mess with was the whitelist, and I came up with

$wgRSSUrlWhitelist = ('URL');

I still get the "not whitelisted" error message. Am I missing something?

CayceP (talkcontribs)

That is odd. Does $wgRSSUrlWhitelist = ( "*" ); work? (talkcontribs)

No luck, sadly! :(

CayceP (talkcontribs)

Odd. Which MediaWiki version are you currently using? Does the extension show up in you SpecialPage:Version page?

I would recommend to remove the extension from your FTP and download the correct corresponding version of the extension once more and install it again. Be sure to use the correct code in your LocalSettings.php according to your wiki version. Also run http://yourwikis.address/w/mw-config/ once to make sure you installation's data base is up-to-date (I don't think this Extension changes any tables but you might have installed something else that did and where the tables weren't updated properly which can lead to strange side effects).

Also, you please paste the $wgRSSUrlWhitelist = ('URL'); entry that didn't work? (talkcontribs)

Heya, here's my version information!

What actions should I take based on this info? I'm going to see if removing and reinstalling works, but any pointers outside of that would be super appreciated.

Thank you again for your help and patience, I really appreciate it!

Ah, so the entry I used was $wgRSSUrlWhitelist = ( "*" );

CayceP (talkcontribs)

Hmm. Did you have any luck with reinstalling the extension and providing your RSS feedurl in $wgRSSUrlWhitelist = ( "*" );? Also could you please post the URL to the RSS feed you try to display so I can test if it works for me?

Orribu (talkcontribs)

Oof, sorry for the lateness. It's been a hectic handful of months. @_@

So I reinstalled and tried $wgRSSUrlWhitelist = ( "*" ); again, but to no avail.

Just to make sure, I'm to add $wgRSSUrlWhitelist = ( "*" ); to the same LocalSettings.php file in which I load the extension, right?

The RSS feed is https://twistedfates.net/blog/feed.

Thanks again for your help and patience!

CayceP (talkcontribs)

Okay, I think I found the issue. First, $wgRSSUrlWhitelist = ( "*" ); doesn't work at all and throws an parser error on my local XAMPP installation. It looks like the extension requires that a valid feed to end on a .xml or .rss. You page seems to use Wordpress which comes with built-in RSS feed generator but there seems to be no accessible feed url ending with .xml or .rss. A workaround would be to generate a feed with a service like feedity.com since $wgRSSUrlWhitelist = "https://feedity.com/twistedfates-net/UlJWU1pUVA.rss"; for example works for me. Or maybe there is a Wordpress plugin that generates RSS feeds with an url that has the .xml or .rss ending. https://wordpress.org/plugins/feedwordpress/ may work but it seem unmaintained and/or unsuported for recent version of Wordpress...

Orribu (talkcontribs)

Thank you so much for the response! I want to go the feedity route if that's cool.

So I took a copy of the snippet you provided and the front end still says that there's no allowed URLS in the whitelist. Could I perhaps be putting this snippet of code on the wrong place?

CayceP (talkcontribs)

Hmm. This did work for me when placed at the bottom in my LocalSettings.php:

wfLoadExtension( 'RSS' );
$wgRSSUrlWhitelist = "https://feedity.com/twistedfates-net/UlJWU1pUVA.rss";
$wgRSSAllowLinkTag = true;
$wgRSSItemMaxLength = 6000;
$wgRSSCacheAge = 10;
$wgAllowImageTag = true;
wfLoadExtension( 'RSS' ); $wgRSSUrlWhitelist = "https://feedity.com/twistedfates-net/UlJWU1pUVA.rss"; $wgRSSAllowLinkTag = true; $wgRSSItemMaxLength = 6000; $wgRSSCacheAge = 10; $wgAllowImageTag = true;

when you copy and paste the RSS url, be careful that there is no trailing whitespace after the .rss due to the external link icon here. I would recommend that you paste the snippet into an text editor like notepad or sublime etc to make sure that there is only text in the LocalSettings.php

Orribu (talkcontribs)

Hey there, I've copied and pasted the code using Atom, but to no avail. Is Atom a good text editor, or should I stick with notepad?

At this point I think there's something going on outside of the plugin that might be causing the issue. There might be a compatibility issue with another plugin or something, maybe. I'm not sure! :(

CayceP (talkcontribs)

I think any programming text editor should do, including notepad... Do you still get the same error message? Could it be that somewhere in your LocalSettings.php there is another $wgRSSUrlWhitelist declaration still?

You could try to temporary deactivate all other extension by out-commenting them with a # in the LocalSettings.php dor troubleshooting for finding out whether another Extension is causing this. And please double check that you have installed the correct version of the extension for your mediawiki core.

Orribu (talkcontribs)

Hiya, thanks again! My web-hosting plan expires soon, so I must wave the white flag.

I really want to thank you for your time! Is there somewhere where I can tip you or anything?

CayceP (talkcontribs)

I'm sorry to hear that. I keep my finders crossed that you maybe find another webhsoting. If you want, you could buy me a coffee via paypal at ko-fi. That is the first time that someone offers a tip for my advice :-)

Orribu (talkcontribs)

Oh hey, it's no problem! So sorry I couldn't give more (gosh the US Dollar is worthless lol), but I really do appreciate all your help. You are amazing. :'D <3

Leonardo Rocca (talkcontribs)

I simply fixed the same problem by using this syntax in the LocalSettings.php file:

$wgRSSUrlWhitelist = [ 'URL' ];

I assume by your conversation that the problem were the brackets used in the syntax. Since the parameter is an array, you should be using square brackets.

Showing images into rss feeds

Lumber Jack second account (talkcontribs)

I have RSS feed 2.25.0 installed, with a MediaWiki 1.23.5.

I am trying to get images to be shown in RSS feeds that I have added to a Wiki and I have not figured it out.

So lets say I create a Wiki page for an organisation that also has a Facebook page. Lets say Wikipedia has a Facebook page.

Through findmyfacebookid.com I find out that Wikipedia's Facebook ID is 33138223345.

I can add that number to the back of https://www.facebook.com/feeds/page.php?format=rss20&id='' to get https://www.facebook.com/feeds/page.php?format=rss20&id=33138223345 which is the RSS feed of Wikipedia on Facebook.

so far so good,

now I go back to my wiki and add that feed between <rss>-tags, so it shows as such

 <rss max="16">https://www.facebook.com/feeds/page.php?format=rss20&id=33138223345</rss>

and it looks pretty good, except when there are images included in the RSS feed posts, they are not shown, just a html code is shown

e.g. this image

of Armenia's Wiki Camp shows up like this in the feed section of my wiki:

 <img class="img" src="https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAbFMb77DTthF-D&w=158&h=158&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fe%2Fe9%2FWiki_camp_Armenia_2014_flash_mob.png%2F580px-Wiki_camp_Armenia_2014_flash_mob.png" alt="" />  

well that is not that sexy, I want some feeds with images as eye candy, they get more clicks/attention/love.

  1. So I figure, I need to go into RSS.php file and set the parameter $wgRSSAllowLinkTag = true; and $wgRSSAllowImageTag = true; it still doesn't work
  2. maybe my wiki doesn't allow external images? so I follow the Manual:$wgAllowExternalImages instructions and add that with $wgAllowExternalImages = true; it still doesn't work
  3. The code itself is html, I check if it would work to just add <html>-tags around the <rss>-tags, doesn't work
  4. I copy the code out of the feed and add tags below separately
     <html> <img class="img" src="https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAbFMb77DTthF-D&w=158&h=158&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fe%2Fe9%2FWiki_camp_Armenia_2014_flash_mob.png%2F580px-Wiki_camp_Armenia_2014_flash_mob.png" alt="" />  </html>
    which renders the image after I set $wgRawHtml=true; see Manual:$wgRawHtml that works, but doesn't help me
  5. what if I set the Manual:$wgAllowImageTag to $wgAllowImageTag=true;, now I don't need to set <html>-tags around <img>-tags and the images are shown but not in the rss feeds. doesn't work
  6. What if I can add <html>-tags into the subelements of the template for the extension, directly into MediaWiki:Rss-item? The description is where the image are that I pulled from Facebook, so if I add <html>-tags around that parameter?
     {{$1 | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} | description = <html>{{{description}}}</html> }}
    doesn't work. Maybe around the whole template?
     <html>{{$1 | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} | description = {{{description}}} }}</html>
    doesn't work.
  7. Then I read through this Thread:Project:Support_desk/template_variables_within_html_tags. So you need to add
     {{#tag:html| }} 
    around the parameters.
     {{$1 | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} | description = {{#tag:html| {{{description}}} }} }}
    doesn't work. Maybe like this?
     {{$1 | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} | {{#tag:html| description =  {{{description}}} }} }}
    doesn't work. Around the whole thing?
     {{#tag:html| {{$1 | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} | description =  {{{description}}} }} }}
    doesn't work.
  8. Am I changing the wrong template? Maybe the MediaWiki:Rss-feed instead? there I change the source to
    ; '''<span class='plainlinks'>[{{{link}}} {{{title}}}]</span>''' : {{#tag:html| {{{description}}} }} : {{{author}}} {{{date}}} 
    doesn't work. Different
     ; {{#tag:html| '''<span class='plainlinks'>[{{{link}}} {{{title}}}]</span>''' : {{{description}}} : {{{author}}} {{{date}}} }}
    doesn't work.

I don't know what else I could do? Maybe take earlier version of the extension? If anyone could help me here I would be grateful.

here a thread on phabricator with the same issue Sanitizer fails to include image tags if incorrectly written as closed/void tags -LumberJack

CayceP (talkcontribs)

Not sure if OP was able to resolve their issue, but in case someone else is having issues displaying image in MW 1.30.0+ try this:

in \extensions\RSS\RSSParser.php remove this part at line 485 if ( isset( $wgRSSAllowImageTag ) && $wgRSSAllowImageTag ) { $extraInclude[] = "img"; } else { $extraExclude[] = "img"; }

This is the part that skips the rendering of any images. Usually it is not required to modify your RSS template e.g. something like } [{{{link}}} {{{title}}}]
should display the images if $wgRSSAllowImageTag is set to true in your LocalSettings.php

Reply to "Showing images into rss feeds"

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 corresponding .php file in your installation 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?" (talkcontribs)

For people like me who always need concrete examples, this is the code:

<rss max="6">https://blog.wikimedia.org/feed/</rss>

The example is shown here: User:Base/RSS test 1

Wikinaut (talkcontribs)

Danke! Thanks!

Reply to "Good examples"

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"

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!