1

I've spent ages on this, all I'm trying to do is extract the "title" contents from an rss feed, everything else can be ignored. I've looked into simplepie, magpie and all that stuff, but I feel its kind of overkill for what I need to do. I realise there are google gadgets that are made that can do this, but I didn't want all the google logo stuff, and I wanted to personally make this.

theres a whole bunch of unneeded tags thats coming in from the rss feed all I need is the title tag, it looks like this <title> My Title 3.0 </title>

My server has PHP 5+ so I know I can use some of these simple xml functions which look promising.

so far I've got

<?php $blogfeed = file_get_contents("http://myblog.blogspot.com/feeds/posts/default?alt=rss"); echo $blogfeed; ?>

And it gives me all the data, I was thinking of running through it with strpos and searching for <title> but is there any easier way to do this??

Thanks alot!

Doug Molineux
  • 12,283
  • 25
  • 92
  • 144
  • There are a LOT of questions concerning parsing rss in PHP here in stackoverflow. See for example http://stackoverflow.com/questions/2681866/xml-rss-feed-parse-php, http://stackoverflow.com/questions/250679/best-way-to-parse-rss-atom-feeds-with-php, and others. No need for a new question imho. – Wrikken Jun 17 '10 at 18:43
  • O ok well sorry to waste your time, perhaps you could just skip over these questions, IMHO, I'll look into these other questions – Doug Molineux Jun 17 '10 at 18:58

1 Answers1

1


`

"; print_r($xml); echo "
"; echo "
title:".$xml->channel->item->title; //echo "Title: ".$xml[title]; ?>

`

Doug Molineux
  • 12,283
  • 25
  • 92
  • 144