Twitter API error 215

So, it seems Twitter’s latest API 1.1 does not allow access without authentication – even for data that is seemingly public…like the latest 3 tweets from a timeline. The best article I have found on this (which gives a great solution) for read-access can be found here: http://www.webdevdoor.com/php/authenticating-twitter-feed-timeline-oauth/ I have followed the steps in the … Read more

iOS 5 Twitter Framework: Tweeting without user input and confirmation (modal view controller)

It’s definitely possible to tweet without it, the following is in production iOS 5 apps. It even takes the user to the requisite section of preferences if they haven’t registered an account. – (void)postToTwitter { // Create an account store object. ACAccountStore *accountStore = [[ACAccountStore alloc] init]; // Create an account type that ensures Twitter … Read more

Retrieve all hashtags from a tweet in a PHP function

I created my own solution. It does: Finds all hashtags in a string Removes duplicate ones Sorts hashtags regarding to count of the existence in text Supports unicode characters function getHashtags($string) { $hashtags= FALSE; preg_match_all(“/(#\w+)/u”, $string, $matches); if ($matches) { $hashtagsArray = array_count_values($matches[0]); $hashtags = array_keys($hashtagsArray); } return $hashtags; } Output is like this: ( … Read more

Replies to a particular tweet, Twitter API

Here is the procedure to get the replies for a tweets when you fetch the tweet store the tweetId ie., id_str using twitter search api do the following query [q=”to:$tweeterusername”, sinceId = $tweetId] Loop all the results , the results matching the in_reply_to_status_id_str to $tweetid is the replies for the post.

Twitter API returns error 215, Bad Authentication Data

A very concise code without any other php file include of oauth etc. Please note to obtain following keys you need to sign up with https://dev.twitter.com and create application. <?php $token = ‘YOUR_TOKEN’; $token_secret=”YOUR_TOKEN_SECRET”; $consumer_key = ‘CONSUMER_KEY’; $consumer_secret=”CONSUMER_SECRET”; $host=”api.twitter.com”; $method = ‘GET’; $path=”/1.1/statuses/user_timeline.json”; // api call path $query = array( // query parameters ‘screen_name’ => … Read more

How to force Share Intent to open a specific app?

For Facebook public void shareFacebook() { String fullUrl = “https://m.facebook.com/sharer.php?u=..”; try { Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setClassName(“com.facebook.katana”, “com.facebook.katana.ShareLinkActivity”); sharingIntent.putExtra(Intent.EXTRA_TEXT, “your title text”); startActivity(sharingIntent); } catch (Exception e) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(fullUrl)); startActivity(i); } } For Twitter. public void shareTwitter() { String message = “Your message to post”; try { Intent sharingIntent … Read more

tech