Extension talk:XFeed - RSS Feed Aggregator

From mediawiki.org
Jump to navigation Jump to search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).

Xfeeds and DynamicPageList clashing[edit]

Hi, our wiki uses Xfeeds and DynamicPageList extensions. There seems to be a problem when they are used on the same page though. An error occurs in the magpierss file that causes the formatting of the page to display the error at the top of the page, and then display the rest of the page. The error occurs on line 404 of the magpie file that Xfeeds uses. Is there a way to fix this?

Revision 431557 changing $feed->items" to "$feedItems[edit]

Hi, for this change what was the PHP error? I am using MediaWiki 1.7.1 and PHP 5.1.4 and had to revert the line back to: foreach ($feed->items as $item) { for the extension to give results similar to XFeed_-_RSS_Feed_Aggregator#Result

Thanks Mreynolds 14:54, 8 November 2006 (UTC)

No idea what the error was but $feed->items is correct. I put it back. Kitzke 20:53, 25 January 2007 (UTC)

Magpie[edit]

Hiya,new to this, in order to use this extension, you need to have magpie installed? Just trying ot understand what steps to take. ThanksRovo79 19:43, 29 November 2006 (UTC)

Yes, you need MagpieRSS installed (just download it and dump it in a folder somewhere), and you need to point the require_once line to where you installed it. Crispiness 04:10, 15 December 2006 (UTC)

Help getting XFeeds to work[edit]

I'm trying to figure out how to use this. I installed magpierss (I think). I uploaded XFeeds.php. I added both of the includes. I added this code in a page:

<xfeeds contentcolour="#eeeeee" feedlimit="3" totallimit="10">

http://www.digg.com/rss/containertechnology.xml http://rss.slashdot.org/Slashdot/slashdot http://brill.pappin.ca/wp-rss2.php </xfeeds>

But, all i get is a blank page. Anything else I need to be doing? Sgtbenc 21:19, 10 December 2006 (UTC)

Check your Apache error log, that should give you a hint as to what's wrong. Crispiness 04:10, 15 December 2006 (UTC)

I have the same problem. I was receiving an error that it couldn't create a ./cache but I created it manually and gave it the proper permissions. Now I get no errors in my apache error log but still nothing shows up. If I view the source on the browser, nothing at all comes up where the list should be. Squirrelist 21:57, 14 January 2007 (UTC)

This was caused by the change to $feedItems, change it back to $feed->items or grab the current revision Kitzke 20:53, 25 January 2007 (UTC)

Thanks![edit]

Just wanted to say thanks to Brill and the other contributors for this. Lightweight, easy to modify, no complicated dependencies - exactly what I was looking for! Crispiness 04:10, 15 December 2006 (UTC)

Nothing on page?[edit]

I also have the same problem.

  • Installed Magpie
  • Changed the line in the XFeeds script to point to correct path
  • Nothing come on the page (blank page)
  • If I view the source on the browser, nothing at all comes up where the list should be
  • If I go special pages, version, neither Magpie nor XFeed are listed in the extensions?

So did you solve the problem somehow?
Thanks! Gmalac 12:46, 24 January 2007 (UTC)

This was caused by the change to $feedItems, change it back to $feed->items or grab the current revision Kitzke 20:53, 25 January 2007 (UTC)

Thanks and Notes[edit]

I put this up on a whim quite some time ago and haven't looked at the site in a long time. I really wanted something simple and easy (I wasn't satisfied with what what already available) and I'm very happy that people are using and improving it!

I'm not likely to contribute anything else in the near future because it does what I need it to do and I have zero time, but one thing I've noticed that needs work:

  • Depending on the feed and the application the feed is coming from, the data you get back can cause the blank page problem. In particular I've noticed that date formats can be quite different and can cause strange things to happen (in one case a blank page).

If your working on the feed format problems, I recommend that you simply add all the feeds you can find and inspect the output (they'll be surprisingly different).

Brill

Notice: Undefined index[edit]

I've started getting this error:

Notice: Undefined index: totallimit in /home/wikistoc/public_html/wiki/extensions/XFeeds.php on line 96

Does anyone happend to know how I can fix it? Much appreciated.--Rovo79 23:13, 7 March 2007 (UTC)

CSS instead of inline style?[edit]

Hi Brill. This extension looks very useful, and I have a small enhancement request to make it a little more flexible.

Would you mind adding an attribute flag to the <xfeed> tag to put CSS classes on the various divs created - instead of styling them direcly? Maybe something like: <xffed useCssClasses="true">. This would be very helpful for site styling. Thanks! --Jimbojw 14:27, 20 March 2007 (UTC)

Thanks a lot[edit]

That was what ive been looking for a long time !! Thanks FlyerWiki

nofollow[edit]

XFeeds.php ignores the rel="nofollow" of a Wiki. If you want the nonfollow it must be done like this:

<div><a href="$href" rel="nofollow">$title</a></div>

and

[<a href="$channel_link" rel="nofollow">$channel_title</a>]</div>

XFEED Breaks $wgWhitelistRead ?[edit]

Hi
I'm running MediaWiki 1.6.10
This is what I have in Localsettings.php:

$wgWhitelistRead = array( "Main Page", "IP Addresses", "Special:Userlogin", "MediaWiki:Monobook.css", "-" );

If I add the xfeed code block to the Main Page

<xfeeds contentcolour="#eeeeee" feedlimit="3" totallimit="10">
http://myserver/wordpress/wp-rss2.php
</xfeeds>

I can view the RSS updates fine, but only when I'm logged into the wiki.
Anonymous reads to the Main Page breaks unless I remove this code...

Am I missing something? pls help

javascript: toggle preview[edit]

Hi, is there a chance that you add a javascript that hides and displays the <div> that contains the summary of the feed-entry, when clicking on the headline of the article. I saw this on CustomRSS http://www.google.com/ig/add?synd=open&source=ggyp&moduleurl=http://customrss.googlepages.com/customrss.xml and that's what I'm looking for. ... but CustomRSS seems to use googles cache of my feed, and i want to have a current version of the feed displayed.

Thanks, Jack

webresponse.php error[edit]

I installed magpie and your php file and then the examples you provided as a test - they work! However I get this error

Warning: Cannot modify header information - headers already sent by (output started at F:\wamp\www\mediawiki1.11\extensions\XFeeds.php:1) 
in F:\wamp\www\mediawiki1.11\includes\WebResponse.php on line 10

all over the body of the page outside the main content. Is ther a fix ços theoutput is very nice apart from these error messages. Thanks Keveen

Possible Solution[edit]

I had this Warning too, but with \XFeeds.php:114 (or something). Line 114 was a line after the php-ending "?>". I deleted it and the Warning disappeared. --Markusk21 12:15, 2 December 2009 (UTC)

XFeed & Wikipedia[edit]

Are there any plans to integrate this or a similar feature in Wikimedia projects? --A12n 01:12, 17 November 2007 (UTC)

XFeed & Bugzilla feeds?[edit]

Does this work with Bugzilla feeds? Doesn't appear to, although I can't get any other MW RSS extension to work with BZ feeds, either. --Thanks, MR 1/14/08

Google News RSS Feeds Fix[edit]

It can be nice to use Google's newsfeeds to aggregate news items from multiple sources. You could then find any news item based on subject. Gogle allows you to generate a dynamic news feed using search terms such as: +myhometown +weekend +events -funerals, etc. Then use the RSS link on the lower left of the results page.

The problem[edit]

Google uses a whole lot of icky HTML wraped around the description

The Fix[edit]

Around line 45 change: $description = $item['description'];

to: $descriptions = $item['description'];

Add at around line 60[edit]

if (eregi("Google News", $channel_title)){

if ($start = strpos($descriptions,  "</nobr></font><br><font size=-1>")) {
   $end = strpos($descriptions,  "<b>...</b></font>") ;
   $start = $start + 32;
   $end = $end + 10;
   $thru = $end - $start;
   $description = substr($descriptions, $start, $thru);

}
} else {
$description = $descriptions;
}

Result[edit]

Seems to work fine for Google feeds. Still testing. This should allow normal feeds to work as before.

Ideas? anonym1ty@yahoo.com Anonym1ty 23:26, 5 February 2008 (UTC)

xfeeds does not show multiple items with same timestamp[edit]

It's possible that multiple feed items have the same timestamp. xfeeds ends up only showing one of the items. This is because the final output is created by $feedItems[$timestamp] = $outputItem;

To fix this, I added the following code right before this so that feed items aren't overwritten. Fixed the problem for me.

while(array_key_exists($timestamp, $feedItems)) {
    $timestamp++;
}

Xfeed not displaying the feed items[edit]

Maybe there is some problem with setting the hook. After installing the new version of Mediawiki (1.16.4), feeds were no more loading. Also recaptcha had a problem. I applied the patch explained for recaptcha at http://www.mediawiki.org/wiki/Extension:ReCAPTCHA#Parameter_1_to_ReCaptcha::confirmEdit.28.29_expected_to_be_a_reference and it started working. So I applied a similar trick to Xfeed and it started working.

The change was the following (in file XFeeds.php)

REMOVE

function renderFeeds( $input, $argv, &$parser ) {

ADD

function renderFeeds( $input, $argv, $parser ) {

I hope it helps. --Phauly 16:33, 7 July 2011 (UTC)

How to disable cache ?[edit]

In the file XFeeds.php there is a line with:

$parser->disableCache();

which should definitely disbale caching (also according to this FAQ: http://www.mediawiki.org/wiki/Extensions_FAQ#How_do_I_disable_caching_for_pages_using_my_extension.3F)

Unfortunately, I see that it doesn't work: each time I update a feed embedded with this extension XFeed it won't be shown updated until I go and manually delete files inside the cache folder...

So, how is it possible to properly disable cache for this extension ?