Changeset 2020281
- Timestamp:
- 01/28/2019 10:08:35 AM (7 years ago)
- File:
-
- 1 edited
-
fetch-some-tweets/trunk/fetch-some-tweets.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fetch-some-tweets/trunk/fetch-some-tweets.php
r1988966 r2020281 285 285 $exclude_replies = $options['fst_text_field_7']; 286 286 287 // Connect to Twitter API - https://github.com/abraham/twitteroauth288 $connection = new TwitterOAuth(289 $consumer_key,290 $consumer_secret,291 $access_token,292 $access_token_secret293 );294 295 // Verify Connection, Keys & Tokens296 $content = $connection->get('account/verify_credentials');297 298 287 //Links, Users & Hashtags 299 288 function fst_parse_tweet( $text ){ … … 315 304 } 316 305 306 // Connect to Twitter API - https://github.com/abraham/twitteroauth 307 $connection = new TwitterOAuth( 308 $consumer_key, 309 $consumer_secret, 310 $access_token, 311 $access_token_secret 312 ); 313 314 // Verify Connection, Keys & Tokens 315 $content = $connection->get('account/verify_credentials'); 316 317 // Verifyk Connection to Twitter 318 if( isset( $content ) ){ 319 320 $tweet_user_timeline = '<section class="no-tweets no-connection">'; 321 $tweet_user_timeline .= '<p>Cannot connect to Twitter, check your internet!</p>'; 322 $tweet_user_timeline .= '</section>'; 323 return $tweet_user_timeline; 324 die(); 325 317 326 // Check for Errors - $content 318 if( isset( $content->errors ) ){327 } elseif( isset( $content->errors ) ){ 319 328 320 329 // No Tweets … … 323 332 $tweet_user_timeline .= '</section>'; 324 333 return $tweet_user_timeline; 325 //die();334 die(); 326 335 327 336 } else { … … 407 416 // Tweet Type - Tweet, Retweet, Quoted Retweet or Reply 408 417 if( $retweet ){ 409 $tweet_user_timeline .= '<span class="tweet-type">Retweet</span> ';418 $tweet_user_timeline .= '<span class="tweet-type">Retweet</span> - '; 410 419 } elseif( $quoted_retweet ){ 411 $tweet_user_timeline .= '<span class="tweet-type">Quoted Retweet</span> ';420 $tweet_user_timeline .= '<span class="tweet-type">Quoted Retweet</span> - '; 412 421 } elseif( $reply ){ 413 $tweet_user_timeline .= '<span class="tweet-type">Reply</span> ';422 $tweet_user_timeline .= '<span class="tweet-type">Reply</span> - '; 414 423 } else { 415 $tweet_user_timeline .= '<span class="tweet-type">Tweet</span> ';424 $tweet_user_timeline .= '<span class="tweet-type">Tweet</span> - '; 416 425 } 417 426 418 $tweet_user_timeline .= '<span class="tweet-date"> -';427 $tweet_user_timeline .= '<span class="tweet-date">'; 419 428 $tweet_user_timeline .= fst_parse_date( $tweet_date ); 420 429 $tweet_user_timeline .= '</span>';
Note: See TracChangeset
for help on using the changeset viewer.