tabchas
tabchas

Reputation: 1402

Get Twitter Messages Sent via SMS using Python

Does anyone know of a method to collect Twitter text messages using Python (or any language)? I am working on a project and it requires a corpus made up of text messages. I thought since people use Twitter through text messages, it would be as good as collecting text messages from a phone.

Any ideas?

BTW, I have used the Tweepy library to collect the public stream of Twitter messages. However, these cannot be distinguished between text messages or just a message written from a computer as far as I know.

Upvotes: 1

Views: 342

Answers (1)

Terence Eden
Terence Eden

Reputation: 14324

In the response, look for the "source" element.

It will normally say something like

"source" : "<a href="http://example.com" rel="nofollow">Some Twitter App</a>",

If a tweet has been sent in via SMS / Text Message, it will say

"source" : "<a href="http://twitter.com/devices" rel="nofollow">txt</a>",

Sadly, the Twitter search engine will not let you search by source, so you may have to capture a wide range of tweets in order to get enough text messages.

Upvotes: 2

Related Questions