How could I get the raw tweets?


#1

Hello,

I would like to know if it’s possible to get the tweets with the original format.
I’m happy with the extra information that I can get through datasift, but the JSON that I get from Datasift has a field “twitter” where you’d find the data from a tweet, but the format inside of this field is not the same that if you get the Twitter from API Public of Twitter, what it’s a little weird.

Thank you.


#2

The data we receive from Twitter is placed into the 'twitter' part of the interaction object. Many of these fields are mapped one-to-one with the object we receive from Twitter. Are there any fields in particular that you are having difficulties with?


#3

It’s because I got some tweets from API Public from Twitter and now, I would like that they both share the same model and I thought that the twitter field was a copy of a tweet but I realize that there’re different between them.

Now, my idea is to create my own class (or maybe I’d use a model class of DataSift to Twitter, although, I guess that it’s out from the datasift api from java) and cast datasift model and Twitter model to this class.


#4

I don’t find the content of the “geo” attribute. I guess that it has the coordinates,. but, I don’t find in the documentation the concrete fields of geo. Could you help me?

Thank you


#5

The targets that allow you to filter on geo data in Twitter are twitter.geo, or the twitter.place.* targets.

A stripped down example of a Twitter interaction containing geo data is as follows:

{  "interaction": {    "geo": {      "latitude": 1.3175855,      "longitude": 103.84404628    }  },  "twitter": {    "geo": {      "latitude": 1.3175855,      "longitude": 103.84404628    },    "place": {      "id": "d0941d4cf659fc64",      "url": "https://api.twitter.com/1.1/geo/id/d0941d4cf659fc64.json",      "place_type": "admin",      "country": "Malaysia",      "country_code": "MY",      "full_name": "Johore, Malaysia",      "name": "Johore",      "attributes": {}    },  }}

Please bear in mind, that if there is no geo data in a Tweet, no geo data will be passed on. Do not be fooled by the 'geo_enabled' field - if it is set to true, it means the user has enabled the ability to check in, but has not necessarily checked in with this particular Tweet.