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

How to apply NLTK word_tokenize library on a Pandas dataframe for Twitter data?

In short: df[‘Text’].apply(word_tokenize) Or if you want to add another column to store the tokenized list of strings: df[‘tokenized_text’] = df[‘Text’].apply(word_tokenize) There are tokenizers written specifically for twitter text, see http://www.nltk.org/api/nltk.tokenize.html#module-nltk.tokenize.casual To use nltk.tokenize.TweetTokenizer: from nltk.tokenize import TweetTokenizer tt = TweetTokenizer() df[‘Text’].apply(tt.tokenize) Similar to: How to apply pos_tag_sents() to pandas dataframe efficiently how to use … Read more

Prompt login alert with Twitter framework in iOS5?

In iOS5.1, we should use TWTweetComposeViewController to show the dialog since apple rejects apps using prefs:root=TWITTER. But, I didn’t like showing the tweet screen and keyboard so I figured out the way to hide them, but show the pop up screen. UPDATE: Apple approved my app using this trick. TWTweetComposeViewController *viewController = [[TWTweetComposeViewController alloc] init]; … Read more

How to add a location filter to tweepy module

The streaming API doesn’t allow to filter by location AND keyword simultaneously. Bounding boxes do not act as filters for other filter parameters. For example track=twitter&locations=-122.75,36.8,-121.75,37.8 would match any tweets containing the term Twitter (even non-geo tweets) OR coming from the San Francisco area. Source: https://dev.twitter.com/docs/streaming-apis/parameters#locations What you can do is ask the streaming API … 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

Android – Share on Facebook, Twitter, Mail, ecc

Paresh Mayani’s answer is mostly correct. Simply use a Broadcast Intent to let the system and all the other apps choose in what way the content is going to be shared. To share text use the following code: String message = “Text I want to share.”; Intent share = new Intent(Intent.ACTION_SEND); share.setType(“text/plain”); share.putExtra(Intent.EXTRA_TEXT, message); startActivity(Intent.createChooser(share, … 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.