Having Troubles with Feed2JS?

Feed2JS is just some code we have shared, it is free, and we do not have a lot of staff (well none) in customer support. But we will do our best to help you with any problems.

Using Multiple Feeds in One

Can the feed-generator generate news from multiple sites?

As is, Feed2JS can only take one RSS feed as a parameter. If you want to create a display that is a mix of multiple sites, our suggestion is to use an externals ervive that can take a list of RSS feeds and "splice" or "mix" them into one RSS URl that you can use in Feed2JS.

For more details, see RSS Mixers. The following sites offer this sort of service:

Why Does my Feed Display with Strange Charcter Substitution?

What are quotes and other punctuation marks replaced by question marks or other strange characters in the display of a feed?

The explanation is a bit more than we can write here, but it has to do with the charcter sets used to display web content. Most web pages by default, use what is known as ISO-8559-1 or Lat1n-1 sets of charcters. Many publishing systems, or content pasted from software such as MS Word, introduce certain characters (curly quotes, em-dashes) that are not part of the ISO-8559-1 character set, and thus it substitutes other characters, which look like gibberish.

However, there is a web chcaracter set called UTF-8 that can properly display these characters. There are two things you need to do to make this work. First, in Feed2JS, you must check the option box for Use UTF-8 Encoding. This tells our script to use UTF-8 characters for its output. But to have it work correctly in your web page, you must edit or add a line of HTML code so the web page knows to display with this character set. This must be done in the web page that contains the cut and paste Feed2JS code.

In the <head>...</head> portion of your web page, look for a line like:

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

and change it to read:

<meta http-equiv="content-type" content="text/html; charset=utf-8">

If there is no such line, add this code anywhere after the <title>...</title> tags.

With a new method, adding the character set to the web page HTML may not be necessary! Andrew Denner, a user of Feed2JS from St Pauls Nursery School & Children's Centre wrote with this tip:

We have been using your feed on our website, but encountered a problem with character encodings. Although we could solve this locally by turning on UTF-8 mode in feed2js and changing the encoding type of our page, it did not work once we put the page live. This was because our server overrides the encoding specified by the html, and declares the content type as ISO8859-1 in the http headers.

So it looked like we were stuck with errant encoding of unusual characters, but I hit upon a solution. If in the script tag that loads the feed2js code you include charset="UTF-8" as an attribute, this correctly identifies the character encoding of the external src, and so the browser loads these characters correctly independent of the encoding specified either in the html or http headers of the parent page. This would probably be useful to add to the help section on changing the meta tag in the header, as an alternative to changing the encoding of the original page or server. It could even be added to the generated html in the feed builder when UTF-8 mode has been checked.

We have updated Feed2JS so if a user selects the option for URF-8 encoding, the charset declaration is added to the cut and paste Javascript code.

How can I make links appear in a custom pop up window e.g. no buttons ot browser bars?

This is a new feature as of January 23, 2005. If you specify a value for the Feed2JS variable targ=popup, the links will be built that can pass the URL to a JavaScript function named popupfeed(url) that can then do the work to open the a new window with the features you want.

This does require that the web page containing the Feed2JS JavaScript code also have in the <HEAD>...</HEAD> part of the HTML, a JavaScript function. We provide one as an example, but you can edit the function to get the window features you desire:

This can be either linked as an external javascript file (or added to one you already use) :

<head>
<script src="popup.js" type="text/javascript" language="Javascript">
...

or entered directly into the <HEAD>...</HEAD> for your feed page:

<head>
<title>My Cool Web Page With a Feed</title>
<script type="text/javascript" language="Javascript">
function popupfeed(url) {
/*
	Use this function to generate a pop up window for 
	item links generated by the Feed2JS service. The 
	name of this function must exactly be
			popupfeed
	
	and you can use the code below to specify specific 
	window features
	See http://jade.mcli.dist.maricopa.edu/feed/index.php?s=mod
*/

	// string to specify window features

	var myfeatures = "toolbar=no,location=no,directories=no,
	     menubar=no,scrollbars=yes, status=yes,resizable=no,
	     width=800,height=400";
	
	thefeed = window.open( url, 'feed2jspop', myfeatures);
	if (window.focus) {thefeed.focus()}
}
</script>
</head>

Use Different Style Sheets On the Same Page

I have multiple feeds listed on the same page- is it possible to have different style sheets applied for different feeds?

This was not possible before June, 2005. A new feature added to our build form allows you to specify a name that becomes part of the class that defines the feed content. By default, this class is rss-box but if you name a new class such as "cool" or pass a parameter css=cool, you can now style via a class named rss-box-cool. You may have to redefine more specific sub-classes to make dramatically different styles. See the examples included on the Feed Style page.

When the Server Blinks Out

My web pages using Feed2JS do not fully load and when I check your server it is out of commission.. is there anything I can do?

Unfortunately we are dealing with a lot of traffic on our server and trying to isolate why it gets bogged down. One solution would be using one of our mirror sites as a primary or a backup.

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 info 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).

Feeds Updating

"My web site feed has changed but the display from Feed2JS has not changed. What's going on?"

If you are using our web site to generate your feeds, please keep in mind that a site's feed is cached for 60 minutes. This means that once a feed is requested, it is stored locally on our server as a "cached" version that will be used until the cache version is at least one hour old. This is to avoid a performance hit on our server.

If you are running your own version of Feed2JS, you can alter this cache age if you want more or less frequent updates. This is done by editing the value of CACHE_AGE in the feed2js_config.php file:

// default cache time is one hour
define('CACHE_AGE',  3600);

A value of 1*60 would only cache feeds for one minute but is not friendly to the loads on other sites.

Problems with Feeds

Feed2JS does not report errors all that well, so it takes a bit of digging to identify an error. The easiest way is to use the build a feed form, and use the option to generate the Javascript. Copy the portion of the Javascript tag that is in the src="...." portion, paste that URL into your browser. If there is a PHP error, it should appeart. If you see a bunch of HTML/JavaScript code echoing output, you are in good shape.

Other things to check:

Known Issues And Fixes

My installed version keeps reporting error messages about Undefined indexes...

PHP Notice: Undefined index: chan in d:\csd\rss\feed2js.php on line 68
PHP Notice: Undefined index: num in d:\csd\rss\feed2js.php on line 69....

From what I can tell, this is symptomatic on Windows servers where the default settings for PHP are to provide notices of variables not explicitly declared. In your server's php.ini file search for and find the error_reporting option.

I recommend you change your settings from:

  error_reporting = E_ALL
to
  error_reporting = E_ALL & ~E_NOTICE

This will prevent the "Undefined Index" errors (the others likely trigger from there). Note that as of April 16, 2005, code changes to both feed2js.php and build.php should prevent the error notices, but lacking a windows server, I cannot verify 100%.


Show us your love, post a badge


Brian Teller
is keeping Feed2JS alive, thanks Brian (applause)

github
github project site



Feed2JS is fueled by Magpie RSS