28, May 2012

RSS feed parser script - webmaster forum

 
Webdigity webmaster forums
[ 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
Instabuck - The easy way to sell digital products online

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


Philippine Beaches


« on: May 13, 2006, 12: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, 12:03:29 pm by vbignacio »


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: May 13, 2006, 01: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/

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #2 on: May 14, 2006, 12: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 and i found another "How to" link at http://programming.linux.com/article.pl?sid=05/05/24/1337210.

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


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


Philippine Beaches


« Reply #3 on: May 14, 2006, 06: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 : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 14, 2006, 09: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)

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #5 on: May 14, 2006, 09: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 : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: May 14, 2006, 10: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

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #7 on: May 14, 2006, 10: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 : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: May 14, 2006, 01: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

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #9 on: May 14, 2006, 04: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: May 14, 2006, 05: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...

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #11 on: May 15, 2006, 05: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

thanks guys for all your help...


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: May 15, 2006, 06: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

thanks guys for all your help...


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

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #13 on: May 15, 2006, 11:10:09 am »

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 : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: May 15, 2006, 11:18:45 am »

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

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #15 on: May 15, 2006, 11:29:00 am »

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


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


« Reply #16 on: May 20, 2006, 05: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, 10:33:57 am »

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


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


Philippine Beaches


« Reply #18 on: Jun 09, 2006, 11:07:52 pm »

hi,

its me again with another one.

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


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #19 on: Jun 10, 2006, 09: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/

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

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?
May 28, 2012, 11:08:12 am





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!






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