Jump to content

xymalf

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by xymalf

  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.
  16. No i am just a newbie - twitter no longer seems top accept passwords that are submitted.
  17. $form_error = 0; # Assume no errors $twitter_username = $_POST['twitter_username']; # A Twitter member account $twitter_password = $_POST['twitter_password']; # The password to Twitter $group_members = $_POST['group_members']; # The url for the RSS feed $submit_button = $_POST['submit_button']; # For validation of origin $group_members = trim($group_members); # make sure list is trimmed $twitter_username = strtolower($twitter_username); # store as lowercase $this_dir = getHTTPpath($_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI']); why won't this method of sending twitter a password now work?
  18. $root_path = str_replace("/public_html", "/uar", $_SERVER['DOCUMENT_ROOT']) ."/includes/"; include $root_path.'environment.php'; # Determine relevant paths include $root_path.'status_messages.php'; # Turn error code into message include $root_path.'validate_data.php'; # Validate application data include $root_path.'api_config.php'; # Configuring the API connection include $root_path.'parse_data.php'; # Parse XML data include $root_path.'sort_data.php'; # Sort Data include $root_path.'calculate_stats.php'; # Functions for network calculation include $root_path.'html_template.php'; # Format HTML for display /* * Initialize Values * * To use variables in the XHTML being output, first make sure the display * variables are initialized. Unless some values are found, they will remain empty. */ $app_title = 'Network Viewer'; $twitter_username = ''; $twitter_password = ''; $form_response = ''; $submit_button_label = 'Please identify yourself'; $show_message = ''; $show_info = ' style="display:none;"'; $followers = ''; $mutuals = ''; $following = ''; /* * Parse Input * * If the variables are passed to the page as a post submission, then each * of the form variables will appear in the _POST array. */ $form_error = 0; # Assume no errors $twitter_username = $_POST['twitter_username']; # A Twitter member account $twitter_password = $_POST['twitter_password']; # The password to Twitter $submit_button = $_POST['submit_button']; # For validation of origin $this_dir = getHTTPpath($_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI']); /* * Configure API Requests * * Build the URLs for each of the API requests you will need in this tool. */ list($master_username,$cURL_source) = prepAPI(); # function in api_config /* * Initiate cURL * * In this case, one cURL connection can be used and changed. This is done * largely to demonstrate the different ways to configure a cURL request. * It would be good form to create a new configuration for each type of * API request, particularly if any are to be reused. * * These options are common to all three API requests in this application. */ $cURL = prepRequest($app_title,$twitter_username,$twitter_password); /* * Validate Access * * Not all data entering the form is going to be coming from the right * source (e.g. this page) or keyed in the correct format. Before using data * it is a good idea to check it against what is expected or needed. In * cases where the data is not what is expected for this tool to work, an * error code is assigned. * * We assume no post data is present if the submit button value is empty. */ $form_error = checkInput(array( 'submit_button' => $submit_button, 'twitter_username' => $twitter_username, 'twitter_password' => $twitter_password ),$cURL,$cURL_source); # Confirm posted input is OK if ($form_error == 0) { $show_info = ''; $submit_button_label = ' Refresh Network '; # Set the submit button label /* [code] how do i change above to work with ouath as old twitter input does not seem to work.
  19. <body> <?php $root_path = str_replace('/public_html', '/uar', $_SERVER['DOCUMENT_ROOT']) .'/includes/'; include $root_path.'environment.php'; include $root_path.'status_messages.php'; include $root_path.'validate_data.php'; include $root_path.'api_config.php'; include $root_path.'parse_data.php'; include $root_path.'sort_data.php'; include $root_path.'calculate_stats.php'; include $root_path.'html_template.php'; $app_title ='Network Viewer'; $twitter_username = ''; $twitter_password = ''; $form_response = ''; $submit_button_label = 'identify yourself'; $show_message = ''; $show_info = ' style="display:none"'; $followers = ''; $mutuals = ''; $following = ''; $form_error = 0; $twitter_username = $_POST['twitter_username']; $twitter_password = $_POST['twitter_password']; $submit_button = $_POST['submit_button']; $this_dir = getHTTPpath($_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI']); list($master_username,$cURL_source) = prepAPI(); $cURL = prepRequest($app_title,$twitter_username,$twitter_password); $form_error = checkInput(array( 'submit_button' => $submit_button, 'twitter_username' => $twitter_username, 'twitter_password' => $twitter_password, ),$cURL,$cURL_source); if ($form_error == 0) { $show_info = ''; $submit_button_label = 'Refresh Network'; $user_detail= str_replace("[id]", $twitter_username, $cURL_source['show_user']); list($cURL_status, $twitter_data) = apiRequest($cURL, $user_detail); if ($cURL_status > 200) {$form_error = 14;} else { #parse the XML file try { $authors = parseXML($twitter_data); foreach ($authors as $author) { $author_id = $author['user_id']; $author_username = $author['user_name']; $author_fullname = $author['full_name']; $author_avator = $author['avator']; $author_location = $author['location']; $author_description = $author['description']; $author_url = $author['url']; $is_protected = $author['is_private']; $total_followers = $author['followers']; $total_following = $author['following']; $total_tweets = $author['tweets']; break; } $author_profile = "<a href='http://twitter.com/$author_username'>$author_fullname</a>"; $followers_pages = ciel($total_followers/100); $followers_pages = ciel($total_following/100); }catch (Exception $e) {$form_error =15; } } if ($form_error == 0) { $follow_net = array(); for ($i=1; $i <=$followers_pages; $i +=1) { $follow_net = str_replace("[id]", $twitter_username, $cURL_source['follower']); $follower_net .="?page=$i&count=100"; list($cURL_status, $twitter_data) = apiRequest($cURL, $follower_net); if ($cURL_status > 200) {$form_error = 14;} else { try{ $followers=parseXML($twitter_data); $x= -1; foreach ($followers as $follower) { $follow_net[$follower['user name']. ''] = array ( 'follow_net' => $x, 'author_username' => $follower['user_name'], 'author_fullname' => $follower['full_name'], 'author_username' => $follower['avatar'], 'author_username' => $follower['location'], 'author_username' => $follower['description'], 'author_username' => $follower['url'], 'is_protected' => $follower['is_protected'], 'total_followers' => $follower['followers'] ); } } catch (Exception $e) {$form_error = 17;} } } ?> Dreamweaver is saying i have a syntax error on a line that is below closing php statement ?> ?>
  20. Warning: mysqli_connect() [function.mysqli-connect]: Premature end of data (mysqlnd_wireprotocol.c:553) in C:\wamp\www\connect\index.php on line 11 Call Stack # Time Memory Function Location 1 0.0084 367976 {main}( ) ..\index.php:0 2 0.0085 368176 mysqli_connect ( ) ..\index.php:11 ( ! ) Warning: mysqli_connect() [function.mysqli-connect]: OK packet 1 bytes shorter than expected in C:\wamp\www\connect\index.php on line 11 Call Stack # Time Memory Function Location 1 0.0084 367976 {main}( ) ..\index.php:0 2 0.0085 368176 mysqli_connect ( ) ..\index.php:11 ( ! ) Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in C:\wamp\www\connect\index.php on line 11 Call Stack # Time Memory Function Location 1 0.0084 367976 {main}( ) ..\index.php:0 2 0.0085 368176 mysqli_connect ( ) ..\index.php:11 Unable to connect: I think my web server may have changed the security? All I did is re-write the output.html.php file
  21. <?php $link = mysqli_connect('217.174.', 'xymalf' , 'po'); if (!$link) { $output = 'unable to connect to database server.'; include 'output.html.php'; exit(); } if (!mysqli_select_db($link, 'xymalfco1')) { $output = 'unable to locate db'; include 'output.html.php'; exit(); } $output = 'connected.'; include 'output.html.php'; ?> [code] output.html.php <?php echo $output; ?> </p> </body> Can any one spot an error in my SQL connection code? it has stopped working.
  22. How do you modify the API. PHP file in Phlickr so that it contains your tokens etc. I have my keys. It it as simple as taking out the * for comments and putting in the keys? <?php * include_once 'Phlickr/Api.php'; * $api = new Phlickr_Api(1ec60e6261e4e4d84d4887b616***, 35ae16c55411****); * * // Authentication is no longer done with an email/password. the first step
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>phlickr_test.php</title> </head> <body> <?php require_once 'PHLICKR/Phlickr/Api.php'; define('FLICKR_API_KEY', '1ec60e6261e4e4d84d4887b616525e05'); define('FLICKR_API_SECRET', '35ae16c554110a64'); $api= new Phlickr_Api(FLICKR_API_KEY, KEY_API_SECRET); $response = $api->ExecuteMethod( 'flickr.test.echo', array('message' =>'it worked') ); print "<h1>{$response->xml->message}</h1>"; ?> my test file is located on my server at http://www.xymalf.co.uk/PHLICKR/Phlickr/phlickr_test.php All i get is a blank screen when i run the above program.
  24. what is ?oath nonce? The fliucr oath flow says sand a string GET&http%3A etc I am trying to fathom phpflickr out there seems to be no documentation i thought you should be able to run the auth.php file but this does not seem to work. anyway i have sent off for a book on how to program flickr just waiting for it to come from USA.
×
×
  • 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.