Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

need to use authenticated calls for everything now; upping version #

  • Loading branch information...
commit e54b31fb1d7a9510f976f3724102a84cfd966867 1 parent 225090a
@alexkingorg alexkingorg authored
Showing with 20 additions and 22 deletions.
  1. +19 −21 classes/aktt.php
  2. +1 −1  twitter-tools.php
View
40 classes/aktt.php
@@ -1080,6 +1080,9 @@ static function status_url($username, $id) {
}
static function download_tweet($status_id, $username = null) {
+ if (empty(AKTT::$accounts)) {
+ return false;
+ }
$account_found = $tweet = false;
if (!empty($username)) {
AKTT::get_social_accounts();
@@ -1090,28 +1093,23 @@ static function download_tweet($status_id, $username = null) {
break;
}
}
- if ($account_found) {
- $response = Social::instance()->service('twitter')->request(
- $account->social_acct,
- 'statuses/show/'.urlencode($t->id).'.json',
- array(
- 'include_entities' => 1, // include explicit hashtags and mentions
- 'include_rts' => 1, // include retweets
- )
- );
- $content = $response->body();
- if ($content->result == 'success') {
- $tweets = $content->response;
- if (!$tweets || !is_array($tweets) || count($tweets) != 1) {
- $tweet = $tweet[0];
- }
- }
+ if (!$account_found) {
+ $account = AKTT::$accounts[0]; // use any account
}
- }
- if (!$tweet) {
- $response = wp_remote_get('http://api.twitter.com/1/statuses/show/'.urlencode($status_id).'.json?include_entities=true', array());
- if (!is_wp_error($response)) {
- $tweet = json_decode(wp_remote_retrieve_body($response));
+ $response = Social::instance()->service('twitter')->request(
+ $account->social_acct,
+ 'statuses/show/'.urlencode($t->id).'.json',
+ array(
+ 'include_entities' => 1, // include explicit hashtags and mentions
+ 'include_rts' => 1, // include retweets
+ )
+ );
+ $content = $response->body();
+ if ($content->result == 'success') {
+ $tweets = $content->response;
+ if (!$tweets || !is_array($tweets) || count($tweets) != 1) {
+ $tweet = $tweet[0];
+ }
}
}
return $tweet;
View
2  twitter-tools.php
@@ -3,7 +3,7 @@
Plugin Name: Twitter Tools
Plugin URI: http://crowdfavorite.com/wordpress/plugins/twitter-tools/
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>.
-Version: 3.0rc1
+Version: 3.0
Author: Crowd Favorite
Author URI: http://crowdfavorite.com
*/
Please sign in to comment.
Something went wrong with that request. Please try again.