Page 1 of 3

fbrss feed not working.

Posted: 26 Jul 2012, 17:54
by amusicsite
I have recently set up a feed (from facebook) using http://fbrss.com
But it fails to load into TTRSS with the error message
MagpieRSS: Failed to parse RSS file. (not well-formed (invalid token) at line 254, column 111)

Re: fbrss feed not working.

Posted: 26 Jul 2012, 21:26
by fluffy
Seems like that's a bug with FBRSS and you should contact them about it.

Re: fbrss feed not working.

Posted: 27 Jul 2012, 00:22
by amusicsite
The link works in other RSS readers though. It's on TTRSS that it fails to load.

Re: fbrss feed not working.

Posted: 27 Jul 2012, 01:00
by fluffy
MagpieRSS is pretty strict about what it accepts, while other RSS readers try to figure out the "intent" (and often get it wrong). Could you provide a URL to the feed itself? It would be easier to identify what's going wrong and make suggestions to the FBRSS folks to fix it if we could actually see what Magpie is complaining about.

Or at the very least, load the RSS feed up in a text editor which allows you to excerpt lines 253-255.

Just based on the error on its own I'd guess it's complaining about a malformed entity or an invalid character sequence for the specified encoding, or possibly it could be a tag which wasn't closed correctly. But really that error could mean anything.

Re: fbrss feed not working.

Posted: 31 Jul 2012, 11:57
by amusicsite
Thanks for the advice so far.

Here's a grab of some of the feed where it's reporting the error. The only thing I can see is there is a line break in the title of one of the items. Could this be the problem?

Code: Select all

<item><title>Photo</title>
<description>&lt;a href='http://www.facebook.com/photo.php?fbid=10151153717253968&amp;set=a.10151153716013968.501963.007&amp;type=1&amp;relevant_count=11'&gt;&lt;img src='http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/409639_10151153717253968_519775666_s.jpg'&gt;&lt;/a&gt;&lt;br/&gt; Moon &amp;amp; Brighton&lt;br/&gt;&lt;br/&gt;&lt;a href='http://www.facebook.com/photo.php?fbid=10151153717253968&amp;amp;set=a.10151153716013968.501963.007&amp;amp;type=1&amp;amp;relevant_count=11'&gt;Likes: 1&lt;br/&gt;Comments: 0&lt;/a&gt;</description>
<link>http://www.facebook.com/photo.php?fbid=10151153717253968&amp;set=a.10151153716013968.501963.007&amp;type=1&amp;relevant_count=11</link>
<pubDate>Thu, 26 Jul 2012 18:41:39 -0400</pubDate>
<guid>http://www.facebook.com/photo.php?fbid=10151153717253968&amp;set=a.10151153716013968.501963.007&amp;type=1&amp;relevant_count=11</guid>
</item>

<item><title>http://pushfire.com/social-media/using-pinterest-to-rock-out-your-brand/

More information on Pinterest than you will ever need.</title>
<description>Using Pinterest To Rock Out Your Brand - PushFire&lt;br/&gt;&lt;br/&gt;If you’re like me, a magpie drawn to anything with a little bling, then Pinterest is the social media platform for you. Not one to ignore a sexy pair of designer shoes or the Fifty Shades of Grey inspired fashion&lt;br/&gt;&lt;br/&gt;&lt;a href='http://www.facebook.com/007/posts/421933377850104'&gt;Comments: 0&lt;/a&gt;</description>
<link>http://www.facebook.com/007/posts/421933377850104</link>
<pubDate>Thu, 26 Jul 2012 18:11:57 -0400</pubDate>
<guid>http://www.facebook.com/007/posts/421933377850104</guid>
</item>

Re: fbrss feed not working.

Posted: 31 Jul 2012, 21:50
by fluffy
That smart quote on the Pinterest item ("if you're like me") is highly suspect, and might be a mismatched encoding. But that could have also been mangled by phpBB. Who knows. i18n is hard, let's go shopping.

Re: fbrss feed not working.

Posted: 01 Aug 2012, 14:20
by amusicsite
fluffy wrote:That smart quote on the Pinterest item ("if you're like me") is highly suspect, and might be a mismatched encoding. But that could have also been mangled by phpBB. Who knows. i18n is hard, let's go shopping.


Just checked and yes that is in the feed, not changed by the board. So I guess that it's not encoding illegal characters correctly.

Tis a shame the idea was to get all the feeds from people who's Facebook stuff I actually read and throw it all into TTRSS, then I can read it at work where FB is blocked ;)

Some of them work but others don't, so I guess if one post has a bad character then it will screw up the feed until that post drops off.

Re: fbrss feed not working.

Posted: 01 Aug 2012, 21:35
by fluffy
Well, now you know what to point the fbrss guys to when you report the bug in fbrss.

Re: fbrss feed not working.

Posted: 01 Aug 2012, 21:44
by Ipstenu
You can use these directions to get the FB rss feeds: http://ahrengot.com/tutorials/facebook-rss-feed/

That's what I do for similar reasons ;)

Re: fbrss feed not working.

Posted: 01 Aug 2012, 22:26
by Usul
Since I'm suffering from some bad feeds to, I hacked a little, dirty, nasty workaround, which works fine for me.

There is a tool for handling xml files on shell, called xmllint, which has a useful option called --recover. Manpage says:

Code: Select all

--recover
              Output any parsable portions of an invalid document.


If I do something like this

Code: Select all

curl -s "http://example.com/badfeed.xml" | xmllint  --recover - > /var/www/feeds/goodfeed.xml


the result goodfeed.xml is a file which tt-rss can handle, even if it can't handle the badfeed.xml. So I installed a little cronjob for my two bad feeds, switch tt-rss to the resulting goodfeed.xml - done.

That's not a solution, but it works for my two bad feeds. Probably it doesn't work with every faulty feed on the planet, but for me, it works. If the two divas called simplepie and magpie are happy two swallow this, I'm happy too :twisted:

Better solutions are easy to imagine, for instance something like yahoo pipes, where you just pipe in a bad feed and gets out a good feed. Maybe this is possible with yahoo pipes, I don't know, I didn't try it. Besides the obvious solution, a proper feed, another obvious solution would be a feature like this --recover, but in simplepie or magpie.

Re: fbrss feed not working.

Posted: 02 Aug 2012, 07:43
by fluffy
That's pretty useful. It'd also be trivial to set that up as a CGI script (or similar) or even integrate that into tt-rss's fetch pipeline itself.

Re: fbrss feed not working.

Posted: 13 Mar 2013, 21:22
by Cheetah
I hit a similar problem, and was motivated to fix it.

I wrote a tiny plugin for tt-rss that will pass feed data through xmllint --recover as Usul suggested.

http://dl.dropbox.com/u/72924289/ff_xmllint_init.php

Re: fbrss feed not working.

Posted: 15 Mar 2013, 16:36
by fleg
Would be nice if it could be included in the base tarball.

Re: fbrss feed not working.

Posted: 15 Mar 2013, 16:58
by fox
This sounds like a serious performance killer though.

Re: fbrss feed not working.

Posted: 15 Mar 2013, 17:47
by miceliux
Cheetah wrote:I hit a similar problem, and was motivated to fix it.

I wrote a tiny plugin for tt-rss that will pass feed data through xmllint --recover as Usul suggested.

http://dl.dropbox.com/u/72924289/ff_xmllint_init.php


Thank you.
How do I install it? I have tried to put it in ./plugins/xmllint/init.php and other variations, but it doesn't appear in the plugins list.