echo "thisid:" . $thisid . " lastid:" . $lastid . "<br/>\n"; if (strcasecmp($thisid, $lastid) <= 0) { echo "same<br/>\n"; echo "<br/>***************************<br/>\r\n"; continue; } $fp = fopen("/var/www/html/tw/param_test.txt", "w"); if (fwrite($fp, $thisid) === false) { echo "write file failed<br/>\n"; } fclose($fp); echo "<br/>\n"; $text = $value->{'text'}; $post = preg_replace("/#\\S*/", "\$0#", $text); echo $post . "_____with link<br/>\n"; $post = getRedirectText($post); echo $post . "_____with redirectlink<br/>\n"; $token = "2.00uj9JACuwl1VD699af49a280tL7qt"; weibo_post($token, $post); sleep(2); echo "<br/>*********************<br/>"; } } function twitteroauth_header($header) { echo '<tr><th colspan="4" style="background: grey;">', $header, '</th></tr>'; } $method = "statuses/user_timeline"; $parameters = array('screen_name' => "michael_saylor", "count" => "10"); twitteroauth_row($method, $connection->get($method, $parameters), $connection->http_code);
$method = 'friends/ids'; twitteroauth_row($method, $twitter->get($method), $twitter->http_code); /* friends/ids */ $method = 'friends/ids'; twitteroauth_row($method, $twitter->get($method), $twitter->http_code); /** * Account Methods. */ twitteroauth_header('Account Methods'); /* account/verify_credentials */ $method = 'account/verify_credentials'; twitteroauth_row($method, $twitter->get($method), $twitter->http_code); /* account/rate_limit_status */ $method = 'account/rate_limit_status'; twitteroauth_row($method, $twitter->get($method), $twitter->http_code); /* account/update_profile_colors */ $parameters = array('profile_background_color' => 'fff'); $method = 'account/update_profile_colors'; twitteroauth_row($method, $twitter->post($method, $parameters), $twitter->http_code, $parameters); /* account/update_profile */ $parameters = array('location' => 'Teh internets'); $method = 'account/update_profile'; twitteroauth_row($method, $twitter->post($method, $parameters), $twitter->http_code, $parameters); /** * OAuth Methods. */ twitteroauth_header('OAuth Methods'); /* oauth/request_token */ $oauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); twitteroauth_row('oauth/reqeust_token', $oauth->getRequestToken(), $oauth->http_code);
/* direct_messages/new */ $parameters = array('user_id' => $user->id, 'text' => 'Testing out @oauthlib code'); $method = 'direct_messages/new'; $dm = $connection->post($method, $parameters); twitteroauth_row($method, $dm, $connection->http_code, $parameters); /* direct_messages */ $method = 'direct_messages'; twitteroauth_row($method, $connection->get($method), $connection->http_code); /* direct_messages/sent */ $method = 'direct_messages/sent'; twitteroauth_row($method, $connection->get($method), $connection->http_code); /* direct_messages/sent */ $method = "direct_messages/destroy/{$dm->id}"; twitteroauth_row($method, $connection->delete($method), $connection->http_code); /* Some example calls */ //$connection->get('users/show', array('screen_name' => 'abraham')); //$connection->post('statuses/update', array('status' => date(DATE_RFC822))); //$connection->post('statuses/destroy', array('id' => 5437877770)); //$connection->post('friendships/create', array('id' => 9436992)); //$connection->post('friendships/destroy', array('id' => 9436992)); /* Include HTML to display on the page */ include('html.inc');