public marks

PUBLIC MARKS from imelgrat with tags rss & "rss tool"

17 July 2007 16:45

Convert RSS/ATOM feeds into PDF - Free Google Gadget

This gadget is from one of my clients. Basically, it allows users (who have added it to their iGoogle or Google Desktop pages) to enter a feed URL (either RSS or ATOM), choose a font and get their feed in PDF format. It can be quite handy, since it allows to store feeds in a “readable” form, without the need for a RSS feed reader. The site also offers other tools, mainly for webmasters, such as creating your own RSS -> PDF links, and even getting a form for allowing your site’s visitors to enter their favorite RSS feeds and converting them into PDF, right from your site.

17 July 2007 16:30

17 July 2007 16:15

Using Regular Expressions to Find RSS Links on a Page

the class performs three main steps. First, the cURL library is used to fetch the content pointed to by the URL the user passed.. Second, since PHP doesn’t have an SGML parser built in like Python seems to, so getting all the "link" tags has to be done manually. A few regular expressions and some simple string splitting made it all real easy. Last but not least, the function goes through all the links found, figures out which ones belong to RSS feeds, resolves them to absolutes URL if necessary, and stores them on an array, making sure the link isn’t already listed to prevent duplicate links (e.g., the RSS appears more than once in the page).