Jump to content

how can i modify code so it works with oauth?


xymalf

Recommended Posts

$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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.