How are you showing $query? If you're just doing print $query in a browser,
the XML wouldn't show up in the window. You could either set the
Content-type: text/plain before outputting $query, or by checking view
source.

On Tue, Oct 13, 2009 at 22:37, ArnieLapinig <arnie.lapi...@gmail.com> 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<http://twitter.com/users/show.xml?%0Ascreen_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<http://twitter.com/users/show.xml?%0Ascreen_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...
>
>


-- 
Internets. Serious business.

Reply via email to