The Full Feed2JS History
Here is the full story about the evolution of Feed2JS. We are documenting here all development changes and providing an RSS feed you can follow as well.
- Aug 30, 2006
Spammer Code Fix
Thanks for a post from Todd outlining how a certain spammer was exploiting Feed2JS to embed JavaScript that redirects feeds to a spam page. The newest code update has a preventative measure to thwart this attack. - May 30, 2006 :
Download Support for Podcast Enclosure
We've yet to hear any reports of problems using the May 7 update that allows support for RSS 2.0 media enclosures, so we've rolled the code into the current downloads (mirrors have yet to be updated, this will be done by end of the week). All style sheets available from this site contain basic styles for formatting the buttons to link to the media files; some crude instructions are provided from that same link.
Users are left to their own resources to augment their style sheets to format the links. All media links open in a new browser window, and rely on suer settings to deal with .mp3, .m4a files.
Until I have some more time later in June, no new mirror sites can be set up-- the future scenario will make registering a mirror site a self-service operation.
posted by alan at 10:38 PM | Link | Comments (3) - May 7, 2006 :
Beta For RSS Enclosures
I have a preliminary version of Feed2JS running on this server only that is aiming to support access to RSS enclosure media for podcast feeds. I hope I can get a few testers to try it out before it gets rolled into the download versions. There is a new option on the Feed Builder form to indicate whether enclosure media should be displayed (default is "no" just so we do not present any surprises to current users). If you have a current Feed2JS code embedded into your page, you can activate this merely by adding&pc=yto your JavaScript string, or rebuild the feed completely with our new form.
As is, this new feature will display a "Play MP3" or "Plat M4A" link for every enclosure found which will appear before the item description. Links go to the media (in a new window). It is set up for output with a new CSS class (div="pod-play-box") and some classes for the links so they can be nicely formatted. Currently only the basic1.css style (used on the preview pages) has these classes.
If the functionality tests okay, it can be distributed into all code in a week or two.
posted by alan at 06:32 PM | Link | Comments (2) - April 6, 2006 :
Feed2JS Updated And Mirrors
There is no time better than what is left. With only 1.5 days left before I leave Maricopa, I plundered ahead and updated the source code and site for Feed2JS. The big difference again is if you have created your own style sheets to display generated content. You must edit all CSS classes that have names like.rss_XXXXXto read.rss-XXXXXwhich will make it compatible with CSS standards.
In addition, we have turned off the forms that allowed people to share their own CSS styles. The management of them was way to tedious, and there is no one here who will be able ti monitor them. I winnowed down the example list to 100 different styles. This does not mean you cannot use our Style Sheet tool to create your own individual styles for your pages; it just means you cannot upload new ones to our collection.
We've added a bit of explanation of how the UTF-8 option can deal with strange characters in the displayed feed content.
Finally, the Build a Feed Form will now generate cut and paste code that is valid XHTML.
Also, I have manually updated the remaining mirror sites with this version of the code (I lost about 4 since my ftp access was denied).
Remaining to be done is support for RSS enclosures, moving this information site to an Open Source Forge site, and setting up a better system for mirror sites to set themselves up and register.
Happy Feeding, this might be my last update... Alan Levine
posted by alan at 03:10 PM | Link | Comments (1) - March 31, 2006 :
Major Feed2JS Changes / Roadmap
The first week of April 2006 brings a number of changes in Feed2JS, all to make it bigger and better. First of all, anyone using the primary "jade" server at Maricopa, this server will be going offline for a few hours starrting 8:00am Tuesday, April 4 (MST), as the server will be moving from my office up to the main server room in our bulding. In the long run, this will increase the speed and uptime of our server.
Also, due are some new code changes in the Feed2Js script. The first is to fix an issue in the generated content for the way CSS classes are declared (my mistake, we use invalid "_" characters). When this change happens, it only affects your site if you are using your own style sheets to control the display of the feeds. You will have to edit your CSS style sheets to replace all "_" with "-". I am sorry but after lots of experiments could not find anyway to preserve things for exisiting sites.
For the near future, I am hoping to move the primary site and location of the download to an open source site- a place holder has been set up. In addition, the set up of new mirror sites will/should be more self service than it is now.
Also on the roadmap to be added is support for RSS enclosures to handle podcast content. This requires some modifications of the MagpieRSS code which still lacks this as a built-in support.
Finally, I should let it be known that as of April 7, I am leaving my position with the Maricopa system fot a new role with the New Media Constortium. This "jade" server will not disappear in the near future and hopefully in the long term, and I will still have involvement in the Feed2JS code (it is my baby after all), but am hopeful with the code in an open source site, that others can contribute to its devlopment and evolution.
Lots of changes coming very quickly.
posted by alan at 11:24 AM | Link | Comments (5) - February 1, 2006 :
Minor Fix for Atom HTML Display
Minor update to script to deal with situations where the Atom item description/content is delivered with HTML entities escaped (all HTML rendered like:<img src="http://www.bigsite.com/cool/pix23545.jpg"> <a href="http://www.bigsite.com/">go</> <br>
Which does not render with the HTML display option on. The code is updated on the main Maricopa site only as we plan to invoke a larger update that addresses the CSS class naming mentioned previously. This new fix is an easy edit for existing scripts. Around line 254, replace:if ($item['content']['encoded']) { $my_blurb = $item['content']['encoded'];withif ($item['content']['encoded']) { $my_blurb = html_entity_decode ( $item['content']['encoded'], ENT_NOQUOTES);This merely decodes the escaped HTML entities (except quotes, they should display as desired in escaped format).
posted by alan at 10:13 AM | Link | Comments (1) - January 10, 2006 :
CSS Update Notice
I am almost too embarrassed to admit this, but thanks to an email from Keith K, it was pointed out the CSS class names used by Feed2JS are not exactly W3C valid since they use underscores (e.g..rss_box) and this may/will cause display problems in Internet Explorer (See Underscores in class and ID Names)
I've given some thought to this and have no clever way to do a workaround that will preserve the existing usage, so I am setting a future date when the script will be changed. This could happen in two different ways.
(1) The script changes. Any users who were using the current style sheets would have to edit their CSS to change all underscores for hyphens. (2) Thefeed2jsscript gets changed and saved as a new name (feed2js2.phporfeedtojs.php) that generates the proper classes, and the style builder will reference a copy of the original set of styles. This would mean old instances of the script will stay as is, but newer builds will be set up for the correct CSS declaration.
I more likely favor option 2 since it does not harm to current users, and I always aim to keep this backwards compatible. I am taking comments on this, but will implement a change by February 10, 2006.
posted by alan at 03:17 PM | Link | Comments (16) - November 15, 2005 :
Feed Building Bookmarklet
From a idea suggested by Bruce Arnold via email, we created a browser bookmarklet tool to help you build a Feed2JS script.
Just drag this bookmarklet to your Favorites or web toolbar. All you need to do is to follow a link to an RSS Feed (that is viewing the feed in its full or prettified XML glory). If you click the bookmarklet link, it will pop it into the Feed2JS Build a Feed form, with the default settings. You can change or copy/paste from there.
Is this useful? I dunno.
posted by alan at 10:17 AM | Link | Comments (1) - November 10, 2005 :
Beta Test Timezone Offset
I've been bothered by the timezone issue of items. The version of Feed2JS running on this site only has a new parameter named tz. If not defined, Feed2JS will just echo the string it finds in an item as the published date. However, if you specify your local timezone offset from GMT, it should correctly display the date and time in your local zone. For example, here in Arizona, the offset value is 7 hours ahead of GMT, so I enter -7.
Since the date/time stamps parsed from Magpie are local to my server, I have a new variable that adjusts this time to GMT, and then makes another adjustment based on the user entered offset.
If I get some feedback on if this works well, I will roll it into the downloads and the mirrors by next week. My time.
posted by alan at 02:58 PM | Link | Comments (3) - November 10, 2005 :
Magpie Update 0.72
We just updated MagpieRSS to the released 0.72 version (some small but important security fixes), and added one more item date stamp piece of logic (Atom 1.0 usesitem->created). Hopefully in the next few weeks, we will move the primary information and download site to an open source repository and develope a better method of releasing updates.
posted by alan at 01:23 PM | Link | Comments (0) - November 9, 2005 :
Our Clocks Have Been Wrong For a Long Time
Thanks to some keen observers who have recently noted a long standing problem with Feed2JS-- for the display of the date and item was posted, we had been using some Magpie and PHP functions to convert the date/time stamp of an item to a milliseconds value and then using the php date() function for the screen display. Yet I was overlooking the fact that the functions were converting the time into one relative to the local time on my server.
Of course, when testing against my own blag, the date.time stamps were okay since its on the same server and in the same timezone.
To calculate the time zone offset will take some effort since the date/time formats of feeds have about 5-10 different variations. One option is to include a new parameter that will allow a user to indicate the timezone offset from our local time-- this can be as simple as the build page displaying our local time and giving a drop down menu to select offsets from +12 to -12 to correct the offset.
Until I figure that, I have recoded the date/time stamping to just use whatever string is provided in the feed item; and some simple clean up such as removing "Z" from Atom date/times, and stripping the time zone offsets from RSS 1.0 feeds.
posted by alan at 04:24 PM | Link | Comments (0) - October 17, 2005 :
Pesky Curly Quotes
Numerous problems with strange characters in feeds are due to character encoding issues, especially content derived from sources that publish those pesky curly quotes. If your content is displaying unexpected characters, then there are two things to adjust- first is to select the UTF-8 encoding when building your feeds, but also your content page must either serve all content as UTF-8 or have in its HEAD content:<meta http-equiv="content-type" content="text/html; charset=utf-8">
Unfortunately, I discovered that our preview.php script used on this site and distributed was not properly testing for proper encoding, so sites using Feed2JS can either download the most recent version or siply make this update to preview.php.
FIND:<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
REPLACE with:<?php if ($utf== 'y') { echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">'; } else { echo '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">'; } ?>
posted by alan at 08:30 PM | Link | Comments (0) | TrackBack (0) - August 5, 2005 :
Scheduled Outage
This is a reminder that the Feed2JS server will be offline on Saturday, August 6 from 7:00 AM PDT (check world time clock for your local time) to 5:00 PM (check world time clock for your local time). Our building's internet connection will be off due to work on our electrical system.
If you wish to avoid an interruption on your use of Feed2JS, we suggested modifying the JavaScript code to use on of our mirror sites instead. All you need to do is to change the part of the url that reads href="http://feed2js.org/ and use instead:- http://www.izil.nl/Feed2JS/
Vindbaarheid (The Netherlands) - http://www.opengui.net/feed2js/
OpenGUI (California, USA) - http://www.astra-systems.com/feed2js/
Astra Systems (U.K.) - http://www.trendnetters.nl/feed2js/
trendnetters (The Netherlands) - http://feed2js.firebasesoftware.com/
firebase software (Dallas, USA) - http://www.kinscape.com/feed2js/
KinScape (Michigan, USA) - http://incsub.org/feed2js/
incsub.org (California, USA) - http://ablog.unitecnology.ac.nz/feed/
UNITEC (New Zealand)
posted by alan at 07:09 AM | Link | Comments (2) | TrackBack (0) - http://www.izil.nl/Feed2JS/
- August 2, 2005 :
New Mirror in the Netherlands
In just about 15 minutes of set up time, we had a new mirror site up and running in the Netherlands at vindbaarheid, originating from Utrecht, thanks to Mike Platenkamp.
As an FYI since some folks are confused, the purpose of our mirror sites are to provide more or less a clone of this original site running on my humble server in Arizona, at other geographically spread locations around the world. I have no interest in creating gobs of mirror sites (we have plenty in the US). This is nothing much more in terms of functionality than one gets by downloading our source code and running it on your server, except you get all the pages and orange colors of this site. For an example, see the Chinese translated version of Feed2JS, which is an available service built on the download, though not strictly a mirror site.
posted by alan at 09:54 AM | Link | Comments (1) | TrackBack (19) - July 20, 2005 :
Potential Service Outages
Please note that due to some building electrical upgrades, the server hosting Feed2JS is scheduled for some downtime as listed below. All times are Pacific Times (as if we were in L.A.). These are some long stretches but necessary.If this presents a major problem, you may want to consider switching your feeds to use on of our mirror sites. The outages are scheduled for
Saturday July 30: 7:00 AM - 12:00 noon
Saturday August 6 7:00 AM through Sunday August 7 5:00 PM
posted by alan at 03:54 PM | Link | Comments (0) | TrackBack (0) - June 27, 2005 :
Did The Lights Blink Out?
Apologies if there was Feed2JS outage in the last 24 hours. I was unable to reach any of the servers in my office area and being the weekend,. I was unable to check on it. The server hosting Feed2JS had lost its connections to services, still trying to research why. For thos that ask, any outages are temporary and the service will never be shut down completely without sufficient notice.
posted by alan at 07:33 AM | Link | Comments (2) | TrackBack (0) - June 8, 2005 :
Version 1.5, New Preview Buttons, Full Format Feeds
I have been embarrassingly delinquent in not doing a good job of versioning the feed2js code. So based on the long history list I have guestimated the current code to be version 1.5 which is totally arbitrary. Anyhow, this is now embedded in the main script, and is displayed in this site where we refer to the code.
Also, I have rolled into the new download an upodated build.php script that features the pop up window preview recently added to our main site's build a feed form. Since no one complained about it, I figured it worked.
Lastly, getting more used to WordPress Feeds, I notice the default RSS2.0 feed lists the item descsription both as plain text excerpt in the<description>tag fullpost HTML formatted in the<content: encoded>tag. The previous version of Feed2JS would look for encoded content only in atom feeds, but now it will use that for a description if it finds that tag in the feed. This way, the feed creator can use our settings to strip out HTML and truncate if they want a slimmed down feed.
Current feed2js.php scripts can easily be adjusted by changing the line that reads:if ($item['summary']) { $my_blurb = $item['summary']; } else { // Atom support (thanks David Carter-Tod) $my_blurb = $item['content']['encoded']; }to read// Atom/encocded content support (thanks David Carter-Tod) if ($item['content']['encoded']) { $my_blurb = $item['content']['encoded']; } else { $my_blurb = $item['summary']; }
posted by alan at 02:41 PM | Link | Comments (2) | TrackBack (0) - June 2, 2005 :
A New Build a Feed Form
The Build a Feed Form has been changed to make it a bit more usable. In the previous versions and as our form options expanded, you had to keep scrolling up and down to get to the preview and generate buttons. I wanted to make them more reachable near the top of the page, and to make it so the preview button would open in a new window.
As it turns out there were more twists than expected. The logic of keeping one button using PHP to generate the code and display it in a textarea for easy copy pasting conflicted with the other button needing JavaScript to not only open the window, but to access the current form field values. And this effort did not even include the extra 2 hours of dinking around with IE to drive corners around its CSS quirks.
As it stands now, this is in test mode only on the main Feed2JS site, and I need some more feedback or testing before rolling a copy into the downloads and the mirrors.
posted by alan at 01:51 PM | Link | Comments (5) | TrackBack (0) - May 30, 2005 :
Ignore Message
Excuse any confusion created by a message that appeared on feeds over the last 24 hours warning of a change to our server and a link for instructions that was bad. I had set up a new server but am not ready to switch over, and inadvertently copies the script that appended the server change notice. It has since been removed.
posted by alan at 02:50 PM | Link | Comments (0) | TrackBack (0) - May 29, 2005 :
Multiple Feeds / Multiple Styles
Based on several requests, we have added a new option that provides a means to have different instances of Feed2JS content on the same page displayed with different styles. Entering "foo" into a new input field on the build form or passed in the JavaScript string ascss=fooallows the feed content (by default a class named "rss_box") to be specified as "rss_box_foo", so a separate set of styles can be applied.
For examples, look at (and peek at the source code) of an example with two wildly different styles and a second one with more similar styles where the only difference is a class that defines the background color.
So it is possible to apply multiple styles, the burden is on the page designer to properly set up specialized sub classes. Your mileage may vary.
In addition, we now provide an optional on the examples page a tasty web badge (also on the left sidebar of this page) so you can give credit and link back for your use of Feed2JS.
posted by alan at 10:13 PM | Link | Comments (0) | TrackBack (0) - April 26, 2005 :
No Source Display Fix
Dan Nummer emailed two new code suggestions for the feed2js.php. One addresses the trap for missing values for the src= parameter, the URL for the feed. In previous versions, it attempted to do a URL switch to another error message page, but that does not work in the JavaScript output. The fix was to insert a placeholder one item RSS feed that is an error message:
href="http://feed2js.org/nosource.rss or in the feed2js.php code, modify the error checking code to read:// ERROR CHECKING FOR NO SOURCE ------------------------------- $src = (isset($_GET['src'])) ? $_GET['src'] : ''; // trap for missing src param for the feed, use a dummy one so it gets displayed. if (!$src) $src = "href="http://feed2js.org/nosource.rss";
See it in glorious action. Another problem identified by Dan was when Magpie got a bad feed but still returned some object reference, so he suggested changing the error checking line from:if (!$rss) {toif (!$rss->channel['link']) {Thanks Dan!
posted by alan at 03:57 PM | Link | Comments (0) | TrackBack (0) - April 16, 2005 :
New Variable Setup Logic
Minor updates today to the main feed2js.php and build.php scripts to more properly check for existence of variables before referencing them. This enabled a more reasonable set of defaults for the forms in the build.php script. This cause most of the problems in Windows server environments where the scripts produce "Undefined index" notices. Also, a remedy for thus was verified at another site to change the server'sphp.inifile section on error_reporting option. from:error_reporting = E_ALL
toerror_reporting = E_ALL & ~E_NOTICE
Again, lacking a Windows server, I am making a best guess.
posted by alan at 08:42 AM | Link | Comments (0) | TrackBack (0) - April 8, 2005 :
Atom Feed Fix
Thanks to a comment by jayaram I discovered a bug with the way Atom feeds from Blogger.com feeds (maybe others) where handled (always displayed as full entries and full HTML). It seems like an obvious goof!
An adjustment in the logic of feed2js.php has been made. either download the new files or make the following modification. Change the lines that read:if ($item['summary']) { $my_blurb = $item['summary']; // strip html if ($html != 'a') $my_blurb = strip_tags($my_blurb); // trim descriptions if ($desc > 1) { // display specified substring numbers of chars; // html is stripped to prevent cut off tags $my_blurb = substr($my_blurb, 0, $desc) . '...'; } } else { // Atom support (thanks David Carter-Tod) $my_blurb = $item['content']['encoded']; }to read:if ($item['summary']) { $my_blurb = $item['summary']; } else { // Atom support (thanks David Carter-Tod) $my_blurb = $item['content']['encoded']; } // strip html if ($html != 'a') $my_blurb = strip_tags($my_blurb); // trim descriptions if ($desc > 1) { // display specified substring numbers of chars; // html is stripped to prevent cut off tags $my_blurb = substr($my_blurb, 0, $desc) . '...'; }
posted by alan at 07:24 AM | Link | Comments (0) | TrackBack (0) - April 5, 2005 :
Build.php Script Cleanup
The latest full version has a revised script for the build a feed form (better logic for handling of form field input, testing for variable existence, etc). You can download a copy of this one script via href="http://feed2js.org/build.php.zip... I still could use some suggestions as to how to make the logic work on Windows-based servers (of which I have none) as PHP on Windows seems to have a different way of dealing with undeclared variables.
posted by alan at 11:06 AM | Link | Comments (0) | TrackBack (0) - March 28, 2005 :
UTF-8 and Magpie Now Included
I have simplified some settings code so that all distributions of Feed2JS now have built in support for UTF-8 encoded feeds as a user option. To make set up easier, the download now includes a copy of Magpie 0.71 in a default location, hopefully making the set-up easier.
posted by alan at 12:05 AM | Link | Comments (2) | TrackBack (0) - March 3, 2005 :
Item->Link White Space Fix
Larry Bouwens helped uncover bug in our Feed2JS script. Feeds from the National Weather service such as http://weather.gov/data/current_obs/KCOS.rss are structured so the link tags are formatted:<link> http://www.nws.noaa.gov/ </link>and until now the script was not parsing out the extra white space (linefeeds and spaces) so when tossed into a JavaScript statement, the script broke. Bottom line, the addition of a fewtrim()statements cleaned it up.
posted by alan at 03:59 PM | Link | Comments (0) | TrackBack (0) - February 19, 2005 :
Add a Feed Validator Button to the Build Form
Most problems with feeds not being processed through Feed2JS are due to RSS feeds that are not valid-- while they may be accessible through RSS readers, the Magpie RSS parser should have a valid feed to do its work correctly. I just added a button to our build a feed form so any URL typed in the form field can be checked with the Feedvalidator. To add this toi your own build form, it is a small editing change (the button depends on JavaScript).
Add aname="builder"attribute to the FORM tag:<form method="get" action="<?php echo $_SERVER['PHP_SELF']?>" name="builder">
and just after the form field for the RSS URL (field for "src") add"<input type="button" value="Check with Feedvalidator" onClick="window.open('http://feedvalidator.org/check.cgi?url=' + encodeURIComponent(document.builder.src.value), 'check')">
posted by alan at 11:53 PM | Link | Comments (0) | TrackBack (0) - February 18, 2005 :
Network Downtime Notice
As an FYI, our entire network is going offline for service on February 23, 2005, between 1 and 4 AM PDT. Thus Feed2JS will not work or respond during this time period. This is in addition to the weekly interruptions I am still trying to diagnose that seem to occur Saturdays around 7AM PDT.
posted by alan at 01:22 PM | Link | Comments (0) | TrackBack (0) - February 12, 2005 :
How To Set Up UTF-8 Options
For those running their own versions of Feed2JS and want to provide support for UTF-8 encoding, I have written up the steps in the mods section. This will likely not be part of the normal distribution as it requires changes to your locally installed versions of Magpie (just making copies and mods to existing files, setting up a second cache directory).
posted by alan at 12:17 PM | Link | Comments (0) | TrackBack (0) - February 12, 2005 :
New Server Timeout Watcher Script
Our apologies for our server outages which seem t occur local time Friday night / Saturday AM. I am trying to isolate the cause and it may just me too many requests.
I have an experimental set of JavaScript code that sets up a timer and presents the user an alert if our server has not been contacted in 15 seconds (or you can change that timeout). What it then tries to do is allow the user to say, "Keep trying" or "Cancel"- and if the cancel is selected, it tries to stop the page load. That last part seems to work on most, but not all browsers, but now at least users can be made aware that our server is unable to process the feeds.
Get more on the script from my cogdogblog entry offering this code and/or download a test file with the new JavaScript (now much more than a single line of cut and paste). Not sure at this point the effect for more than one Feed per page (I would use the code only on the first loaded feed).
posted by alan at 11:59 AM | Link | Comments (0) | TrackBack (0) - January 27, 2005 :
Yet Another One Character Fix
Another puny bug- the recent effort to provide only non default parameters in the long JavaScript string, developed into a wroing default setting in the main feed2js.php script. Change the line (arounf line 90) that reads:if (!$chan) $chan = 'y';
toif (!$chan) $chan = 'n';
Thanks to Nic in Auckland for pointing this one out to me. A bug a day...
posted by alan at 04:41 PM | Link | Comments (0) | TrackBack (0) - January 27, 2005 :
Error Trapping: A One Character Update
One of the problems with Feed2JS is when Magpie has an error, it generates an HTTP response, and causes the problems often reported of "Warning: Cannot modify header information - headers already sent by..." -- your web page has already sent the HTTP headers (hidden information passed to the browser about the content that is coming), and somewhere in the middle of the page, Magpie tries to send new headers with an error response.
The tiniest of tiny updates will at least trap the cases where a URL for an RSS feed is not found or is not able to be fetched by Magpie-- using the http://us2.php.net/manual/en/language.operators.errorcontrol.php, just placing an "@" sign before the line where you fetch the Magpie RSS will catch this problem. So find the line that reads:$rss = fetch_rss( $src );
and edit it to read:$rss = @fetch_rss( $src );
For example, see this spoofed one where I deliberately mistyped the URL for my own RSS Feed. Rather than getting the Magpie reported errors, the value of $rss fails and triggers the Feed2JS response.
posted by alan at 09:28 AM | Link | Comments (0) | TrackBack (0) - January 25, 2005 :
New Linebreak Option and Shorter JS strings
Sometimes I add a feature and then finds it has un-intende effects. The update to honor page breaks caused formatting problems for others as any linefeed in the item -> description (or equivalent) was thus getting more BR tags than it needed and spacing out some people's displays. Without adding any new parameters, there is no a solution. The default behavior for all feeds (html=n) is to leave linefeeds alone. If a paragraph is desired for item descriptions, you would use a new optionhtml=pto honor paragraphs.
Check out examples with paragraphs honored, without paragraphs honored , and with HTML (which formats as it needs to). Another feature for the build a feed form is that is the values for any options are the defaults, there is no need to include it in the long JavaScript string, so you might see some shorter JavaScript code to cut and paste. For example, with all default settings the code can be reduced to:<script language="JavaScript" src="href="http://feed2js.org/feed2js.php? src=http%3A%2F%2Fjade.mcli.dist.maricopa.edu%2Falan%2Findex.rdf" type="text/javascript"></script> <noscript> <a href="href="http://feed2js.org/feed2js.php? src=http%3A%2F%2Fjade.mcli.dist.maricopa.edu%2Falan%2Findex.rdf"> View RSS feed</a> </noscript>
posted by alan at 09:42 PM | Link | Comments (1) | TrackBack (0) - January 23, 2005 :
Target to Pop Up Windows and New Item Description Option
Two more updates based on user requests. I aim to implement things that can be done without adding new parameters and that will not mess up anyone's previously set up feed/ Time will tell if I got it right. The first update is to allow a new option fortarg=popupto enable sending links to a pop up JavaScript window with site defined features for the window. Doing so necessitates adding a JavaScript functionpopupfeed(url)to you page that contains the feed-- we provide a sample to experiment with (see example).
The next allows feed items to be displayed without the item title and link, just the content in the description (apparently a number of Blogger feeds use the same text for the title and the content). Setting the value ofdesc=-1will create output the is just the item -> description (see example).
Also, the cache time on our site is back to 60 minutes.
posted by alan at 08:48 PM | Link | Comments (0) | TrackBack (0) - January 20, 2005 :
No delicious feeds allowed
Either due to my own code blunders, or someone else's overly aggressive page reloads or some force of the moon, our Feed2JS site has been banned from accessing del.icio.us feeds. Sorry about that folks, but you cannot display these feeds through our site. This is what you will see. This only affects feeds from del.icio.us. We are looking at some ways to address this, but no promises.
Update: They are giving us another chance to behave! You can again try and use our code for del.icio.us feeds. To be better consumers of feed, please note that we are now caching feeds for a 2 hour period.
posted by alan at 10:43 AM | Link | Comments (0) | TrackBack (0) - January 18, 2005 :
Output Now Honors Linebreaks
This was something that should have been fixed a while ago. Most of the feeds I use are snippets of the items (using options to truncate after say the first 150 characters), but many users want to use the full content of the item. The way I had set up Feed2JS, and to avoid breaking any JavaScript, any linefeed/return characters were replaced by spaces. Now, a tiny modification to thefeed2js_config.phpwill instead insert a<br />instead, and thus, provide nicer paragraph/line breaks (new and improved example). The change requires finding the line infeed2js_config.phpthat reads:return ereg_replace("(\r\n|\n|\r)", " ", $subquotes);<and change it to readreturn ereg_replace("(\r\n|\n|\r)", "<br />", $subquotes);Ignore that, a hasty fix that ended up breaking code elsewhere. A new set of scripts has been posted, and the necessary change is in the entire function referenced above. Change the lines that read:function strip_returns ($text) { $subquotes = ereg_replace("'", "'", stripslashes($text)); return ereg_replace("(\r\n|\n|\r)", " ", $subquotes); }withfunction strip_returns ($text, $linefeed=" ") { $subquotes = ereg_replace("'", "'", stripslashes($text)); return ereg_replace("(\r\n|\n|\r)", $linefeed, $subquotes); }This way we do not make a substitution with a BR tag unless it is passed as a parameter (only when writing the item->description content). Sorry for the broken feeds today!
Also noted that Magpie 0.71 does not extract it's claimed unix timestamp for RSS 2.0 feeds, so I had to revert code to the previous series of IF-THEN check statements top yank the date out.
posted by alan at 09:30 PM | Link | Comments (5) | TrackBack (0) - January 13, 2005 :
UTF-8 Now An Option (again)
One more time, as now Poland is writing asking for UTF-8 ;-) I have an experimental version, running here on my server-- these changes are yet to be in (or may never) be in the distributed version. There is anew checkbox option on the Build a Feed form to use UTF-8 encoding on the output. You can achieve this on a running version a JavaScript link to our server only, by adding the following to your parameter string:utf=y
To create this, I am almost running two different versions of Magpie. What I did was to make a second copy of the Magpie libraryrss_fetch.incasrss_fetch_utf-8.inc. This clone merely has the extra code:// chacrater encoding define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');as well as pointer to a second cache directory for UTF feeds. The main feed2js.php script now checks for this new variable (utf), if it does not exist, we use the normal logic and include thefeed2js_config.phpthat has the settings to the regular Magpie stuff. On the other hand, if it senses a value ofutf=y, it includes rather the configuration filefeed2js_config_utf8.phpwhich includes the cloned filerss_fetch_utf-8.incand points to the utf special cache directory.
Here is the test case. A feed from a Belgian site sent to be this morning needs ISO-8995-1 encoding for French Characters, so it uses the normal Feed2JS with the param string:src=http%3A%2F%2Fwww.lalibre.be%2Frss&chan=y&num=5&desc=1&html=n&date=y&targ=n
and views as it should (try this preview). If you apply the UTF-8 encoding with:src=http%3A%2F%2Fwww.lalibre.be%2Frss&chan=y&num=5&desc=1&html=n&date=y&targ=n&utf=y
it breaks it, using the wrong French character codes (viva la difference). If someone can give it a run with a proper UTF site, let me know.
posted by alan at 01:52 PM | Link | Comments (2) | TrackBack (0) - January 13, 2005 :
Encoding Revert
Due to numerous reports of problems with French language sites and the newly changed UTF-8 encoding, I am undoing it, and reverting to default iso-8559-1 character encoding (until I can understand it better!). Your feeds may need an hour or so to be updated from our cache.
posted by alan at 10:52 AM | Link | Comments (0) | TrackBack (0) - January 11, 2005 :
Simpler Date/Time Stamps and UTF-8
A bonus of the new Magpie 0.7 code is that it has a simple function for extracting the date, so I was able to replace this hackneyed code:// print out date if option indicated and feed returns a value. // Thanks Rogers Cadenhead! if ($date == 'y') { $in_date = ""; $rss_2_date = $item['pubdate']; $rss_1_date = $item['dc']['date']; $atom_date = $item['issued']; if ($atom_date != "") $in_date = parse_w3cdtf($atom_date); if ($rss_1_date != "") $in_date = parse_w3cdtf($rss_1_date); if ($rss_2_date != "") $in_date = strtotime($rss_2_date); if ($in_date == "") $in_date = time(); // format date if (strlen($rss_1_date) == 10) { // hack to catch dc:date in format 200x-XX-XX $pretty_date = date("F d, Y", strtotime($rss_1_date)); } else { $pretty_date = date($date_format, $in_date); } $str.= "document.write('<span class=\"rss_date\">posted on $pretty_date</span><br />');\n"; }with this:// print out date if option indicated and feed returns a value. // Use the new date_timestamp function in Magpie 0.71 if ($date == 'y') { $pretty_date = date($date_format, $item['date_timestamp']); $str.= "document.write('<span class=\"rss_date\"> posted on $pretty_date</span><br />');\n"; }Also, Magpie 0.7 has support for converting character encoding output to UTF-8, although with limitations for what it can encode from (PHP4 limited support for only 3 kinds of incoming character codes it can detect). I hope someone can let me know if this helps or breaks the code. To set this, you will need to add to yourrss_fetch.incfile:// chacrater encoding define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');Thus Magpie 0.7 is going to be needed for this any future versions of Feed2JS.
posted by alan at 10:07 PM | Link | Comments (1) | TrackBack (0) - January 11, 2005 :
Titles for Item Link Tags
Thanks to a suggestion from Seb Paquet, I added code to insert the first 150 chars of an item's description as the value for thetitle=of the href links for feed items. This means that outputs can be generated with options for no item descriptions displayed, but mouse overs on modern browsers should display the text from the descriptions.
Huh? See this preview example using the feed from the Magpie blog- roll over the links.
posted by alan at 09:55 AM | Link | Comments (0) | TrackBack (0) - January 9, 2005 :
Tested With Magpie 0.71
This site has been tested and updated with the latest version of MagpieRSS (0.71) -- more or less to verify it works. I've yet to dive into the character site improvements that were part of this update.
Also fixed two typos in the php include version which should not have any instances ofaddslashes(...)which will prefix any quotes in your output with a "\" (this is needed in JavaScript to prevent breaking of JS strings).
Finally, after trying the best way to deal with register globals and various versions of PHP, all scripts now load variable values from the$_GETarray, which should work whetherregister_globalsis on or off. A few style scripts (style.php and style_preview.php) use the$_REQUESTarray due to the mixed sources of variables. It does mean Feed2JS ought to be running under PHP 4.1 or newer, which is not stringent at all. Still have yet to confirm any problems with PHP 4.3.10 and I don't have a place to even try testing PHP 5. Any help appreciated.
posted by alan at 09:50 PM | Link | Comments (0) | TrackBack (0) - December 29, 2004 :
Year End Title / Link Fixes
More year end fixes. Roch Smith brought to our attention problems with feeds that lack item->title content, as well as some feeds that lack item->link (now if that is not present, we try and use item->guid). Title-less items now display as just a bullet with the item->description text and an appended "details" link to the full article.
posted by alan at 11:22 AM | Link | Comments (0) | TrackBack (0) - December 28, 2004 :
Build Page Fix
Alert writer Chris Wright noticed my error in a recent update to thebuild.phpform-- line 26 should read:if (!$desc) $desc = 0;
not the value of 1 it had been listed (I was trying to get fancy with the defaults, but it broke the logic)
posted by alan at 10:25 AM | Link | Comments (0) | TrackBack (0) - December 23, 2004 :
Atom / HTML Fix
Ouch! Roch Smith brought to our attention a flaw with parsing of Atom feeds with the newhtml=aoption from the last update. This is a minor bug fix if your Atom feeds were displaying with blank items.
posted by alan at 09:26 AM | Link | Comments (0) | TrackBack (0) - December 2, 2004 :
Atom Encoded Content
With suggestion from David Carter-Tod, encoded content descriptions are used from Atom feeds. Also, there is a new option valuehtml=awill cause the output to use full HTML in the item description. Also, by request, the value oftarg=can be set to specified to a frame/window target, so item links will load in the specified place.
posted by alan at 11:29 PM | Link | Comments (0) | TrackBack (0) - September 10, 2004 :
Configuration File
I changed the structure of the code where the local configuration settings (paths to Magpie) and common functions are stored in a separate php file,feed2js_config.php. This should make futurew updates simple, as you will no longer have to re-edit the settings. This also makes the php include version capable of neing used multiple times on the same page viarequire_once(). There were also problems in the use of $_REQUEST array for grabbing variable values when register globals is OFF, as this is only available with PHP 4.2 and later... I have reverted to usingextract($_GET). I am still trying to determine why some feeds fail to be fetched by Magpie.
posted by alan at 01:30 AM | Link | Comments (0) | TrackBack (0) - August 7, 2004 :
Apostrophes in URLs?
Tiny fix as someone identified a feed item with a URL link that had an apostrophe in it. Crazy! Just a need for an extraaddslashesto make sure JavaScript would not choke on the output.
posted by alan at 10:20 AM | Link | Comments (0) | TrackBack (0) - August 4, 2004 :
Why Not PHP the Feed?
If you are running your own version of Feed2JS then there is no reason for your own web sites to use JavaScript to generate feed content; a slight modification to the script allows it to run as an included PHP code file. I have also beefed up the download package to offer you the same style sheet preview and modify functionality we offer. August 7 update: There was a missing semi-colon on line 115 in the last update. I also added a link to the build form to test-debug the script (it generates a link to the HTML version of the test feed; if a PHP error exists you will see it)
posted by alan at 01:00 PM | Link | Comments (2) | TrackBack (0) - July 25, 2004 :
Share Form Tweaked
The form for adding a new URL to our collection of examples now verifies that a submitted URL actually contains the Feed2JS embedded code. Some folks will use any form to submit a site in the vain pursuit of Google-rank.
posted by alan at 11:32 PM | Link | Comments (0) | TrackBack (0) - July 20, 2004 :
Update Website
Not a change to the code, but added new features to this web site. The tools for applying style sheets to the feeds has been expanded with details on how to incorporate the CSS. In addition, the preview for the styles now allows you to make changes to the default sets and develop your own original CSS-- and in CSS Zen Garden like fashion, we have a simple form for submitting new styles to the site.
posted by alan at 02:33 PM | Link | Comments (0) | TrackBack (0) - July 13, 2004 :
Another Date Tweak
Not quite done with item dates. Henrik Bechmann brought to our attention that a number of RSS1.0 feeds have dc:date values in the format of 2004-XX-YY, which does not provide a valida date/time stamp. Some new code logic now fixes it, and we deployed his suggestion to make the link target window of the channel match that of the items.
posted by alan at 08:33 PM | Link | Comments (0) | TrackBack (0) - July 7, 2004 :
Date Fix
A very puny minor update- I adopted the code logic from Rogers Cadenhead for correctly addressing the different date fields from RSS 1.0, 2.0, and Atom. No major need to update unless your posted dates are not correctly displaying.
posted by alan at 10:34 AM | Link | Comments (0) | TrackBack (0) - July 2, 2004 :
No Title Links and OIther Mods
Minor addition to provide appropriate output if Feed2JS is sent an feed that has no items (previously it was an empty list, now it states there are no items). Apparently some calendar generating feeds can be blank. Also, there are some special modifcation examples that individuals have requested- we provide some code snippets to show how to achieve special requests that are not part of the general distribution.
posted by alan at 03:35 PM | Link | Comments (0) | TrackBack (0) - June 2, 2004 :
Fix Escaped Quotes
Added a line in strip_returns() function to remove "\" from feeds that escape quotes (WordPress apparently dows this). Problems with the cache directory are most likely related to server permissions isses. If a proper file parth is not provided for MAGPIE_CACHE_DIR, then the directory the magpie files sit in must have write permission granted to the web server so it can create a new directory.Still trying to figure out why WordPress pubDate values are not recognized- it looks like they lack a prooper time zone.Nope- it looks like Magpie is returning some dates in the array as item->dc:date and other feeds as item->pubdate, so I need two different date formatting routines.
posted by alan at 11:35 PM | Link | Comments (0) | TrackBack (0) - May 26, 2004 :
Accessing Variable Values
Re-coded for use of extract($HTTP_GET_VARS) for accessing variables where the server Register Globals is off-- much cleaner, thanks for the suggestions. A minor problem in the build script was fixed for the html value and another part of the form was fixed where it was not logically setting the correct form value.
posted by alan at 05:36 PM | Link | Comments (0) | TrackBack (0) - May 24, 2004 :
Feed2JS 1.0
Version 1.0 of the new and improved Feed2JS is released- an upgrade of the previous RSS2JS service. The major change is a switch form the unsupported OnyxRSS parser to the Magpie RSS one, which seems more robust and supports Atom. Also changed is the option for the item descriptions, which now allow you to specify a number of characters to display (and truncate). And, we rolled the NOSCRIPT alternate version (for web users without JavaScript) from a separate PHP script into the main one.
posted by alan at 08:37 AM | Link | Comments (0) | TrackBack (0) - March 23, 2004 :
Bad Build
Doh! The build.php script had an error that wrote an extra "/feed/" in the file path for the rss2html.php link.
posted by alan at 09:39 AM | Link | Comments (0) | TrackBack (0) - December 31, 2003 :
New Server
Moved this entire site to a new server (no change in URLs or locations, just hopefully a speedier host!)-- all cached feeds were dropped in the move. Happy New Year!
posted by alan at 11:20 AM | Link | Comments (0) | TrackBack (0) - December 15, 2003 :
Minor Fixes
Minor fixes to take care of uses of this script on other servers. The re-direct for a missing RSS URL (nosource.html) had a suggested format that referred to the script on this server only; now it points to a new version (nosource.php) that dynamically generates the URL for uses elsewhere. Likewise, our "build" script (build.php) that generates sample JavaScript code was referencing just my server; now it too does it dynamically.
posted by alan at 11:41 PM | Link | Comments (0) | TrackBack (0) - December 3, 2003 :
Date Bug
Fixed a bug that was causing incorrect item date displays from RSS 2.0 feeds, thanks to Todd Slater for bringing it to our attention. A revamp of this web page and some documentation for the Onyx parser is coming soon.
posted by alan at 10:41 AM | Link | Comments (0) | TrackBack (0) - October 14, 2003 :
RSS 2.0 Enhancements
Added code to deal with RSS tags of <guid> elements for item URLs and <pubDate> for RSS 2.0 item published dates. Also added a trp to post "no title" if no title tag exists for items
posted by alan at 04:42 PM | Link | Comments (0) | TrackBack (0) - October 13, 2003 :
Cache File Names
Cleaned up code for naming cache files, with many feeds from this site, many were be overwritten by similar feeds names from other sites (previously, the cache fiels were base don the path of the feed, now it is the whole URL)
posted by alan at 05:10 PM | Link | Comments (0) | TrackBack (0) - September 15, 2003 :
Link Targets
Changed Javascript output for items link with a TARGET= option so items would open in a separate browser window.
posted by alan at 11:43 PM | Link | Comments (0) | TrackBack (0) - August 8, 2003 :
NOSCRIPT
Added a NOSCRIPT alternative that provides a link to a HTML version of the feed.
posted by alan at 11:44 PM | Link | Comments (0) | TrackBack (0) - May 14, 2003 :
New Web Forms and Code Cleansiing
Added the web form above for generating previews and the JavaScript syntax for feeds. Also Added item posting date feature suggested by D'Arcy Norman (who also cleaned up some loop variable madness), and adding channel option for title only display.
posted by alan at 11:44 PM | Link | Comments (0) | TrackBack (0) - May 13, 2003 :
Variables
pdate to take care of accessing variables from $_GET array, and add optional paraemters for output control, thanks to suggestions by Randy Brown.
posted by alan at 12:45 PM | Link | Comments (0) | TrackBack (0) - May 7, 2003 :
File Name Updates
Modifications in output and cache file setting thanks to D'Arcy Norman.
posted by alan at 09:46 AM | Link | Comments (0) | TrackBack (0) - May 3, 2003 :
RSS2JS First Release
Inspired by David Cater-Tod's Wytheville Community College News Service, we created a basic prototype in May 2003 (using the now dormant OnyxPHP RSS Parser), and the first generation of RSS2JS
posted by alan at 10:46 AM | Link | Comments (0) | TrackBack (0)