I just ran your exact code, and was able to pull an xml string just fine, so I do not believe it is your code. The only thing I can think is you may want to curl_close() the connection, perhaps there is some caching or other similar thing in effect, though that is a big long shot.


Maybe try curl on the command line, on the same host, and see what your results are, if that works, you can start looking at your code, otherwise, it may just be an temporary glitch in the API.

You may want to look into doing some more testing in your command though, return the headers, and look at the http responses, so you know when you have a 200 ok one, versus some of the others, in which case you will want to be abel to gracefully degrade your application in some way.

Sorry I could not be of more help.
--
Scott * If you contact me off list replace talklists@ with scott@ *

On Oct 13, 2009, at 9:37 PM, ArnieLapinig wrote:


Hello,

I hope someone can help.... my query with the REST API /users/show.xml
doesn't seem to be returning an xml string...

I'm getting strange data back from my query. Here's the code:

                $twitterHost = 'http://twitter.com/users/show.xml?
screen_name=' . urlencode($lookforname);

                $curl = curl_init();

                curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
                curl_setopt($curl, CURLOPT_HEADER, false);
                curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($curl, CURLOPT_USERPWD, "$username:
$password");
                curl_setopt($curl, CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_1_1);
                curl_setopt($curl, CURLOPT_URL, $twitterHost);

                $query = curl_exec($curl);

and here's what i'm getting:


$twitterHost        string(59) "http://twitter.com/users/show.xml?
screen_name=mandarine_one"

$query

string(2023) " 32432559 anton mandarine_one Neuburg an der Donau
Mediengestalter, Nerd, Comic- und Musikliebhaber, nörgelt gerne über
die Arbeit. http://a3.twimg.com/profile_images/435301043/twitter_normal.jpg
http://www.grizzlyfear.de false 159 EBEBEB 333333 990000 F3F3F3 DFDFDF
238 Fri Apr 17 14:49:15 +0000 2009 23 3600 Berlin
http://a1.twimg.com/profile_background_images/41257908/8edd7_014-sergeypoluse.jpg
true 2129 false false false false Tue Oct 13 17:19:41 +0000 2009
4839657896 @_Schnucki_ madame sie gruseln mir die scheisse aus dem
leid. du schreibst von stromschlag und bei mir geht das licht aus
#scary <a target='_blank' href="http://www.atebits.com/";
rel="nofollow">Tweetie</a> false 4839540863 50962463 false _Schnucki_
"

when i paste "http://twitter.com/users/show.xml?
screen_name=mandarine_one" into the browser, i get an xml string:

<user>
<id>32432559</id>
<name>anton</name>
<screen_name>mandarine_one</screen_name>
<location>Neuburg an der Donau</location>
<description>
Mediengestalter, Nerd, Comic- und Musikliebhaber, nörgelt gerne über
die Arbeit.
</description>
<profile_image_url>
http://a3.twimg.com/profile_images/435301043/twitter_normal.jpg
</profile_image_url>
<url>http://www.grizzlyfear.de</url>
<protected>false</protected>
etc etc etc etc...

Am I making some sort of basic mistake?

Thanks for helping...

Reply via email to