Changeset 601837
- Timestamp:
- 09/21/2012 02:04:26 AM (14 years ago)
- Location:
- wordpress-tweeter/trunk
- Files:
-
- 1 deleted
- 2 edited
-
. (modified) (1 prop)
-
sceenshot-1.jpg (deleted)
-
wptweeter.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-tweeter/trunk
-
Property
svn:ignore
set to
.git
-
Property
svn:ignore
set to
-
wordpress-tweeter/trunk/wptweeter.php
r600147 r601837 37 37 $status = substr($status, 0, 140); 38 38 39 $ch = curl_init(); 40 curl_setopt($ch, CURLOPT_URL, "https://api.twitter.com/1.1/statuses/update.json"); 41 curl_setopt($ch, CURLOPT_HEADER, 0); 42 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 43 curl_setopt($ch, CURLOPT_POST, 1); 44 curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents('http://lab.sliceone.com/29308/tweet?oauth_token=' . $token . '&oauth_token_secret=' . $tokensecret . '&status=' . urlencode($status))); 45 curl_exec($ch); 46 curl_close($ch); 39 40 $response = wp_remote_get('http://lab.sliceone.com/29308/tweet?oauth_token=' . $token . '&oauth_token_secret=' . $tokensecret . '&status=' . urlencode($status)); 41 if(!is_wp_error( $response ) ) { 42 $ch = curl_init(); 43 curl_setopt($ch, CURLOPT_URL, "https://api.twitter.com/1.1/statuses/update.json"); 44 curl_setopt($ch, CURLOPT_HEADER, 0); 45 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 46 curl_setopt($ch, CURLOPT_POST, 1); 47 curl_setopt($ch, CURLOPT_POSTFIELDS, $response['body']); 48 curl_exec($ch); 49 curl_close($ch); 50 } 51 47 52 } 48 53 … … 194 199 echo '<div class="wrap"><h2>WordPress Tweeter</h2>'; 195 200 if(empty($_GET['oauth_token']) && empty($wptweeteroptions)) { 196 parse_str(file_get_contents('https://api.twitter.com/oauth/request_token?' . file_get_contents('http://lab.sliceone.com/29308/request-token?oauth_callback=' . admin_url('options-general.php?page=wptweeter.php')))); 201 $response = wp_remote_get('http://lab.sliceone.com/29308/request-token?oauth_callback=' . admin_url('options-general.php?page=wptweeter.php')); 202 $response = wp_remote_get('https://api.twitter.com/oauth/request_token?' . $response['body']); 203 parse_str($response['body']); 197 204 $link = 'https://api.twitter.com/oauth/authorize?oauth_token=' . $oauth_token; 198 205 ?> … … 285 292 $wptweeteroptions = get_option('wp_tweeter'); 286 293 if(!empty($_GET['oauth_token']) && !empty($_GET['oauth_verifier'])) { 287 parse_str(file_get_contents('https://api.twitter.com/oauth/access_token?' . file_get_contents('http://lab.sliceone.com/29308/access-token?oauth_token=' . $_GET['oauth_token'] . '&oauth_verifier=' . $_GET['oauth_verifier'])), $access_token_data); 294 $response = wp_remote_get('http://lab.sliceone.com/29308/access-token?oauth_token=' . $_GET['oauth_token'] . '&oauth_verifier=' . $_GET['oauth_verifier']); 295 $response = wp_remote_get('https://api.twitter.com/oauth/access_token?' . $response['body']); 296 parse_str($response['body'], $access_token_data); 288 297 if(empty($wptweeteroptions)) { 289 298 $default = array(
Note: See TracChangeset
for help on using the changeset viewer.