Tweet Cordinates

Oct 29, 2012 at 5:16 AM
Edited Oct 29, 2012 at 5:20 AM

I am using following query to get user tweets and its details...

var queryResponse = from tweet in pubTweetCtx.Status
                            where tweet.Type == StatusType.User && tweet.ScreenName == Screen_Name 
&& tweet.Count == 200                             select tweet;

But when I try to fetch Co-ordinates in the following manner:
foreach (var q in queryResponse)
{
Tweet = q.Text Lattitude = q.Coordinates.Latitude; Longitude = q.Coordinates.Longitude;
}
I am able to get the tweets.
It returns zero for both Latitude and Longitude. Is there another way to fetch the co-ordinates or am I doing something wrong here.
{Note: I am just using Consumer Key and Consumer Secret key to fetch the tweets by ScreenName.
I am NOT going thru the complete oAuth process here.}
Coordinator
Oct 29, 2012 at 11:35 AM

Hi,

The user who tweeted must have their location tracking turned on. Otherwise the coordinates will be 0. To verify your code, you can turn on location tracking by checking the "Add location to my Tweets" box in your Twitter profile, make sure your phone allows location tracking, and then tweet from your phone. Then you can do a query that will capture that tweet.

Joe

Oct 30, 2012 at 5:21 PM
I tried it. But still getting zero latitude and longitude.


From: [email removed]
To: [email removed]
Date: Mon, 29 Oct 2012 04:35:23 -0700
Subject: Re: Tweet Cordinates [LinqToTwitter:401069]

From: JoeMayo
Hi,
The user who tweeted must have their location tracking turned on. Otherwise the coordinates will be 0. To verify your code, you can turn on location tracking by checking the "Add location to my Tweets" box in your Twitter profile, make sure your phone allows location tracking, and then tweet from your phone. Then you can do a query that will capture that tweet.
Joe
Read the full discussion online.
To add a post to this discussion, reply to this email (LinqToTwitter@discussions.codeplex.com)
To start a new discussion for this project, email LinqToTwitter@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Oct 31, 2012 at 12:24 PM

Do you have a StatusID for the tweet you're looking at?

Joe

Oct 31, 2012 at 12:42 PM
Yes I have the status ID.


From: [email removed]
To: [email removed]
Date: Wed, 31 Oct 2012 05:24:42 -0700
Subject: Re: Tweet Cordinates [LinqToTwitter:401069]

From: JoeMayo
Do you have a StatusID for the tweet you're looking at?
Joe
Read the full discussion online.
To add a post to this discussion, reply to this email (LinqToTwitter@discussions.codeplex.com)
To start a new discussion for this project, email LinqToTwitter@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Oct 31, 2012 at 11:55 PM

If you give me the ID, I can get the tweet and try to find out what is happening.

Joe

Nov 1, 2012 at 4:08 AM
I am trying to find out location for the tweets by Screen Name drakknight4u. There are more than one tweets. But here are a few IDs :

263562780123209728
263549458980151296
263554074341949440

Thanks
Arshad

From: [email removed]
To: [email removed]
Date: Wed, 31 Oct 2012 16:55:53 -0700
Subject: Re: Tweet Cordinates [LinqToTwitter:401069]

From: JoeMayo
If you give me the ID, I can get the tweet and try to find out what is happening.
Joe
Read the full discussion online.
To add a post to this discussion, reply to this email (LinqToTwitter@discussions.codeplex.com)
To start a new discussion for this project, email LinqToTwitter@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Nov 6, 2012 at 12:12 PM

This tweet, 263562780123209728, doesn't have coordinates. You can tell by running a StatusType.Show query. Here's what Twitter gives me and you can verify by using Fiddler:

{
   "created_at":"Wed Oct 31 08:47:18 +0000 2012",
   "id":263562780123209728,
   "id_str":"263562780123209728",
   "text":"Tweeting for coordinates.....help us God.",
   "source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e",
   "truncated":false,
   "in_reply_to_status_id":null,
   "in_reply_to_status_id_str":null,
   "in_reply_to_user_id":null,
   "in_reply_to_user_id_str":null,
   "in_reply_to_screen_name":null,
   "user":{
      "id":914009784,
      "id_str":"914009784",
      "name":"Dark Knight",
      "screen_name":"darkknight4u",
      "location":"hyderabad",
      "description":"",
      "url":null,
      "entities":{
         "description":{
            "urls":[

            ]
         }
      },
      "protected":false,
      "followers_count":0,
      "friends_count":0,
      "listed_count":0,
      "created_at":"Tue Oct 30 06:22:38 +0000 2012",
      "favourites_count":2,
      "utc_offset":19800,
      "time_zone":"Chennai",
      "geo_enabled":true,
      "verified":false,
      "statuses_count":31,
      "lang":"en",
      "contributors_enabled":false,
      "is_translator":false,
      "profile_background_color":"C0DEED",
      "profile_background_image_url":"http:\/\/a0.twimg.com\/images\/themes\/theme1\/bg.png",
      "profile_background_image_url_https":"https:\/\/si0.twimg.com\/images\/themes\/theme1\/bg.png",
      "profile_background_tile":false,
      "profile_image_url":"http:\/\/a0.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png",
      "profile_image_url_https":"https:\/\/si0.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png",
      "profile_link_color":"0084B4",
      "profile_sidebar_border_color":"C0DEED",
      "profile_sidebar_fill_color":"DDEEF6",
      "profile_text_color":"333333",
      "profile_use_background_image":true,
      "default_profile":true,
      "default_profile_image":true,
      "following":false,
      "follow_request_sent":false,
      "notifications":false
   },
   "geo":null,
   "coordinates":null,
   "place":null,
   "contributors":null,
   "retweet_count":0,
   "entities":{
      "hashtags":[

      ],
      "urls":[

      ],
      "user_mentions":[

      ]
   },
   "favorited":false,
   "retweeted":false
}

Here's a tweet with coordinates: 263843354817732608.

Joe