Jump to content

xymalf

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

xymalf's Achievements

Member

Member (2/5)

0

Reputation

  1. I tried to develop a simple HTML page Facebook app on my web site. I got the message SECURE BROWSING NOT SUPPORTED when i typed in the apps url eg http://apps.facebook.com/appname I asked my Web host to provide SSL which they did but this was shared SSL so I still got the error message. My Question is how do you develop apps now for Facebook ?
  2. I just want pictures of all the users under headings - followers, following, mutuals etc.
  3. 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?
  4. $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.
  5. I am trying to authenticate a PHP site using OAuth library and my site is connecting to twitter but the PHP program is saying can't authenticate the Auth. I am lost at what is wrong. the page is http://www.xymalf.co.uk/firstcall.php this connects to a php program called connect which connects to twitter. the callback is callback.php but this stage is not being reached. This is the code for the twitter OAuth and engine. <?php /* * Abraham Williams ([email protected]) http://abrah.am * * The first PHP Library to support OAuth for Twitter's REST API. */ /* Load OAuth lib. You can find it at http://oauth.net */ require_once('OAuth.php'); /** * Twitter OAuth class */ class TwitterOAuth { /* Contains the last HTTP status code returned. */ public $http_code; /* Contains the last API call. */ public $url; /* Set up the API root URL. */ public $host = "https://api.twitter.com/1/"; /* Set timeout default. */ public $timeout = 30; /* Set connect timeout. */ public $connecttimeout = 30; /* Verify SSL Cert. */ public $ssl_verifypeer = FALSE; /* Respons format. */ public $format = 'xml'; /* Decode returned json data. */ public $decode_json = TRUE; /* Contains the last HTTP headers returned. */ public $http_info; /* Set the useragnet. */ public $useragent = 'TwitterOAuth v0.2.0-beta2'; /* Immediately retry the API call if the response was not successful. */ //public $retry = TRUE; /** * Set API URLS */ function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; } function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; } function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; } function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; } /** * Debug helpers */ function lastStatusCode() { return $this->http_status; } function lastAPICall() { return $this->last_api_call; } /** * construct TwitterOAuth object */ function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) { $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); if (!empty($oauth_token) && !empty($oauth_token_secret)) { $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret); } else { $this->token = NULL; } } /** * Get a request_token from Twitter * * @returns a key/value array containing oauth_token and oauth_token_secret */ function getRequestToken($oauth_callback = NULL) { $parameters = array(); if (!empty($oauth_callback)) { $parameters['oauth_callback'] = $oauth_callback; } $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters); $token = OAuthUtil::parse_parameters($request); $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } /** * Get the authorize URL * * @returns a string */ function getAuthorizeURL($token, $sign_in_with_twitter = TRUE) { if (is_array($token)) { $token = $token['oauth_token']; } if (empty($sign_in_with_twitter)) { return $this->authorizeURL() . "?oauth_token={$token}"; } else { return $this->authenticateURL() . "?oauth_token={$token}"; } } /** * Exchange request token and secret for an access token and * secret, to sign API calls. * * @returns array("oauth_token" => "the-access-token", * "oauth_token_secret" => "the-access-secret", * "user_id" => "9436992", * "screen_name" => "abraham") */ function getAccessToken($oauth_verifier = FALSE) { $parameters = array(); if (!empty($oauth_verifier)) { $parameters['oauth_verifier'] = $oauth_verifier; } $request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters); $token = OAuthUtil::parse_parameters($request); $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } /** * One time exchange of username and password for access token and secret. * * @returns array("oauth_token" => "the-access-token", * "oauth_token_secret" => "the-access-secret", * "user_id" => "9436992", * "screen_name" => "abraham", * "x_auth_expires" => "0") */ function getXAuthToken($username, $password) { $parameters = array(); $parameters['x_auth_username'] = $username; $parameters['x_auth_password'] = $password; $parameters['x_auth_mode'] = 'client_auth'; $request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters); $token = OAuthUtil::parse_parameters($request); $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); return $token; } /** * GET wrapper for oAuthRequest. */ function get($url, $parameters = array()) { $response = $this->oAuthRequest($url, 'GET', $parameters); if ($this->format === 'json' && $this->decode_json) { return json_decode($response); } return $response; } /** * POST wrapper for oAuthRequest. */ function post($url, $parameters = array()) { $response = $this->oAuthRequest($url, 'POST', $parameters); if ($this->format === 'json' && $this->decode_json) { return json_decode($response); } return $response; } /** * DELETE wrapper for oAuthReqeust. */ function delete($url, $parameters = array()) { $response = $this->oAuthRequest($url, 'DELETE', $parameters); if ($this->format === 'json' && $this->decode_json) { return json_decode($response); } return $response; } /** * Format and sign an OAuth / API request */ function oAuthRequest($url, $method, $parameters) { if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) { $url = "{$this->host}{$url}"; } $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters); $request->sign_request($this->sha1_method, $this->consumer, $this->token); switch ($method) { case 'GET': return $this->http($request->to_url(), 'GET'); default: return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata()); } } /** * Make an HTTP request * * @return API results */ function http($url, $method, $postfields = NULL) { $this->http_info = array(); $ci = curl_init(); /* Curl settings */ curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent); curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout); curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout); curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer); curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader')); curl_setopt($ci, CURLOPT_HEADER, FALSE); switch ($method) { case 'POST': curl_setopt($ci, CURLOPT_POST, TRUE); if (!empty($postfields)) { curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); } break; case 'DELETE': curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE'); if (!empty($postfields)) { $url = "{$url}?{$postfields}"; } } curl_setopt($ci, CURLOPT_URL, $url); $response = curl_exec($ci); $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE); $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); $this->url = $url; curl_close ($ci); return $response; } /** * Get the header info to store. */ function getHeader($ch, $header) { $i = strpos($header, ':'); if (!empty($i)) { $key = str_replace('-', '_', strtolower(substr($header, 0, $i))); $value = trim(substr($header, $i + 2)); $this->http_header[$key] = $value; } return strlen($header); } ################## new code ################# function getHomeTimeline($format, $id=NULL, $count=60, $since = NULL) { if ($id !=NULL) { $api_call = sprintf("statuses/home_timeline/%s.%s", $id, $format); } else { $api_call = sprintf("statuses/home_timeline.%s", $format); return $this ->get($api_call); } } function getUsersTimeline ($format, $id = NULL , $since =NULL) { if ($id != NULL) { $api_call = sprintf("statuses/user_timeline/%s.%s", $id, $format); } else { $api_call = sprintf("statuses/user_timeline.%s", $format); } if ($since != NULL){ $api_call .=sprintf("?since=%s", urlencode($since)); } return $this->get($api_call); } }### last bracket
  6. <?php include 'EpiCurl.php'; include 'EpiOAuth.php'; include 'EpiTwitter.php'; include 'secret.php'; $twitterObj = new EpiTwitter($consumer_key, $consumer_secret); $twitterObj->setToken($_GET['oauth_token']); $token = $twitterObj->getAccessToken(); $twitterObj->setToken($token->oauth_token, $token->oauth_token_secret); // save to cookies setcookie('oauth_token', $token->oauth_token); setcookie('oauth_token_secret', $token->oauth_token_secret); $twitterInfo= $twitterObj->get_accountVerify_credentials(); echo "<h1>Your twitter username is {$twitterInfo->screen_name} and your profile picture is <img src=\"{$twitterInfo->profile_image_url}\"></h1> <p><a href=\"random.php\">Go to another page and load your friends list from your cookie</p>"; ?> How do I add extra code to display who the twitter user is following and who follows him and their pictures?
  7. I have uploaded all the phpFlickr files into a directory called phpflickr on my server. here is my code to request a token. <?php $api_key = '56aa3435b13d0e377f*********'; $secret = '3a6b257*****'; $callback = "http://www.xymalf.co.uk/phpflickr/getOauthToken.php"; $f = new phpFlickr($api_key,$secret); $f ->getRequestToken($callback); ?> getOauthToken has been set up on Flickr as the call back page but when I run above i just get a blank page. my getOauthToken page is... <?php $api_key = '56aa3435b13d0e3'; $secret = '3a6b'; $f = new phpFlickr ($api_key, $secret )); $f-> getAccessToken(); $OauthToken = $f-> getOauthToken(); $OauthSecretToken = $f-> getOauthSecretToken(); finduser(); phpFlickr.php is in the same directory as all my files.
  8. $f = newphpFlickr(56aa3435b13d0e377f4d93,$3******); $f ->getRequestToken($callback); this should get a token and i have set the callback url to the folowing page below. <?php $f = newphpFlickr ($56aa3435b13d0e377f, $3a6b257 )); $f-> getAccessToken(); $OauthToken = $f-> getOauthToken(); $OauthSecretToken = $f-> getOauthSecretToken(); include ('finduser.php');
  9. What code do i need to add for any flickr user?
  10. code/ <?php include_once 'Phlickr/Api.php'; /** * I wrote this script because it's a real pain in the ass to generate the * authorization tokens. Hopefully this will make it a little easier. * * @version $Id$ * @author Andrew Morton <[email protected]> * @license http://opensource.org/licenses/lgpl-license.php * GNU Lesser General Public License, Version 2.1 */ print "This script will help you retrieve a Flickr authorization token.\n\n"; // Prevent PHP from enforcing a time limit on this script set_time_limit(0); // Get the user's API key and secret. print 'API Key: '; $api_key = trim(fgets(STDIN)); print 'API Secret: '; $api_secret = trim(fgets(STDIN)); // Create an API object, then request a frob. $api = new Phlickr_Api($api_key, $api_secret); $frob = $api->requestFrob(); print "Got a frob: $frob\n"; // Find out the desired permissions. print 'Permissions (read, write, or delete): '; $perms = trim(fgets(STDIN)); // Build the authentication URL. $url = $api->buildAuthUrl($perms, $frob); print "\nOpen the following URL in your browser and and authorize:\n$url\n\n"; print "Press return when you're finished...\n"; fgets(STDIN); // After they've granted permission, convert the frob to a token. $token = $api->setAuthTokenFromFrob($frob); // Print out the token. print "Auth token: $token\n"; // Optionally, create a config file. print 'Save these settings? (y/N): '; $saveit = strtolower(trim(fgets(STDIN))); if ($saveit{0} == 'y') { print 'Filename: '; $filename = trim(fgets(STDIN)); print "Saving settings to '$filename'\n"; $api->saveAs($filename); print "Use this with Phlickr_Api::createFrom() to create an object.\n"; } exit(0); ?> \code
  11. xymalf

    PEAR

    How do you install PEAR on a local machine and on a server?
  12. Does anyone know a web site that provides an API kit for flickr that works? tried phpflickr that didn't work. I am seeking the auth and gettoken functions.
  13. i am running a php program that gets the access token from flickr - trouble is you have to type in a long url the php script gives you when your run it. the php is running on my pc.
  14. set_time_limit(0); I am trying to run a php program using command prompt but i am getting a 75 second time out error despite having the above line in my code.
  15. How would I write the code in PHP to display Twitter Followers, Following and Mutuals. I want a profile picture of each twitter user and the ability to click through to that user.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.