2009-09-21 11 views
5

में oauth कुंजी से उपयोगकर्ता नाम कैसे प्राप्त करें मैं ट्विटर के ओथ के साथ काम कर रहा हूं, और एक अजीब समस्या में चला जाता हूं।ट्विटर

मैं अपने टोकन और गुप्त का उपयोग कर उपयोगकर्ता की प्रोफाइल जानकारी कैसे प्राप्त करूं?

यहाँ im अब का उपयोग कर

function OauthGetProfile($consumerkey, $consumersecret, $oauthtoken, $oauthsecret){ 

$to = new TwitterOAuth($consumerkey, $consumersecret, $oauthtoken, $oauthsecret); 
$content = $to->OAuthRequest('http://twitter.com/statuses/user_timeline.xml', array('count' => '50'), 'GET'); 

return $content; 
} 

इम नहीं यकीन है कि यह कैसे प्राप्त करने के लिए, एपीआई अपने प्रोफ़ाइल प्राप्त करने के लिए आप व्यक्तियों प्रोफ़ाइल निर्दिष्ट की आवश्यकता होती है, जो मैं करने के लिए अपने आईडी की जरूरत है कहता है।

उत्तर

1

मैं अब लगता है कि आप यूआरएल "http://api.twitter.com/1/account/verify_credentials.xml" का उपयोग करना चाहिए क्योंकि बिना यूआरएल "एपीआई।" अब काम नहीं करेगा

परिणाम तरह होगा एक्सएमएल नीचे

<?xml version="1.0" encoding="UTF-8"?> 
<user> 
    <id>622181643</id> 
    <name>ddMobile</name> 
    <screen_name>fff screen_name</screen_name> 
    <location></location> 
    <description></description> 
    <profile_image_url>http://a0.twimg.com/profile_images/6456456/qxuz5r09e1x9ri5cadv5_normal.jpeg</profile_image_url> 
    <profile_image_url_https>https://si0.twimg.com/profile_images/45645645/qxuz5r09e1x9ri5cadv5_normal.jpeg</profile_image_url_https> 
    <url></url> 
    <protected>false</protected> 
    <followers_count>2</followers_count> 
    <profile_background_color>C0DEED</profile_background_color> 
    <profile_text_color>333333</profile_text_color> 
    <profile_link_color>0084B4</profile_link_color> 
    <profile_sidebar_fill_color>DDEEF6</profile_sidebar_fill_color> 
    <profile_sidebar_border_color>C0DEED</profile_sidebar_border_color> 
    <friends_count>3</friends_count> 
    <created_at>Fri Jun 29 19:44:37 +0000 2012</created_at> 
    <favourites_count>0</favourites_count> 
    <utc_offset>-14400</utc_offset> 
    <time_zone>Atlantic Time (Canada)</time_zone> 
    <profile_background_image_url>http://a0.twimg.com/i6ages/themes/theme1/bg.png</profile_background_image_url> 
    <profile_background_image_url_https>https://si0.twimg.com/ima6es/themes/theme1/bg.png</profile_background_image_url_https> 
    <profile_background_tile>false</profile_background_tile> 
    <profile_use_background_image>true</profile_use_background_image> 
    <notifications>false</notifications> 
    <geo_enabled>false</geo_enabled> 
    <verified>false</verified> 
    <following>false</following> 
    <statuses_count>8</statuses_count> 
    <lang>en</lang> 
    <contributors_enabled>false</contributors_enabled> 
    <follow_request_sent>false</follow_request_sent> 
    <listed_count>0</listed_count> 
    <default_profile>true</default_profile> 
    <default_profile_image>false</default_profile_image> 
    <is_translator>false</is_translator> 
    <status> 
    <created_at>Wed Sep 05 20:33:56 +0000 2012</created_at> 
    <id>24344689170516</id> 
    <text>Hap6the last day of our $0 handset sale! http://t.co/iAjai6ye</text> 
    <source>&lt;a href=&quot;http://te6ot; rel=&quot;nofollow&quot;&gt;Wind Mobile Self Care - SIT&lt;/a&gt;</source> 
    <truncated>false</truncated> 
    <favorited>false</favorited> 
    <in_reply_to_status_id></in_reply_to_status_id> 
    <in_reply_to_user_id></in_reply_to_user_id> 
    <in_reply_to_screen_name></in_reply_to_screen_name> 
    <retweet_count>0</retweet_count> 
    <retweeted>false</retweeted> 
    <geo/> 
    <coordinates/> 
    <place/> 
    <possibly_sensitive>false</possibly_sensitive> 
    <contributors/> 
    </status> 
</user> 

संदर्भ: http://twitterapi.pbworks.com/w/page/22554689/Twitter%20REST%20API%20Method%3A%20account%C2%A0verify_credentials

संबंधित मुद्दे