1

For some reason the script I use to get the feedburner count as a string to use around my site (http://ios-blog.co.uk) has stopped working :( This is the error that it throws out:

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 2:     parser error : Opening and ending tag mismatch: meta line 1 and HEAD in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <TITLE>301 Moved</TITLE></HEAD><BODY> in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 6: parser error : Opening and ending tag mismatch: HEAD line 1 and HTML in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </BODY></HTML> in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 7: parser error : Premature end of data in tag HTML line 1 in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/connect.php on line 83

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/connect.php:83 Stack trace: #0 /home/connect.php(83): SimpleXMLElement->__construct('<HTML><HEAD><me...') #1 {main} thrown in /home/connect.php on line 83

This is the PHP that i am Using:

//get cool feedburner count
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=iosdevblog";

//Initialize the Curl session
$ch = curl_init();

//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);

//Execute the fetch
$data = curl_exec($ch);

//Close the connection
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
echo $fb;
//end get cool feedburner count

The file is large - where it says line 83 it relates to: $xml = new SimpleXMLElement($data);

Thanks for all help :)

2 Answers 2

2

Take a look here on this line

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: 301 Moved in /home/connect.php on line 83

It's giving HTTP code 301 moved.

If you visit this link

https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=iosdevblog

It's actually 404ing, there is no XML there.

Sign up to request clarification or add additional context in comments.

Comments

2

ah... the feedburner is now deprecated - thats why it suddenly stopped :( https://developers.google.com/feedburner/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.