Re: [twitter-dev] inconsistent data when fetching the stream using location boxes

2011-06-24 Thread Thomas Alisi
thanks matt

I didn't think of verifying the source straight from the json api, you're 
perfectly right, this is super helpful.

and it appears that twitter4j has some funny behaviour, as I'm reading the 
geo location directly from the API when I receive an onStatus notification, 
hence something like status.geoLocation()

I will need to dig in the code to understand what's happening, I'll come 
back to you as soon as I have answers

many thanks again, have a good day
thomas

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


Re: [twitter-dev] inconsistent data when fetching the stream using location boxes

2011-06-23 Thread Matt Harris
Hey Thomas,

Thanks for providing the examples. I'm a little confused about the latitude
and longitude you have provided in your example Tweets.

When I query those Tweets through the API I receive geo information which
matches your Streaming API filter.

Where are you reading the latitude and longitude from?


Here are the responses I see:
/1/statuses/show.json?id=83428963950669824\trim_user=1
{
  coordinates: null,
  favorited: false,
  truncated: false,
  created_at: Wed Jun 22 06:59:49 + 2011,
  id_str: 83428963950669824,
  in_reply_to_user_id_str: null,
  annotations: null,
  text: OMG, Jamie Cullum singing live on Radio 2 right now is amazing!!!
Thank you @achrisevans for suggesting that song!,
  contributors: null,
  id: 83428963950669824,
  retweet_count: 0,
  in_reply_to_status_id_str: null,
  geo: null,
  retweeted: false,
  in_reply_to_user_id: null,
  source: a href=\http://stone.com/Twittelator\;
rel=\nofollow\Twittelator/a,
  in_reply_to_screen_name: null,
  user: {
id_str: 63515926,
id: 63515926
  },
  place: {
name: Hounslow,
country: United Kingdom,
country_code: GB,
attributes: {

},
url: http://api.twitter.com/1/geo/id/c2e57feb725f3ee1.json;,
bounding_box: {
  coordinates: [
[
  [
-0.457447,
51.420633
  ],
  [
-0.243419,
51.420633
  ],
  [
-0.243419,
51.502851
  ],
  [
-0.457447,
51.502851
  ]
]
  ],
  type: Polygon
},
id: c2e57feb725f3ee1,
full_name: Hounslow, London,
place_type: city
  },
  in_reply_to_status_id: null
}

and /1/statuses/show.json?id=83428616981061633\trim_user=1

{
  coordinates: null,
  favorited: false,
  truncated: false,
  created_at: Wed Jun 22 06:58:26 + 2011,
  id_str: 83428616981061633,
  in_reply_to_user_id_str: 42856682,
  annotations: null,
  text: @icsbcn @XaviGava @martaspons follower, de qui?,
  contributors: null,
  id: 83428616981061633,
  retweet_count: 0,
  in_reply_to_status_id_str: 83426231340638208,
  geo: null,
  retweeted: false,
  in_reply_to_user_id: 42856682,
  source: web,
  in_reply_to_screen_name: icsbcn,
  user: {
id_str: 232599714,
id: 232599714
  },
  place: {
name: Barcelona,
country: Spain,
country_code: ES,
attributes: {

},
url: http://api.twitter.com/1/geo/id/1a27537478dd8e38.json;,
bounding_box: {
  coordinates: [
[
  [
2.0524766,
41.3200423
  ],
  [
2.2261223,
41.3200423
  ],
  [
2.2261223,
41.4682346
  ],
  [
2.0524766,
41.4682346
  ]
]
  ],
  type: Polygon
},
id: 1a27537478dd8e38,
full_name: Barcelona, Barcelona,
place_type: city
  },
  in_reply_to_status_id: 83426231340638208
}

Best,
@themattharris https://twitter.com/intent/follow?screen_name=themattharris
Developer Advocate, Twitter



On Wed, Jun 22, 2011 at 12:07 AM, Thomas Alisi thomasal...@gmail.comwrote:

 hey man,

 thanks for this reply! yup, of corse I can.

 so, I am using twitter4j and reading the stream with the streaming API
 implementation (loosely following the code snippet below). I have setup a
 filter query with a list of location boxes, being the following 3
 (barcelona, manchester, london):

- [barcelona] 1.48, 41.10, 2.34, 41.4,
- [london] -0.30, 51.10, 0.21, 51.45,
- [manchester] -2.18, 53.25, -2.09, 53.31

 then retrieving the status' location through the Status.getGeoLocation()
 function (
 http://twitter4j.org/en/javadoc/twitter4j/Status.html#getGeoLocation%28%29
 )

 now, it happen (quite frequently, but I don't have a statistic... say 1
 post out of 50) that I find the geo location being with coordinates out of
 the boxes, such as:

 37.1289787 -84.0832596 (tweet id: 83428963950669824 - reverse geocode using
 google maps: london, kentucky)
 10.103 -64.669 (tweet id: 83428616981061633 - reverse geocode using
 google maps: barcelona, venezuela)

 so I am wondering how it can happen, provided that I am giving numerical
 coordinates for location boxes...

 hope this is clearer, many thanks
 thomas

 fetch stream:

 StatusListener listener = new StatusListener(){
 public void onStatus(Status status) {
// get geoLocation and save to db
 }
 };
 TwitterStream twitterStream = new 
 TwitterStreamFactory(listener).getInstance();
 twitterStream.filter( myFilterQuery );

  --
 Twitter developer documentation and resources: https://dev.twitter.com/doc
 API updates via Twitter: https://twitter.com/twitterapi
 Issues/Enhancements Tracker:
 https://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
 https://groups.google.com/forum/#!forum/twitter-development-talk


-- 
Twitter developer documentation and resources: 

Re: [twitter-dev] inconsistent data when fetching the stream using location boxes

2011-06-22 Thread Thomas Alisi
hey man,

thanks for this reply! yup, of corse I can. 

so, I am using twitter4j and reading the stream with the streaming API 
implementation (loosely following the code snippet below). I have setup a 
filter query with a list of location boxes, being the following 3 
(barcelona, manchester, london):

   - [barcelona] 1.48, 41.10, 2.34, 41.4, 
   - [london] -0.30, 51.10, 0.21, 51.45, 
   - [manchester] -2.18, 53.25, -2.09, 53.31

then retrieving the status' location through the Status.getGeoLocation() 
function 
(http://twitter4j.org/en/javadoc/twitter4j/Status.html#getGeoLocation%28%29)

now, it happen (quite frequently, but I don't have a statistic... say 1 post 
out of 50) that I find the geo location being with coordinates out of the 
boxes, such as:

37.1289787 -84.0832596 (tweet id: 83428963950669824 - reverse geocode using 
google maps: london, kentucky)
10.103 -64.669 (tweet id: 83428616981061633 - reverse geocode using 
google maps: barcelona, venezuela)

so I am wondering how it can happen, provided that I am giving numerical 
coordinates for location boxes...

hope this is clearer, many thanks
thomas

fetch stream:

StatusListener listener = new StatusListener(){
public void onStatus(Status status) {
   // get geoLocation and save to db
}
};
TwitterStream twitterStream = new TwitterStreamFactory(listener).getInstance();
twitterStream.filter( myFilterQuery );

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk