xymalf Posted July 28, 2012 Share Posted July 28, 2012 $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. Quote Link to comment https://forums.phpfreaks.com/topic/266373-how-can-i-modify-code-so-it-works-with-oauth/ Share on other sites More sharing options...
trq Posted July 28, 2012 Share Posted July 28, 2012 You are kidding right? Quote Link to comment https://forums.phpfreaks.com/topic/266373-how-can-i-modify-code-so-it-works-with-oauth/#findComment-1365038 Share on other sites More sharing options...
xymalf Posted July 28, 2012 Author Share Posted July 28, 2012 No i am just a newbie - twitter no longer seems top accept passwords that are submitted. Quote Link to comment https://forums.phpfreaks.com/topic/266373-how-can-i-modify-code-so-it-works-with-oauth/#findComment-1365066 Share on other sites More sharing options...
Christian F. Posted July 28, 2012 Share Posted July 28, 2012 I recommend that you start with the Twitter API documentation. Quote Link to comment https://forums.phpfreaks.com/topic/266373-how-can-i-modify-code-so-it-works-with-oauth/#findComment-1365107 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.