'', 'username' => '', 'width' => '500', 'key' => '', 'keysecret' => '', 'token' => '', 'tokensecret' => '', 'background' => '#fff', 'border' => 'true', 'border_size' => '1', 'border_color' => '#ccc', 'module_padding' => '10', 'border_radius' => '10', 'header' => 'true', 'header_text' => 'Follow us on Twitter', 'header_background_color' => '#ccc', 'header_font_color' => '#fff', 'follow_button_text' => 'follow', 'connections' => '15', 'image_padding' => '0', 'image_border_radius' => '7', 'image_border' => '2', 'image_border_color' => '#ccc', 'footer' => '#true', 'author' => 'true' ), $atts); print_r($atts); extract($atts); //including the api $dir = plugin_dir_path( __FILE__ )."TwitterAPIExchange.php"; require_once($dir); $settings = array( 'oauth_access_token' => trim($token), 'oauth_access_token_secret' => trim($tokensecret), 'consumer_key' => trim($key), 'consumer_secret' => trim($keysecret) ); $urlUserInformation = "https://api.twitter.com/1.1/users/show.json"; $url = "https://api.twitter.com/1.1/followers/list.json"; $requestMethod = "GET"; $getFollowers = "?cursor=-1&screen_name=$username&skip_status=true&include_user_entities=false"; $twitter = new TwitterAPIExchange($settings); $stringUserInfo = json_decode($twitter->setGetfield($getFollowers) ->buildOauth($urlUserInformation, $requestMethod) ->performRequest(),$assoc = TRUE); $string = json_decode($twitter->setGetfield($getFollowers) ->buildOauth($url, $requestMethod) ->performRequest(),$assoc = TRUE); $followers = $stringUserInfo['followers_count']; if($username == "" || $key == "" || $keysecret == "" || $token == "" || $tokensecret == ""){ $data = "Please check our documentation. Some fields are required in our advanced twitter followers shortcode." . $tUsername; } else{ $data = ""; $data .= "
$followers peoples are following $userScreenName @twitter
follow us on twitter
"; } $data .= "