Top 3 posts in last week ordered by Facebook and Twitter share counts

This is a bit of a multi-part question, so you’re getting a multi-part answer. Getting the Facebook count can be done by making a request to https://graph.facebook.com/URL. This will return a json object which contains, among other things, the number of “shares”. Working example which has 4 shares as of this writing: https://graph.facebook.com/http://ottopress.com/2011/wp-quickie-adding-chrome-voice-search/ Getting the … Read more

Importing Tweets with certain hashtags into WordPress

I wrote a shortcode function based on “Twitter Hash Tag Widget” plugin just copy this function to your themes functions.php file function tweets_by_hashtag_9867($atts, $content = null){ extract(shortcode_atts(array( “hashtag” => ‘default_tag’, “number” => 5, ), $atts)); $api_url=”http://search.twitter.com/search.json”; $raw_response = wp_remote_get(“$api_url?q=%23$hashtag&rpp=$number”); if ( is_wp_error($raw_response) ) { $output = “<p>Failed to update from Twitter!</p>\n”; $output .= “<!–{$raw_response->errors[‘http_request_failed’][0]}–>\n”; $output … Read more