xymalf Posted August 23, 2012 Share Posted August 23, 2012 $twitterObj->setToken($_GET['oauth_token']); $token = $twitterObj->getAccessToken(); $twitterObj->setToken($token->oauth_token, $token->oauth_token_secret); $twitterInfo= $twitterObj->get_accountVerify_credentials(); $twitterInfo->response; echo "Your twitter username is {$twitterInfo->screen_name} and your profile picture is <img src=\"{$twitterInfo->profile_image_url}\">"; #### new code #### I have wrote the above simple php program to display my twitter name and photo. How do I add to the code so it will display Followed, Followers, Mutuals and their picures? I don't know how to use the screen_name variable for this. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 23, 2012 Share Posted August 23, 2012 Add print '<pre>'; print_r($twitterInfo); What gets printed? Quote Link to comment Share on other sites More sharing options...
xymalf Posted August 23, 2012 Author Share Posted August 23, 2012 Token stuff then...... [responseText] => {"id":23638744,"url":"http:\/\/xeeme.com\/adrianbonnington","statuses_count":7433,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/419516975\/twilk_background_4f3242d762664.jpg","profile_use_background_image":true,"default_profile":false,"verified":false,"profile_text_color":"333333","contributors_enabled":false,"created_at":"Tue Mar 10 19:33:29 +0000 2009","friends_count":1995,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/947242370\/3d93255b-8bd4-4bb8-b3d7-a3a01491146b_normal.png","utc_offset":0,"profile_sidebar_border_color":"86A4A6","show_all_inline_media":false,"name":"adrian bonnington","listed_count":16,"location":"UK","id_str":"23638744","profile_background_tile":true,"protected":false,"profile_sidebar_fill_color":"A0C5C7","is_translator":false,"geo_enabled":false,"follow_request_sent":false,"lang":"en","description":"unemployed electronics engineer","default_profile_image":false,"profile_background_color":"709397","screen_name":"xymalf","favourites_count":2,"time_zone":"London","notifications":false,"profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/419516975\/twilk_background_4f3242d762664.jpg","profile_link_color":"FF3300","status":{"id_str":"238667648026697728","contributors":null,"truncated":false,"created_at":"Thu Aug 23 16:02:56 +0000 2012","in_reply_to_user_id":null,"in_reply_to_status_id_str":null,"in_reply_to_screen_name":null,"retweeted":false,"possibly_sensitive":false,"in_reply_to_user_id_str":null,"coordinates":null,"in_reply_to_status_id":null,"geo":null,"source":"\u003Ca href=\"http:\/\/twitter.com\/tweetbutton\" rel=\"nofollow\"\u003ETweet Button\u003C\/a\u003E","possibly_sensitive_editable":true,"id":238667648026697728,"place":null,"retweet_count":0,"favorited":false,"text":"This is Not a Photograph: Amazing Portrait Drawn with Ballpoint Pens by Samuel Silva http:\/\/t.co\/4PkZ3rOE via @colossal"},"following":false,"profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/947242370\/3d93255b-8bd4-4bb8-b3d7-a3a01491146b_normal.png","followers_count":719} [response] => Array ( [id] => 23638744 => http://xeeme.com/adrianbonnington [statuses_count] => 7433 [profile_background_image_url_https] => https://si0.twimg.com/profile_background_images/419516975/twilk_background_4f3242d762664.jpg [profile_use_background_image] => 1 [default_profile] => [verified] => [profile_text_color] => 333333 [contributors_enabled] => [created_at] => Tue Mar 10 19:33:29 +0000 2009 [friends_count] => 1995 [profile_image_url] => http://a0.twimg.com/profile_images/947242370/3d93255b-8bd4-4bb8-b3d7-a3a01491146b_normal.png [utc_offset] => 0 [profile_sidebar_border_color] => 86A4A6 [show_all_inline_media] => [name] => adrian bonnington [listed_count] => 16 [location] => UK [id_str] => 23638744 [profile_background_tile] => 1 [protected] => [profile_sidebar_fill_color] => A0C5C7 [is_translator] => [geo_enabled] => [follow_request_sent] => [lang] => en [description] => unemployed electronics engineer [default_profile_image] => [profile_background_color] => 709397 [screen_name] => xymalf [favourites_count] => 2 [time_zone] => London [notifications] => [profile_background_image_url] => http://a0.twimg.com/profile_background_images/419516975/twilk_background_4f3242d762664.jpg [profile_link_color] => FF3300 [status] => Array ( [id_str] => 238667648026697728 [contributors] => [truncated] => [created_at] => Thu Aug 23 16:02:56 +0000 2012 [in_reply_to_user_id] => [in_reply_to_status_id_str] => [in_reply_to_screen_name] => [retweeted] => [possibly_sensitive] => [in_reply_to_user_id_str] => [coordinates] => [in_reply_to_status_id] => [geo] => [source] => Tweet Button [possibly_sensitive_editable] => 1 [id] => 238667648026697728 [place] => [retweet_count] => 0 [favorited] => [text] => This is Not a Photograph: Amazing Portrait Drawn with Ballpoint Pens by Samuel Silva http://t.co/4PkZ3rOE via @colossal ) [following] => [profile_image_url_https] => https://si0.twimg.com/profile_images/947242370/3d93255b-8bd4-4bb8-b3d7-a3a01491146b_normal.png [followers_count] => 719 ) [id] => 23638744 => http://xeeme.com/adrianbonnington [statuses_count] => 7433 [profile_background_image_url_https] => https://si0.twimg.com/profile_background_images/419516975/twilk_background_4f3242d762664.jpg [profile_use_background_image] => 1 [default_profile] => [verified] => [profile_text_color] => 333333 [contributors_enabled] => [created_at] => Tue Mar 10 19:33:29 +0000 2009 [friends_count] => 1995 [profile_image_url] => http://a0.twimg.com/profile_images/947242370/3d93255b-8bd4-4bb8-b3d7-a3a01491146b_normal.png [utc_offset] => 0 [profile_sidebar_border_color] => 86A4A6 [show_all_inline_media] => [name] => adrian bonnington [listed_count] => 16 [location] => UK [id_str] => 23638744 [profile_background_tile] => 1 [protected] => [profile_sidebar_fill_color] => A0C5C7 [is_translator] => [geo_enabled] => [follow_request_sent] => [lang] => en [description] => unemployed electronics engineer [default_profile_image] => [profile_background_color] => 709397 [screen_name] => xymalf [favourites_count] => 2 [time_zone] => London [notifications] => [profile_background_image_url] => http://a0.twimg.com/profile_background_images/419516975/twilk_background_4f3242d762664.jpg [profile_link_color] => FF3300 [status] => Array ( [id_str] => 238667648026697728 [contributors] => [truncated] => [created_at] => Thu Aug 23 16:02:56 +0000 2012 [in_reply_to_user_id] => [in_reply_to_status_id_str] => [in_reply_to_screen_name] => [retweeted] => [possibly_sensitive] => [in_reply_to_user_id_str] => [coordinates] => [in_reply_to_status_id] => [geo] => [source] => Tweet Button [possibly_sensitive_editable] => 1 [id] => 238667648026697728 [place] => [retweet_count] => 0 [favorited] => [text] => This is Not a Photograph: Amazing Portrait Drawn with Ballpoint Pens by Samuel Silva http://t.co/4PkZ3rOE via @colossal ) [following] => [profile_image_url_https] => https://si0.twimg.com/profile_images/947242370/3d93255b-8bd4-4bb8-b3d7-a3a01491146b_normal.png [followers_count] => 719 ) I don't see how i can use this info? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 23, 2012 Share Posted August 23, 2012 Well followers_count is one of the things you want. following should be the other. Mutuals is a lot harder to figure out. Unless you meant you don't want just the count but all the names? Is this a third party script that connects to Twitter to get the info? If so, you'll need to check with their docs and/or ask in third party apps. Quote Link to comment Share on other sites More sharing options...
xymalf Posted August 23, 2012 Author Share Posted August 23, 2012 I just want pictures of all the users under headings - followers, following, mutuals etc. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 23, 2012 Share Posted August 23, 2012 Is this a third party script that connects to Twitter to get the info? If so, you'll need to check with their docs and/or ask in third party apps. Quote Link to comment Share on other sites More sharing options...
codefossa Posted August 23, 2012 Share Posted August 23, 2012 Echo out the profile_image_url in img tags and you'll have the avatars. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.