PDA

View Full Version : RSSfeeds v1.2 by FASherman


descds
10-24-2005, 11:18 AM
Im loving this plugin and after modifying the code a little to use

</p> to get the format just right for my rss feeds it works perfectly ...

My only question is is there a way to modify the code to get it to parse ALL itmes in an RSS feed instead of stating a number of itmes to display ?

Im trying to use yahoos latest DVD releases feed http://rss.movies.yahoo.com/dvd/newthisweek.xml but the item numbers change weekly and if i put in too high a number on the plugin and the items don&#39;t exist i get a

Fatal error: Call to undefined function: array() in /home/descds/public_html/plugins/p78_RSSfeeds/p78_RSSfeeds.php on line 51

Is there anyway to modify this to pull all the data from an available rss feed ?

descds
10-24-2005, 11:40 AM
Mmm on further tests it would appear the plugin has an issue with this feed when it addresses the TTL on that line. I have no idea why as its a valid feed and ive even put back the changes i have made ..

Anyone any ideas ?

<div class='quotetop'>QUOTE(descds &#064; Oct 24 2005, 12&#58;32 PM) 1845</div>
Mmm on further tests it would appear the plugin has an issue with this feed when it addresses the TTL on that line. I have no idea why as its a valid feed and ive even put back the changes i have made ..

Anyone any ideas ?
[/b]

AHA it appears the yahoo feed in question has a ttl of this feed is hard set in the xml of a value of 720 and my update was for 60. When it tries to update i assume the feed passes the 720 to the TTL time and is supposed to then set the plugin to 720 instead of 60 with this statement :-

if (&#036;URLOPTION[&#39;feedTTL&#39;] < &#036;CHANNEL[&#39;TTL&#39;]) {
&#036;URLOPTION[&#39;feedTTL&#39;] = &#036;CHANNEL(&#39;TTL&#39;);
}

but something isn&#39;t right and it errors with the above statement.

prmdbr
10-25-2005, 11:58 AM
<div class='quotetop'>QUOTE(descds &#064; Oct 24 2005, 07&#58;40 AM) 1845</div>
Mmm on further tests it would appear the plugin has an issue with this feed when it addresses the TTL on that line. I have no idea why as its a valid feed and ive even put back the changes i have made ..

Anyone any ideas ?
AHA it appears the yahoo feed in question has a ttl of this feed is hard set in the xml of a value of 720 and my update was for 60. When it tries to update i assume the feed passes the 720 to the TTL time and is supposed to then set the plugin to 720 instead of 60 with this statement :-

if (&#036;URLOPTION[&#39;feedTTL&#39;] < &#036;CHANNEL[&#39;TTL&#39;]) {
&#036;URLOPTION[&#39;feedTTL&#39;] = &#036;CHANNEL(&#39;TTL&#39;);
}

but something isn&#39;t right and it errors with the above statement.
[/b]

This plug in is poorly supported. There has been a question about the exception: "Could not open RSS source" floating for three months and author still has not answered it.

I am suffering from the issue and would very much like some insight.

Terminator1138
10-25-2005, 06:06 PM
I have not seen FASherman around for a bit so I"m not sure what to say about your question. Perhaps someone here can help edit or customize the code to get it to what you need.

abcohen
10-25-2005, 06:15 PM
i dont have a clue about RSS -- sorry cant help out on this one.

descds
10-27-2005, 06:11 PM
<div class='quotetop'>QUOTE(descds &#064; Oct 24 2005, 12&#58;40 PM) 1845</div>
Mmm on further tests it would appear the plugin has an issue with this feed when it addresses the TTL on that line. I have no idea why as its a valid feed and ive even put back the changes i have made ..

Anyone any ideas ?
AHA it appears the yahoo feed in question has a ttl of this feed is hard set in the xml of a value of 720 and my update was for 60. When it tries to update i assume the feed passes the 720 to the TTL time and is supposed to then set the plugin to 720 instead of 60 with this statement :-

if (&#036;URLOPTION[&#39;feedTTL&#39;] < &#036;CHANNEL[&#39;TTL&#39;]) {
&#036;URLOPTION[&#39;feedTTL&#39;] = &#036;CHANNEL(&#39;TTL&#39;);
}

but something isn&#39;t right and it errors with the above statement.
[/b]

OK i managed a workaround for it.

In your RSS XML look for a TTL statement. In Yahoo it was something like :-

<ttl>720</ttl>

Then set your Time to Live: option to that setting (in this case 720) and the exception above never comes about.

Ive got the plugin doing all i want now and although it didn&#39;t parse the yahoo feed properly i fixed that quite easily with a few str_replace variables ...

&#036;DESCRIPTION&#91;&#036;i&#93; = str_replace&#40;&#34;&#60; &#34;, &#34;&#60;&#34;, &#036;DESCRIPTION&#91;&#036;i&#93;&#41;;
&#036;LINK&#91;&#036;i&#93; = str_replace&#40;&#34; &#34;, &#34;&#34;, &#036;LINK&#91;&#036;i&#93;&#41;;

This sorted the yahoo feed out nicely that was poorly parsed before hand.

Also changing the final output to a paragraph made it neater on appearance (in my mind). What i did was change this (from line 128)

echo &#39;&#60;a title=&#34;Published&#58; &#39;.&#036;PUBDATE&#91;&#036;i&#93;.&#39;&#34; href=&#34;&#39;.&#036;LINK&#91;&#036;i&#93;.&#39;&#34; target=&#34;&#39;.&#036;OPTIONS&#91;&#39;Target&#39;&#93;.&#39;&#34;&#62;&#39;.&#036;TITLEFONT.&#036;TITL E&#91;&#036;i&#93;.&#036;TITLEFONTCLOSE.&#39;&#60;/a&#62;&#39;.&#036;RETURN;
if &#40;&#036;OPTIONS&#91;&#39;Item Description&#39;&#93;&#41; {
echo &#036;ITEMFONT.&#036;DESCRIPTION&#91;&#036;i&#93;.&#036;ITEMFONTCLOSE.&#036;RET URN;

to this

echo &#39;&#60;b&#62;&#60;a title=&#34;Published&#58; &#39;.&#036;PUBDATE&#91;&#036;i&#93;.&#39;&#34; href=&#34;&#39;.&#036;LINK&#91;&#036;i&#93;.&#39;&#34; target=&#34;&#39;.&#036;OPTIONS&#91;&#39;Target&#39;&#93;.&#39;&#34;&#62;&#39;.&#036;TITLEFONT.&#036;TITL E&#91;&#036;i&#93;.&#036;TITLEFONTCLOSE.&#39;&#60;/a&#62;&#60;/b&#62;&#39;.&#036;RETURN;
if &#40;&#036;OPTIONS&#91;&#39;Item Description&#39;&#93;&#41; {
echo &#036;ITEMFONT.&#39;&#60;p&#62;&#39;.&#036;DESCRIPTION&#91;&#036;i&#93;.&#036;ITEMFONTCLOSE.&#036;R ETURN.&#39;&#60;/p&#62;&#39;;

You can see the plugin working with a better format over at http://www.talkdvd.net/index.php?categoryid=11

If you using Yahoo feeds i suggest you adding the following just before line 128 to sort the feed properly or your links and html won&#39;t display as they should ..

&#036;DESCRIPTION&#91;&#036;i&#93; = str_replace&#40;&#34;&#60; &#34;, &#34;&#60;&#34;, &#036;DESCRIPTION&#91;&#036;i&#93;&#41;;
&#036;LINK&#91;&#036;i&#93; = str_replace&#40;&#34; &#34;, &#34;&#34;, &#036;LINK&#91;&#036;i&#93;&#41;;

Also to make sure it parsed ALL of the yahoo feed (its a lot of XML on this one) i set the Number of articles to display: to 400 which is far more than within the RSS stream. It seems to handle it just right ...

I hope that helps someone ....

abcohen
10-16-2006, 02:33 PM
add those two lines does fix the extra space issues with this plugin.