Extension talk:RSS

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
PHP
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.


Error "SSL certificate problem: unable to get local issuer certificate"

1
MikeDarling (talkcontribs)

After I installed the RSS extension, I set up some RSS feeds which only displayed an SSL certificate error ("SSL certificate problem: unable to get local issuer certificate"). To fix this, I had to check my php.ini file. Specifically, the following 3 settings: curl.cainfo, openssl.cafile, and openssl.capath. Mine were commented out. Make sure they are set to a current .pem file (I used the Mozilla CA certificate store in PEM format from https://curl.se/docs/caextract.html).

The process is described well here. This resolved my error. Hope it helps anyone else who finds this.

  • MediaWiki Version: 1.42.1
  • PHP Version: 8.3.9 (cgi-fcgi)
  • RSS Extension Version: 2.25.1 (ce17b2c) 05:55, 1 August 2024
Reply to "Error "SSL certificate problem: unable to get local issuer certificate""
Fanra (talkcontribs)

The RSS feed I'm getting gives the time in UTC while my wiki is America/New_York. This extension doesn't want to change it to America/New_York.


My LocalSettings.php has:


$wgLocaltimezone = 'America/New_York';

date_default_timezone_set( $wgLocaltimezone );

$wgLocalTZoffset = date('Z') / 60;


Removing either of the last two lines seems to do nothing to fix this. phpinfo.php reports America/New_York as the time zone.


So, why does RSS display in UTC instead of America/New_York?


Thank you for your help in this matter.

Reply to "Time Zone Issue"

Is RSS Feed Items Stored?

1
173.239.211.64 (talkcontribs)

Are items retrieved from an RSS feed stored as articles? Or, is the feed queried on each pageload?

Reply to "Is RSS Feed Items Stored?"

Showing images into rss feeds

3
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}}}]
{{{description}}}
should display the images if $wgRSSAllowImageTag is set to true in your LocalSettings.php

171.4.218.5 (talkcontribs)

Hi, I am also having an issue showing images, and have followed the instructions above and in the docs. I posted a question on Stack Overflow, and will respond back here if I am able to figure it out. Thanks for any tips on this config! :D

.../questions/76098396/mediawiki-rss-extension-not-showing-images

Reply to "Showing images into rss feeds"

Error 0: SSL certificate problem: certificate has expired

1
Yukii (talkcontribs)

Hello,

since a while i got this Message:

Der RSS-Feed von https://sevengamer.de/tag/final-fantasy-xiv-a-realm-reborn/feed/ konnte nicht geladen werden: * Fehler beim Abruf der URL: SSL certificate problem: certificate has expired Während der HTTP-Anfrage ist ein Fehler aufgetreten: 0 Error

But the the SSL Certificate isn't expired. We use Let's Encrypt:

Begin: Fri, 01 Oct 2021 21:52:15 GMT End: Thu, 30 Dec 2021 21:52:14 GMT

I checkt all. The config etc. and i checkt the feed on a RSS-App on my Smartphone. The feed there is working. Has anyone a idea how i can fix this problem?

  • MediaWiki: 1.34.2
  • PHP 7.2.34-18+0~20210223.60+debian9~1.gbpb21322 (cgi-fcgi)
  • RSS feed 2.25.1 (0e63926) 04:59, 3. Aug. 2019
Reply to "Error 0: SSL certificate problem: certificate has expired"

Question about permitted URLs and multiple feeds

2
CKoerner (WMF) (talkcontribs)

Does $wgRSSUrlWhitelist allow for a wildcard operation? I want to allow a feed from a specific domain and any feeds located on that domain.


For example if the domain is https://foobar.com. Then https://foobar.com/feed, https://foobar.com/category/technology/feed, https://foobar.com/tag/events/feed, etc. would be possible (assuming those are all valid RSS feeds). Using the parameter would I need an entry for every possible feed or can i just say something like https://foobar.com/* as a catch-all?

CKoerner (WMF) (talkcontribs)

I found my answer in Phabricator. I was looking for the wrong terms. :) task T47857 According to that task the RSS extension does not work with "protocol relative urls".

Reply to "Question about permitted URLs and multiple feeds"

RSS feed URL. History url and main url

1
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

4
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 !!!


Bernard.jacob.liege@gmail.com

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?

18
Summary by Leonardo Rocca

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

e.g. $wgRSSUrlWhitelist = [ 'URL' ];

104.174.184.30 (talkcontribs)

Heya,

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)
104.174.184.30 (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?

104.174.184.30 (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?

104.174.184.30 (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.

Return to "RSS" page.