Hi, I am trying to create a social timeline. I pull in feeds form certain places so I have a timeline of thing I have done. The problem I am having is with Google reader Shared Items.
I want to get the time at which I shared the item which is contained in <entry gr:crawl-timestamp-msec="1269088723811">
Trying to get the element using $date = $xml->entry[$i]->link->attributes()->gr:crawl-timestamp-msec;
fails because of the : after gr which causes a PHP error. I could figure out how to get the element, so thought I would change the name using the code below but it throws the following error
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "<?xml version="1.0"?><feed xmlns:idx="urn:atom-extension:indexing" xmlns:media="http://search.yahoo.com/mrss/" xmlns
<?php
$get_feed = file_get_contents('http://www.google.com/reader/public/atom/user/03120403612393553979/state/com.google/broadcast');
$old = "gr:crawl-timestamp-msec";
$new = "timestamp";
$xml_file = str_replace($old, $new, $get_feed);
$xml = simplexml_load_file($xml_file);
$i = 0;
foreach ($xml->entry as $value)
{
$id = $xml->entry[$i]->id;
$date = date('Y-m-d H:i:s', strtotime($xml->entry[$i]->attributes()->timestamp ));
$text = $xml->entry[$i]->title;
$link = $xml->entry[$i]->link->attributes()->href;
$source = "googleshared";
echo "date = $date<br />";
$sql="INSERT IGNORE INTO timeline (id,date,text,link, source) VALUES ('$id', '$date', '$text', '$link', '$source')";
mysql_query($sql);
$i++;
}`
Could someone point me in the right direction please.
Cheers
Craig