Jump to content

Magpie RSS Help


chrziz

Recommended Posts

I am using [a href=\"http://magpierss.sourceforge.net/\" target=\"_blank\"]Magpie RSS[/a] to read an rss feed and by default it uses a feed caching system that so it only grabs the feed once an hour (or whatever time you specifty). It also has a constant that you can define to disable caching:

[code]
* CONSTANTS - redefine these in your script to change the
* behaviour of fetch_rss() currently, most options effect the cache
*
* MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects?
* For me a built in cache was essential to creating a "PHP-like"
* feel to Magpie, see rss_cache.inc for rationale
[/code]

Here's the [a href=\"http://chrziz.com/rss_cache.txt\" target=\"_blank\"]rss_cache.inc[/a] it says to refer to.

I am fairly new to php and I am trying to turn the caching off, but just for a specified script so it grabs new info every time the script is executed and not pull the cached old data.

This is what i was trying to do:
[code]
include_once('/rss/magrss/rss_fetch.inc');

define("MAGPIE_CACHE_ON", false);

$rss = fetch_rss("http://gmail.google.com/gmail/feed/atom/");

foreach ($rss->items as $item ) {
    $count++;
}

if ($count > 0) {
    $message = "$count new messages";
} else {
    $message = "No new messages.";
}

[/code]

It doesn't work and just grabs the cached page, Can someone tell me what I'm doing wrong?

Thank you
Chris
Link to comment
https://forums.phpfreaks.com/topic/10657-magpie-rss-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.