Jump to content

ddeile

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ddeile's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Solved the issue.  Thanks printf - I would have saved myself alot of time if I had used die ( mysql_error () ). 
  2. Hi, I've been working on a personal aggreagator project using php5's simpleXml api.  Everything is working as expected except on one feed that I am parsing and entering into my database.  The data in the <description> tags is not being sent to the database, nor am getting any mysql or php errors.  Addionally, I can send the data in the <description> tags to the screen with no issues. Below is simplified version of my existing code. This works fine for any rss 2.0 feed that I have tried to parse.  All except for feeds from engadet.com. [code] .....after connecting to database..... $thisXml = simplexml_load_file("http://hdtv.engadget.com/rss.xml");         foreach($thisXml->channel->item as $item) {     $date = date('Y-m-d h:i:s', strtotime($item->pubDate)); $query = mysql_db_query('feeds', "INSERT into feed_content (title, link, description, date) VALUES( '$item->title', '$item->link', '$item->description', '$date')"); }        [/code] The database table `feeds` is structured as follows: [code] CREATE TABLE `feeds`.`feed_content` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT , `title` varchar( 255 ) NOT NULL , `link` varchar( 255 ) NOT NULL , `description` text NOT NULL , `date` datetime NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = InnoDB DEFAULT CHARSET = latin1; [/code] What is interesting is that if I shorten $item->description by: [code] $description = substr($item->description,0,500); [/code] the data gets inserted into the table. But I wan't the entire <description> data inserted. Any idea what is going on?  Again, I am not receiving any errors when this runs.
  3. Thanks Barand.  That works as well. ;D
  4. SOLVED! I forgot to echo out my $thumnail variable in my second example.  Here is the code: [code]$entries = simplexml_load_file('http://api.flickr.com/services/feeds/photos_public.gne?tags=tokyo&format=rss_200');   foreach($entries->channel->item as $feeditem) { $thumbnail = $feeditem->children('http://search.yahoo.com/mrss')->thumbnail->attributes(); echo $thumbnail[0]; }[/code]
  5. Hello, I'm new here, love the site.  Anyway, I've been trying to use the SimpleXml module to parse media rss files.  I'm creating a generic rss parser to pull the <media:thumbnail> out of rss feeds.  I've spent the last few days doing this numerous way, but have been unable to return data. Here are a few of my recent attempts: [i]Note: I'm using an rss feed from Flickr in these examples.[/i] [code] $entries = simplexml_load_file('http://api.flickr.com/services/feeds/photos_public.gne?tags=tokyo&format=rss_200'); foreach($entries->children('http://search.yahoo.com/mrss') as $item) {   echo $item->thumbnail->attributes(); } [/code] and: [code] $entries = simplexml_load_file('http://api.flickr.com/services/feeds/photos_public.gne?tags=tokyo&format=rss_200');   foreach($entries->channel->item as $feeditem) { $thumbnail = $feeditem->children('http://search.yahoo.com/mrss')->thumbnail->attributes(); } [/code] and: [code] $entries = simplexml_load_file('http://api.flickr.com/services/feeds/photos_public.gne?tags=tokyo&format=rss_200');   foreach($entries->channel->item as $feeditem) { foreach ($feeditem->children('http://search.yahoo.com/mrss') as $entry)         {             echo $entry->thumbnail->attributes();         } } [/code] Can anyone offer any help or suggestions?
×
×
  • 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.