5, December 2008

RSS feed parser script - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: RSS feed parser script
« previous next »
Pages: [1] 2 Print

Author Topic: RSS feed parser script  (Read 2558 times)
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« on: May 13, 2006, 01:01:31 PM »

hi!

can anyone point me to a rss feed parser script so i can place a few news headlines in my page where ever i want to position it?

thanks!
« Last Edit: May 13, 2006, 01:03:29 PM by vbignacio »


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: May 13, 2006, 02:55:57 PM »

hi!

can anyone point me to a rss feed parser script so i can place a few news headlines in my page where ever i want to position it?

thanks!
I use this parser: http://magpierss.sourceforge.net/ Visit through proxy


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #2 on: May 14, 2006, 01:44:27 AM »

thanks olaf! i've downloaded it already...

EDIT: there seems to be a problem with the "How do I install MagpieRSS?" link at http://laughingmeme.org/magpie_blog/?p=80 Visit through proxy and i found another "How to" link at http://programming.linux.com/article.pl?sid=05/05/24/1337210 Visit through proxy.

thanks again!
« Last Edit: May 14, 2006, 05:56:45 AM by vbignacio »


Last blog : Santiago Beach, Cebu, Philippines
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #3 on: May 14, 2006, 07:38:08 AM »

oh and one more thing, what if i want to place rss feeds from two sources in one page. is it possible? how should i do it?


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 14, 2006, 10:52:30 AM »

oh and one more thing, what if i want to place rss feeds from two sources in one page. is it possible? how should i do it?
yes of course, you have to give the object a diff. name.
Don't be worry about the the problem  you posted, check that the rss feeds are valid and then it have to work without problems. (I use magpie in more than 20 projects without trouble)


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #5 on: May 14, 2006, 10:59:52 AM »

"yes of course, you have to give the object a diff. name."

sorry but can you please give me an example on how to do it?


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: May 14, 2006, 11:28:24 AM »

"yes of course, you have to give the object a diff. name."

sorry but can you please give me an example on how to do it?

This is an example from my site:
Code:
    <?php 
  $rss2 fetch_rss("http://www.weberdev.com/RSS/LatestExamples.xml");
  $first10 0;
  foreach ($rss2->items as $item2) {
     $title2 $item2['title'];
     $url2 htmlspecialchars($item2['link'], ENT_QUOTES);
  if ($first10 10) {
  echo "<li><a href=\"".$url2."\" target=\"_blank\">".substr_words($title250)."</a></li>\n";
  $first10++;
  }
  } // end foreach 
  ?>



note the va $rss2, just change that name for diff. objects


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #7 on: May 14, 2006, 11:35:01 AM »

so i will just change the va $rss into $rss2 for the second feed, $rss3 for the third feed, and so on?


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: May 14, 2006, 02:55:50 PM »

so i will just change the va $rss into $rss2 for the second feed, $rss3 for the third feed, and so on?
yes


Last blog : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8272
42619 credits
Members referred : 3



« Reply #9 on: May 14, 2006, 05:04:19 PM »

Or do something like this?

Code:
<?php 
$feeds 
= array ( "http://www.weberdev.com/RSS/LatestExamples.xml""http://......" );
foreach ( 
$feeds as $feed_url )
{
  
$rss2 fetch_rss$feed_url );
  
$first10 0;
  foreach (
$rss2->items as $item2) {
     
$title2 $item2['title'];
     
$url2 htmlspecialchars($item2['link'], ENT_QUOTES);
  if (
$first10 10) {
  echo 
"<li><a href=\"".$url2."\" target=\"_blank\">".substr_words($title250)."</a></li>\n";
  
$first10++;
  }
  } 
// end foreach 

 
?>


This will propably work with as many feeds as you like to.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: May 14, 2006, 06:30:17 PM »

Quote
This will propably work with as many feeds as you like to.

yes if you show only one (diff.) feed at a time...


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #11 on: May 15, 2006, 06:28:40 AM »

for the benefit of those who are also asking the same question as mine, i found this page which i think is also relevant to this thread:

http://sourceforge.net/mailarchive/forum.php?thread_id=1931151&forum_id=12796 Visit through proxy

thanks guys for all your help...


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: May 15, 2006, 07:48:16 AM »

for the benefit of those who are also asking the same question as mine, i found this page which i think is also relevant to this thread:

http://sourceforge.net/mailarchive/forum.php?thread_id=1931151&forum_id=12796 Visit through proxy

thanks guys for all your help...


that was my first answer...
« Last Edit: May 15, 2006, 12:14:31 PM by olaf »


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #13 on: May 15, 2006, 12:10:09 PM »

yes it was your first answer olaf. actually i made it work because of your reply. i just thought i'd add the link to make this thread more informative.


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: May 15, 2006, 12:18:45 PM »

yes it was your first answer olaf. actually i made it work because of your reply. i just thought i'd add the link to make this thread more informative.

right why not Wink but your problem was more about using php objects then parsing a rss file...


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #15 on: May 15, 2006, 12:29:00 PM »

just shooting two birds with one stone... he he he


Last blog : Santiago Beach, Cebu, Philippines
My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« Reply #16 on: May 20, 2006, 06:47:30 AM »

You can find tons of free scripts who can do what you are asking for at hotscripts.com
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #17 on: May 20, 2006, 11:33:57 AM »

why do you have to go there when you have friends here that you can ask?


Last blog : Santiago Beach, Cebu, Philippines
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #18 on: Jun 10, 2006, 12:07:52 AM »

hi,

its me again with another one.

how should i call an rss feed for images in my page using magpie?


Last blog : Santiago Beach, Cebu, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6487
39754 credits
Members referred : 374


It's time to use PHP5!


« Reply #19 on: Jun 10, 2006, 10:05:01 AM »

hi,

its me again with another one.

how should i call an rss feed for images in my page using magpie?

check the feed first to knoe that's a valid feed:
http://feedvalidator.org/ Visit through proxy


Last blog : Just a better Internet portal provided by Google
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2496
Tags : php yahoo rss Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] 2 Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: RSS feed parser script
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Dec 05, 2008, 07:11:39 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 38.003
Total Topics: 7.685
Total Members: 4.472
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: xeroxss

38 Guests, 3 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.