Changeset 829996
- Timestamp:
- 12/30/2013 04:34:19 AM (11 years ago)
- Location:
- twitter-tools/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
twitter-tools/trunk/README.txt
r725718 r829996 2 2 Contributors: alexkingorg, crowdfavorite 3 3 Tags: twitter, tweet, integration, post, notify, integrate, archive, widget, shortcode, social 4 Requires at least: 3. 45 Tested up to: 3. 5.16 Stable tag: 3.0. 44 Requires at least: 3. 5 Tested up to: 3. 6 Stable tag: 3.0. 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 141 141 == Upgrade Notice == 142 142 143 Version 3.0.4 brings support for Twitter API v1.1. 144 145 Version 3.0 is a complete rewrite that utilizes <a href="http://wordpress.org/extend/plugins/social/">Social</a> to make connecting your Twitter account easy. It is compatibile with the latest Twitter API changes as of October 11, 2012. Please see the <a href="http://alexking.org/blog/2012/10/12/twitter-tools-3-0-faq">FAQ</a> for more details. 143 Version 3.1 brings support for Social 2.10's CRON action names and requires Social 2.10 and WordPress 3.8. It also adds a setting for the publish/draft status of blog posts created from tweets. Now you can set your blog posts to be created as drafts, then publish only the ones you choose to. We've also improved native RT support. 144 146 145 147 146 == Changelog == 147 148 149 150 151 152 153 154 155 148 156 149 157 = 3.0.4 = -
twitter-tools/trunk/classes/aktt.php
r725717 r829996 3 3 class AKTT { 4 4 // settings: aktt_v3_settings 5 static $ver = '3. 0.1';5 static $ver = '3.1'; 6 6 static $enabled = false; 7 7 static $prefix = 'aktt_'; … … 78 78 79 79 // Cron Hooks 80 add_action('social _cron_15', array('AKTT', 'import_tweets'));80 add_action('social15', array('AKTT', 'import_tweets')); 81 81 add_action('aktt_backfill_tweets', array('AKTT', 'backfill_tweets')); 82 82 -
twitter-tools/trunk/classes/aktt_account.php
r725717 r829996 37 37 'value' => 0, 38 38 'type' => 'is_cat', 39 40 41 42 43 44 39 45 ), 40 46 'post_tags' => array( // tags to add to posts created from this acct … … 167 173 'post_category' => $this->option('post_category'), 168 174 'post_tags' => $this->option('post_tags'), 175 169 176 'title_prefix' => $this->option('blog_post_title'), 170 177 ); -
twitter-tools/trunk/classes/aktt_tweet.php
r725717 r829996 91 91 */ 92 92 public function content() { 93 94 95 93 96 if (isset($this->data) && isset($this->data->text)) { 94 97 return $this->data->text; … … 142 145 */ 143 146 public function hashtags() { 144 return (isset($this->data) && isset($this->data->entities) ? $this->data->entities->hashtags : array()); 147 if ($this->is_native_retweet()) { 148 return (isset($this->data->retweeted_status->entities) ? $this->data->retweeted_status->entities->hashtags : array()); 149 } 150 else { 151 return (isset($this->data) && isset($this->data->entities) ? $this->data->entities->hashtags : array()); 152 } 145 153 } 146 154 … … 151 159 */ 152 160 public function mentions() { 153 return (isset($this->data) && isset($this->data->entities) ? $this->data->entities->user_mentions : array()); 161 if ($this->is_native_retweet()) { 162 return (isset($this->data->retweeted_status->entities) ? $this->data->retweeted_status->entities->user_mentions : array()); 163 } 164 else { 165 return (isset($this->data) && isset($this->data->entities) ? $this->data->entities->user_mentions : array()); 166 } 154 167 } 155 168 … … 160 173 */ 161 174 public function urls() { 162 return (isset($this->data) && isset($this->data->entities) ? $this->data->entities->urls : array()); 175 if ($this->is_native_retweet()) { 176 return (isset($this->data->retweeted_status->entities) ? $this->data->retweeted_status->entities->urls : array()); 177 } 178 else { 179 return (isset($this->data) && isset($this->data->entities) ? $this->data->entities->urls : array()); 180 } 163 181 } 164 182 … … 288 306 289 307 /** 290 * Is this a retweet? 308 * Is this a native retweet? 309 * 310 * @return bool 311 */ 312 function is_native_retweet() { 313 return (bool) (isset($this->data) && !empty($this->data->retweeted_status)); 314 } 315 316 317 /** 318 * Is this a retweet? (This includes both native and non-native retweets.) 291 319 * 292 320 * @return bool 293 321 */ 294 322 function is_retweet() { 295 return (bool) (AKTT::substr($this->content(), 0, 2) == 'RT' || !empty($this->data->retweeted_status));323 return (bool) (AKTT::substr($this->content(), 0, 2) == 'RT' || )); 296 324 } 297 325 … … 313 341 } 314 342 315 function link_entities($de fer_to_anywhere= true) {343 function link_entities($de = true) { 316 344 $entities = array(); 317 345 // mentions 318 $anywhere = Social::option('twitter_anywhere_api_key'); 319 if (!$defer_to_anywhere || empty($anywhere) || is_feed()) { 320 foreach ($this->mentions() as $entity) { 321 $entities['start_'.str_pad($entity->indices[0], 5, '0', STR_PAD_LEFT)] = array( 322 'find' => $entity->screen_name, 323 'replace' => AKTT::profile_link($entity->screen_name), 324 'start' => $entity->indices[0], 325 'end' => $entity->indices[1], 326 ); 327 } 346 foreach ($this->mentions() as $entity) { 347 $entities['start_'.str_pad($entity->indices[0], 5, '0', STR_PAD_LEFT)] = array( 348 'find' => $entity->screen_name, 349 'replace' => AKTT::profile_link($entity->screen_name), 350 'start' => $entity->indices[0], 351 'end' => $entity->indices[1], 352 ); 328 353 } 329 354 // hashtags … … 367 392 $diff += AKTT::strlen($entity['replace']) - ($end - $start); 368 393 } 394 395 396 397 398 399 369 400 return $str; 370 401 } … … 556 587 // 'post_tag' => array_map('trim', explode(',', $post_tags)), 557 588 // ), 558 'post_status' => 'publish',589 'post_status' => , 559 590 'post_type' => 'post', 560 591 'post_date' => date('Y-m-d H:i:s', AKTT::gmt_to_wp_time($gmt_time)), -
twitter-tools/trunk/twitter-tools.php
r725717 r829996 4 4 Plugin URI: http://crowdfavorite.com/wordpress/plugins/twitter-tools/ 5 5 Description: An integration between your WordPress site and Twitter. Create posts from your tweets. Show your tweets in your sidebar. Relies on <a href="http://wordpress.org/extend/plugins/social/">Social</a>. 6 Version: 3. 0.46 Version: 3. 7 7 Author: Crowd Favorite 8 8 Author URI: http://crowdfavorite.com -
twitter-tools/trunk/views/admin-account.php
r613060 r829996 49 49 </p> 50 50 <p> 51 52 53 54 55 56 57 58 59 60 61 51 62 <label class="left" for="<?php echo esc_attr(sprintf($name, 'post_tags')); ?>"><?php _e('Tags', 'twitter-tools'); ?></label> 52 63 <input type="text" class="type-ahead" data-tax="post_tag" name="<?php echo esc_attr(sprintf($name, 'post_tags')); ?>" id="<?php echo esc_attr(sprintf($name, 'post_tags')); ?>" value="<?php echo esc_attr($account->option('post_tags')); ?>" /> <span class="help"><?php _e('(comma separated)', 'twitter-tools'); ?></span>
Note: See TracChangeset
for help on using the changeset viewer.