Hi.
I'm getting a parser error on my XML feed from YouTube's friend activity feed.
The error I am recieving is:
Quote:
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 1: parser error : Premature end of data in tag feed line 1 in /media/morpheus/yasn/includes/youtube.php on line 86
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: x>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage> in /media/morpheus/yasn/includes/youtube.php on line 86
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /media/morpheus/yasn/includes/youtube.php on line 86
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /media/morpheus/yasn/includes/youtube.php:86 Stack trace: #0 /media/morpheus/yasn/includes/youtube.php(86): SimpleXMLElement->__construct('<feed xmlns='ht...') #1 /media/morpheus/yasn/stream_test.php(70): YouTube->get_friends_activity() #2 {main} thrown in /media/morpheus/yasn/includes/youtube.php on line 86
|
The content of the XML feed is: (spaced out so easier to read)
HTML Code:
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/'
xmlns:gd='http://schemas.google.com/g/2005'
gd:etag='W/"DUQHQXs6cCp7ImA9WxJUF0k."'>
<id>
tag:youtube.com,2008:user:amalcontentiwilson:friendsactivity</id>
<updated>2009-07-16T05:28:50.518-07:00</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://gdata.youtube.com/schemas/2007#userEvent' />
<title>Activity of the friends of amalcontentiwilson</title>
<logo>
http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity' />
<link rel='http://schemas.google.com/g/2005#batch'
type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity/batch' />
<link rel='self' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity?start-index=1&max-results=25' />
<link rel='service' type='application/atomsvc+xml'
href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity?alt=atom-service' />
<author>
<name>YouTube</name>
<uri>http://www.youtube.com/</uri>
</author>
<generator version='2.0' uri='http://gdata.youtube.com/'>YouTube
data API</generator>
<openSearch:totalResults>0</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
</feed>
Could someone help me to see why this is not valid and how to solve the problem?
Thanks.
|