homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
How to use MagpieRSS and Read Feed URL from mySQL database?
How to use MagpieRSS and Read Feed URL from mySQL database?
BlogMalaysia




msg:3595430
 2:43 am on Mar 9, 2008 (gmt 0)

I am currently using MagpieRSS on my site to read feed from my members' blog (they submit the feed URL).

All members' feed URL is storing in the mySQL database from the field "FEEDRSS". Some are empty.

I would like to create a page that use MagpieRSS to read all the feed URL from "FEEDRSS" and listed down all the new posts, is it possible?

Thank you very much for helping!

 

BlogMalaysia




msg:3595450
 3:21 am on Mar 9, 2008 (gmt 0)

Below is the PHP codes that I use to read RSS using Magpie. How can I code to read all the URLs in the database and sort the posts as according to date?

{php}
//Include our magpie functions
require_once('magpierss/rss_fetch.inc');

//define our cache directory so we can cache the feed
define('MAGPIE_CACHE_DIR', 'cache/');

//set up our URL..much simplified in this case
$url = $this->get_template_vars('RSSFEED');

//get our feed
$rss = fetch_rss( $url );
$num_items = 5;

$rss->items = array_slice($rss->items, 0, $num_items);
//If we got a feed, let's process it
if ( $rss ) {
//Loop through all the items in the feed...
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$desc= strip_tags($item['description']);

if (strlen($desc) >= 256)
{
$desc = substr($desc,0,255)." [...]";
}
//And print them
echo "<b><a href=$href>$title</a></b><br/>$desc<br/><br/>";
}
}
{/php}

BlogMalaysia




msg:3595516
 8:55 am on Mar 9, 2008 (gmt 0)

Currently I am already using Magpierss to read individual rss url from database, which you can see at:

<snip>

However, I can only read ONE rss url (one website).

I want to read ALL URLs and parse the output into a page, sort via post date.

[edited by: werty at 6:44 pm (utc) on Mar. 9, 2008]
[edit reason] Removed URL, please see TOS #13 [/edit]

bill




msg:3595864
 12:29 am on Mar 10, 2008 (gmt 0)

For very specific Magpie questions like this have you checked through the mailing list that they provide for support?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved