I couldn't get your code to work (simpleXML errors) but this does: Thanks
Peter. $username="netlatch";
$password="**********";
    $curl = curl_init();
    curl_setopt ($curl, CURLOPT_URL, "
http://twitter.com/users/show/$username.json";);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, $username.":".$password);
    $result = curl_exec ($curl);
$result = json_decode($result);
    curl_close ($curl);
echo "<pre>";
print_r($result);
echo "</pre>";

On Mon, Jan 5, 2009 at 2:40 PM, Peter Denton <petermden...@gmail.com> wrote:

> Here is what I use. Can you juse use XML?
>
>     $username = 'yourusername';
>     $password = 'yourpassword';
>
>     $host = "http://twitter.com/users/show/$businessUser.xml";;
>     $ch = curl_init();
>     curl_setopt($ch, CURLOPT_URL, $host);
>     curl_setopt($ch, CURLOPT_VERBOSE, 1);
>     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>     curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
>     curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
>     curl_setopt($ch, CURLOPT_POST, 1);
>     $result = curl_exec($ch);
>     curl_close($ch);
>     $xml = new SimpleXMLElement($result);
>
>
> On Mon, Jan 5, 2009 at 11:38 AM, Pete Wingard <petewing...@gmail.com>wrote:
>
>> I've been at it for two days. I generally don't ask for much help but
>> based on your response I shouldn't ask for anymore. I suppose no one ever
>> helped you a time or two. Thanks for the bone.
>>
>> On Mon, Jan 5, 2009 at 2:12 PM, Stuart <stut...@gmail.com> wrote:
>>
>>>
>>> Debugging 101...
>>>
>>> 2009/1/5 Pete Wingard <petewing...@gmail.com>:
>>> > I have this cURL
>>> >        function get_tweets(){
>>> >        // create a new cURL resource
>>> >        $ch = curl_init();
>>> > $user = "netlatch";
>>> >        $pass = "************";
>>> >        // set URL and other appropriate options
>>> >        // $user:$pass http://twitter.com/statuses/replies.json
>>> >        curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
>>> >        curl_setopt($ch, CURLOPT_URL,
>>> > "http://twitter.com/users/show/netlatch.json";);
>>> >        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,2);
>>> >        // grab URL and pass it to the browser
>>> >        $input = curl_exec($ch);
>>>
>>> var_dump($input);
>>>
>>> >        $val = json_decode($input);
>>>
>>> var_dump($val);
>>>
>>> >        $output = $val->{"text"};
>>>
>>> var_dump($output);
>>>
>>> >        // close cURL resource, and free up system resources
>>> >        curl_close($ch);
>>> >        return $output;
>>> > }
>>> > $array=get_tweets();
>>> > but I get nothing in the $array. It dumps the content on the page
>>> though. If
>>> > I use this w/o a username and password I get an error of too many
>>> requests.
>>> > What am I doing wrong?
>>>
>>> You're not doing basic legwork before asking for help. However, I'm
>>> gonna throw you a bone. Read up on the CURLOPT_RETURNTRANSFER option -
>>> that's what you're missing.
>>>
>>> -Stuart
>>>
>>> --
>>> http://stut.net/
>>>
>>
>>
>>
>> --
>> Pete Wingard
>>
>> Krumlr.Com
>> MudSweatAndTears.Com
>> PixelCast.Net
>> TigerTailST.Com
>> & Yougler.Com
>>
>> you can follow on Twitter
>> http://www.twitter.com/krumlr
>>
>> Decatur, GA
>> 404.797.1646
>> http://yougler.com/pete
>> netla...@gmail.com
>>
>
>


-- 
Pete Wingard

Krumlr.Com
MudSweatAndTears.Com
PixelCast.Net
TigerTailST.Com
& Yougler.Com

you can follow on Twitter
http://www.twitter.com/krumlr

Decatur, GA
404.797.1646
http://yougler.com/pete
netla...@gmail.com

Reply via email to