PDA

View Full Version : Addon: RSS To Links


sebatl
12-02-2006, 02:53 AM
http://pixelpost.org/v1/index.php?x=downloads&details=192

This addon provides functionalities similar to the "Photoblogs.org Bookmarks feed" addon, the ability to generate a list of links from an RSS feed, but it has more features and options.
You can see an example at the bottom of my about page:

http://www.windal.net/photoblog/index.php?x=about

Here is what it does:

+ The addon supports multiple feed downloads. You can specify more than one feed and it will merge them together into a single link table. Most RSS feeds have a limited number of items, delicious feeds for instance are limited o 31 links. Splitting your favorites photoblogs into several tags and downloading multiple feeds allow you have more than 31 favorite photoblogs if you use delicious to maintain your list of favorite photoblogs. I have close to 50 that I split into three delicious feeds.
+ It uses magpie (http://magpierss.sourceforge.net/) to download and parse the RSS feed(s). The advantages of using a well known RSS php reader like Magpie is that you get all the features it comes with: caching, support for RSS, RSS2 and most ATOM, etc...
+ The generated output is an html table, not a list, and the number of columns is configurable. If you prefer lists, you can always use a one column table.
+ It can optionally sorts your links alphabetically, links inside the feed(s) do not have to be sorted.
+ I don't like to have to change anything in the code to have my addons working and I wrote this addon so that you should not have to change anything to have it working. The one and only template tag of this addon takes arguments so you can specify the feed and other options along with the tag in your template rather than in the addon code...
For instance:

<RSSTOLINKS sFeedUrl="http://your.rss.feed" nCols="2">

Will get the links from the feed http://your.rss.feed and will generate a 2-column table of links.

TAG:

<RSSTOLINKS ...>

See http://pixelpost.org/v1/index.php?x=...ds&details=192 for a full list of parameters.

INSTALL: unzip the addon at your pixelpost main directory.

joey dee
12-02-2006, 05:06 AM
Uhmm that's a good idea - i'll have a try. Also i have a question in terms of Links in the RSS feed. for example how come links don't show in RSS feeds? IS there a way to show or enable such links? or its not possible?

again just so i dont confuse you - let's say you post a photo and in your detail or description you decribe the picture and leave a link: <a href="http:www.pixelpost.org">pixelpost</a> <--- how come that wouldn't be a active link in RSS feeds?

regards,
Joey Dee

sebatl
12-02-2006, 01:54 PM
The kind of link you describe is in the feed description, I don't parse that at all, I look at the title and URL.

Think about it like your browser bookmarks if you could specify a name, a URL and some comment when you add a bookmark. When you list your bookmarks from your browser, you don't want to see what it's in the comment section, just a list of names that you can click on. And adding links to the comments is not the right way to add a new bookmark, you should have a bookmark per link.

DikkieBurger
12-02-2006, 06:10 PM
Hi,

Great addon. The other Photblogs.org feed parser didn't work for me. This one works great: http://www.shoqed.nl/links

I'm pulling my bookmarks from photoblogs.org on my website as my favourites.

austriaka
12-02-2006, 11:15 PM
for example how come links don't show in RSS feeds? IS there a way to show or enable such links? or its not possible?

again just so i dont confuse you - let's say you post a photo and in your detail or description you decribe the picture and leave a link: <a href="http:www.pixelpost.org">pixelpost</a> <--- how come that wouldn't be a active link in RSS feeds?

As far as I know RSS feed content is [CDATA] what means that HTML is not parsed. For this reason HTML tags should be removed from content before putting it into an rss feed.

This is done at line 802 in (original 1.5) index.php
it says: $body = strip_tags($body); which removes any HTML tags from the description.
Line 803 $body = htmlspecialchars($body,ENT_QUOTES); makes "<" to "&lt;" and so on, so this converts eventual remains of html to entities.

HTH
KArin

posefius
12-03-2006, 09:02 PM
Nice addon, but when you want to use 2 separated RSS feeds in different tags on your page it merges the two together in the second tag.

sebatl
12-04-2006, 02:06 AM
Interesting, I'll have to try this.

posefius
12-05-2006, 08:36 AM
I'm trying to validate this addon and noticed the following error message;

"Sorry, I am unable to validate this document because on line 52 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication."

I used: http://validator.w3.org/ to check

sebatl
12-05-2006, 01:11 PM
which file/url did you pass to the validator?

posefius
12-05-2006, 06:52 PM
I passed the following RSS Feed:

http://www.gvisit.com/rss.php?sid=0a7963a960735cf81d3d57c622fa92e8

sebatl
12-06-2006, 03:21 AM
It appears magpie ignores the feed encoding and defaults to ISO-8859-1. UTF-8 encoded chars in a feed won't display correctly. I had the same problem on mine and adding:

define("MAGPIE_OUTPUT_ENCODING", "UTF-8");

on line 2 of addon/RSSToLinks.php fixes the issue.

I'll release a new version of the addon this week-end with the fix for that other issue when using the tag more than once this week end. Don't have time right now.

posefius
12-06-2006, 02:59 PM
Thank you, it works fine now! Great to hear that you are also working on the other problem.

sebatl
12-07-2006, 11:24 PM
Here is a new zip with both issues fixed: http://pixelpost.org/v1/devfiles/?id=192

If you don't want to reinstall, the first issue can be fixed by editing addons/RSSToLinks.php and adding:

$arrRSSLinks = null;

in the GetTableLinks($sArg) function, right below
global $arrRSSLinks;

this will reset the array of links each time the function is called.