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


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

17
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

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

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 - no the other way around.

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

Reply to "It is still unclear for me who to have RSS feed of my articles"
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

Reply to "Showing images into rss feeds"

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

5
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)

$wgRSSUrlNumberOfAllowedRedirects=3

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?"
87.91.51.235 (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 ?

5
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

1
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

{{Template:embedvideo|pSsYTj9kCHE}}


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

{{Template:cnn_rss|edition_world.rss}}

or

{{Template:cnn_rss|edition_asia.rss}}

could we?

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

RSS.php not in git repo

14
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

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


Hello,

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:


https://github.com/Wikinaut/mediawiki-extension-RSS


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:

<rss>http://blog.wikimedia.org/feed/</rss>


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.

93.185.143.65‎15:24, 12 August 2012

80.246.253.140 (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?"