tupali/milfs/addon/brigada/funciones/twitter/datos.php
2016-10-29 10:07:15 -05:00

31 lines
1.2 KiB
PHP

<?php
ini_set('display_errors', 1);
require 'autoload.php';
use Abraham\TwitterOAuth\TwitterOAuth;
/*
define('CONSUMER_KEY', getenv('wMtivKDSAgZmkP7EZhYcfw'));
define('CONSUMER_SECRET', getenv('AvWbHfjuSJkZYhkxsU8ojsDpNtvapBoiRUzwF3OAvbo'));
define('OAUTH_CALLBACK', getenv('http://datos.labmde.org/milfs/toa/hola.php'));
*/
define('CONSUMER_KEY', 'QS1JHXs7OgJcFArJmMv117JEn');
define('CONSUMER_SECRET', 'NoO1FUXHmTB74HUrnDbcs64XgZoroBkaPav8w0FgbK3ZYSU9PZ');
define('OAUTH_CALLBACK', 'http://datos.labmde.org/milfs/addon/logis/funciones/twitter/hola.php');
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
//print $connection; //print connection contents
//$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
$request_token = $connection->oauth('oauth/request_token');
//$url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
$user = $connection->get("account/verify_credentials");
//print $user->screen_name;
print_r($user);
// Post Update
$content = $connection->post('statuses/update', array('status' => 'Bonito dia'));
print_r( $content);
print_r($url);
//print_r($request_token); //print connection contentsa
?>