Related
Does somebody knows why Twitter API delivers different information for the same status using different methods?
I'm working on a Twitter bot to collect transit events. I'm facing some issues with the information delivered by the API, due to I've identified that depending on the method, the API can deliver different result for the same Tweet/status.
Here an example for the Tweet ID:1531517617562951682 using api.get_status, the status doesn't have the attributes extended_tweet and timestamp_ms.
Thanks in advance.
{
"created_at": "Tue May 31 06:07:08 +0000 2022",
"id": 1531517617562951682,
"id_str": "**1531517617562951682**",
"text": "01:07 #Precauci\u00f3nVial | Por percance en Av. Ing. Eduardo Molina a la altura de Av. Talism\u00e1n, col. San Pedro el Chic\u2026 (**removed_url)",
**"truncated": true**,
"entities": {
"hashtags": [
{
"text": "Precauci\u00f3nVial",
"indices": [
6,
21
]
}
],
"symbols": [],
"user_mentions": [],
"urls": [
{
"url": **removed_url_short,
"expanded_url": ,
"display_url": ,
"indices": [
117,
140
]
}
]
},
"source": "Twitter Web App",
"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": 166594238,
"id_str": "166594238",
"name": "OVIAL_SSCCDMX",
"screen_name": "OVIALCDMX",
"location": "Liverpool #136, Col. Ju\u00e1rez",
"description": "Centro de Orientaci\u00f3n Vial de la Secretar\u00eda de Seguridad Ciudadana de la Ciudad de M\u00e9xico.",
"url":,
"entities": {
"url": {
"urls": [
{
"url": ,
"expanded_url": ,
"display_url": "ssc.cdmx.gob.mx",
"indices": [
0,
23
]
}
]
},
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 1866313,
"friends_count": 125,
"listed_count": 4188,
"created_at": "Wed Jul 14 15:00:43 +0000 2010",
"favourites_count": 2748,
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"verified": true,
"statuses_count": 1110675,
"lang": null,
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "000000",
"profile_background_image_url":
"profile_background_image_url_https": ,
"profile_background_tile": false,
"profile_image_url": ,
"profile_image_url_https": ,
"profile_banner_url": ,
"profile_link_color": "BC8F8F",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "000000",
"profile_text_color": "000000",
"profile_use_background_image": false,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": false,
"follow_request_sent": false,
"notifications": false,
"translator_type": "none",
"withheld_in_countries": []
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"possibly_sensitive_appealable": false,
"lang": "es"
}
Same status collected with a stream.Attributes extended_tweet and timestamp are present on the status:
{
"created_at": "Tue May 31 06:07:08 +0000 2022",
"id": 1531517617562951682,
"id_str": "1531517617562951682",
"text": "01:07 #Precauci\u00f3nVial | Por percance en Av. Ing. Eduardo Molina a la altura de Av. Talism\u00e1n, col. San Pedro el Chic\u2026 (**removed url)",
"display_text_range": [
0,
140
],
"source": "Twitter Web App",
"truncated": true,
"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": 166594238,
"id_str": "166594238",
"name": "OVIAL_SSCCDMX",
"screen_name": "OVIALCDMX",
"location": "Liverpool #136, Col. Ju\u00e1rez",
"url": "http://ssc.cdmx.gob.mx",
"description": "Centro de Orientaci\u00f3n Vial de la Secretar\u00eda de Seguridad Ciudadana de la Ciudad de M\u00e9xico.",
"translator_type": "none",
"protected": false,
"verified": true,
"followers_count": 1866203,
"friends_count": 125,
"listed_count": 4188,
"favourites_count": 2748,
"statuses_count": 1110325,
"created_at": "Wed Jul 14 15:00:43 +0000 2010",
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"lang": null,
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "000000",
"profile_background_image_url": ,
"profile_background_image_url_https": ,
"profile_background_tile": false,
"profile_link_color": "BC8F8F",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "000000",
"profile_text_color": "000000",
"profile_use_background_image": false,
"profile_image_url": ,
"profile_image_url_https": ,
"profile_banner_url": ,
"default_profile": false,
"default_profile_image": false,
"following": null,
"follow_request_sent": null,
"notifications": null,
"withheld_in_countries": []
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"extended_tweet": {
"full_text": "01:07 #Precauci\u00f3nVial | Por percance en Av. Ing. Eduardo Molina a la altura de Av. Talism\u00e1n, col. San Pedro el Chico, servicios de emergencia acuden al lugar. (**removed url)",
"display_text_range": [
0,
158
],
"entities": {
"hashtags": [
{
"text": "Precauci\u00f3nVial",
"indices": [
6,
21
]
}
],
"urls": [],
"user_mentions": [],
"symbols": [],
"media": [
{
"id": 1531517217703092224,
"id_str": "1531517217703092224",
"indices": [
159,
182
],
"additional_media_info": {
"monetizable": false
},
"media_url": ,
"media_url_https": ,
"url":,
"display_url": "pic.twitter.com/q3seKvyPIM",
"expanded_url": ,
"type": "video",
"video_info": {
"aspect_ratio": [
16,
9
],
"duration_millis": 4003,
"variants": [
{
"content_type": "application/x-mpegURL",
"url": ""
},
{
"bitrate": 832000,
"content_type": "video/mp4",
"url": "
},
{
"bitrate": 256000,
"content_type": "video/mp4",
"url":
}
]
},
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"large": {
"w": 640,
"h": 360,
"resize": "fit"
},
"medium": {
"w": 640,
"h": 360,
"resize": "fit"
},
"small": {
"w": 640,
"h": 360,
"resize": "fit"
}
}
}
]
},
"extended_entities": {
"media": [
{
"id": 1531517217703092224,
"id_str": "1531517217703092224",
"indices": [
159,
182
],
"additional_media_info": {
"monetizable": false
},
"media_url": ,
"media_url_https": ,
"url": ,
"display_url": ,
"expanded_url": ,
"type": "video",
"video_info": {
"aspect_ratio": [
16,
9
],
"duration_millis": 4003,
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "
},
{
"bitrate": 832000,
"content_type": "video/mp4",
"url": "
},
{
"bitrate": 256000,
"content_type": "video/mp4",
"url": ""
}
]
},
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"large": {
"w": 640,
"h": 360,
"resize": "fit"
},
"medium": {
"w": 640,
"h": 360,
"resize": "fit"
},
"small": {
"w": 640,
"h": 360,
"resize": "fit"
}
}
}
]
}
},
"quote_count": 0,
"reply_count": 0,
"retweet_count": 0,
"favorite_count": 0,
"entities": {
"hashtags": [
{
"text": "Precauci\u00f3nVial",
"indices": [
6,
21
]
}
],
"urls": [
{
"url": ,
"expanded_url": ,
"display_url": "twitter.com/i/web/status/1\u2026",
"indices": [
117,
140
]
}
],
"user_mentions": [],
"symbols": []
},
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"filter_level": "low",
"lang": "es",
"**timestamp_ms**": "1653977228905"
}
For v1.1, the extended Tweet information is available by default in the streaming API, but for the REST endpoints, you need to add the tweet_mode=extended parameter to your request to retrieve the full text.
In V2, there is no longer a concept of extended (beyond 140 characters) Tweets. All Tweets are natively up to 280 characters as standard.
I want to sent a JSON to the server,with details of user and options selected by the user. Currently i just save those in simple arrays.
I want to create a JSON and sent it to the server. Normally i can just add each those fields on Parameter with Alamofire. But here i have an issue is that, the number of fields depend on the number of users(or passenger count).
I haven't done this type before and i am a newbie into iOS developing.
{
"contactPerson": {
"email": {
"email": "memine#gmail.com",
"markedForSendingRezInfo": false,
"preferred": false,
"shareMarketInd": false
},
"personName": {
"givenName": "Me",
"shareMarketInd": false,
"surname": "Mine"
},
"phoneNumber": {
"countryCode": "93",
"markedForSendingRezInfo": false,
"preferred": false,
"shareMarketInd": false,
"subscriberNumber": "123456789"
},
"shareMarketInd": false,
"useForInvoicing": false
},
"curr": "USD",
"flight1": "{fligh1Info}",
"flight2": "{flight2Info}",
"passengers": [{
"accompaniedByInfant": true,
"birthDate": {
"day": 6,
"fractionalSecond": 0.000,
"hour": 0,
"minute": 0,
"month": 9,
"orig_day": 6,
"orig_fracSeconds": 0.000,
"orig_hour": 0,
"orig_minute": 0,
"orig_month": 9,
"orig_second": 0,
"orig_timezone": 330,
"orig_year": 1991,
"second": 0,
"timezone": 330,
"year": 1991
},
"hasStrecher": false,
"parentSequence": 0,
"passengerTypeCode": "ADLT",
"personName": {
"givenName": "some",
"nameTitle": "Mr.",
"shareMarketInd": false,
"surname": "guy"
},
"requestedSeatCount": 1,
"shareMarketInd": false,
"unaccompaniedMinor": false
}, {
"accompaniedByInfant": false,
"birthDate": {
"day": 10,
"fractionalSecond": 0.000,
"hour": 0,
"minute": 0,
"month": 10,
"orig_day": 10,
"orig_fracSeconds": 0.000,
"orig_hour": 0,
"orig_minute": 0,
"orig_month": 10,
"orig_second": 0,
"orig_timezone": 330,
"orig_year": 2010,
"second": 0,
"timezone": 330,
"year": 2010
},
"hasStrecher": false,
"parentSequence": 0,
"passengerTypeCode": "CHLD",
"personName": {
"givenName": "some",
"shareMarketInd": false,
"surname": "child"
},
"requestedSeatCount": 1,
"shareMarketInd": false,
"unaccompaniedMinor": false
}, {
"accompaniedByInfant": false,
"birthDate": {
"day": 1,
"fractionalSecond": 0.000,
"hour": 0,
"minute": 0,
"month": 1,
"orig_day": 1,
"orig_fracSeconds": 0.000,
"orig_hour": 0,
"orig_minute": 0,
"orig_month": 1,
"orig_second": 0,
"orig_timezone": 330,
"orig_year": 2018,
"second": 0,
"timezone": 330,
"year": 2018
},
"hasStrecher": false,
"parentSequence": 0,
"passengerTypeCode": "INFT",
"personName": {
"givenName": "some",
"shareMarketInd": false,
"surname": "kid"
},
"requestedSeatCount": 1,
"shareMarketInd": false,
"unaccompaniedMinor": false
}],
"pwd": "password",
"requestPurpose": "MODIFY_PERMANENTLY_AND_CALC",
"unm": "username"
}
This is my JSON. Here number of flight1 flight2 .... depends on number of flights picked by the user.
and number of objects inside passengers depends on number of passengers selected by the user.
How do i do this part?
Try to create a dictionary of [String: Any] type like below example.
let param : [String: Any] = ["contactPerson": [ "email":[ "email": "text#mail.com"], "markedForSendingRezInfo": false], "personName": [], "curr": "USD", "flight1" : [], "flight2" : [] ]
You can add key value in param as per request parameter requirement. then pass this param to alamofire request param.
You need to add your data in Dictionary
Swift5
let dictData = ["name": "vicky", "phoneNumber": "01234567"]
let encoder = JSONEncoder()
if let jsonData = try? encoder.encode(dictData) {
if let jsonString = String(data: jsonData, encoding: .utf8) {
print(jsonString)
}
}
im trying to get jstree to work with
The first step I took was I added the following to the buildconfig.groovy
plugins{
compile "org.grails.plugins:js-tree:0.3.1"
}
Then I created my gsp and added the following to it to test it out which I got from the following jsfiddle
<html>
<head>
<g:javascript library="jquery" plugin="jquery"/>
<jsTree:resources />
</head>
<body>
<div>
<input class="search-input form-control">
</div>
<div id="jstree">
</div>
<script>
$(function() {
$(".search-input").keyup(function() {
var searchString = $(this).val();
console.log(searchString);
$('#jstree').jstree('search', searchString);
});
$('#jstree').jstree({
'core': {
'data': [{
"id": "1.0",
"text": "Fresh Products",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": [{
"id": "2.06.0",
"text": "Ethnic & Specialty",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": false,
"liAttributes": null,
"aAttributes": null
}, {
"id": "2.07.0",
"text": "Natural & Organic",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": false,
"liAttributes": null,
"aAttributes": null
}, {
"id": "2.08.0",
"text": "Prepared Foods",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": false,
"liAttributes": null,
"aAttributes": null
}, {
"id": "2.09.0",
"text": "Seafood",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": false,
"liAttributes": null,
"aAttributes": null
}, {
"id": "2.010.0",
"text": "Seafood",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": false,
"liAttributes": null,
"aAttributes": null
}],
"liAttributes": null,
"aAttributes": null
}, {
"id": "2.0",
"text": "Frozen Products",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": [],
"liAttributes": null,
"aAttributes": null
}, {
"id": "3.0",
"text": "Store Equipment ",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": [],
"liAttributes": null,
"aAttributes": null
}, {
"id": "4.0",
"text": "Packaged Grocery",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": [],
"liAttributes": null,
"aAttributes": null
}, {
"id": "5.0",
"text": "Retail Technology",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": [],
"liAttributes": null,
"aAttributes": null
}, {
"id": "6.0",
"text": "HBC/Non-Foods",
"icon": "",
"state": {
"opened": false,
"disabled": false,
"selected": false
},
"children": [],
"liAttributes": null,
"aAttributes": null
}]
},
"search": {
"case_insensitive": true,
"show_only_matches" : true
},
"plugins": ["search"]
});
});
</script>
</body>
</html>
All that comes up when I run it is a blank search box and text saying "running"
Im not sure what is going wrong, it doesnt seem to be finding the js
With twitter api named GET friends/list, https://api.twitter.com/1.1/friends/list.json i could get details of every user i am following. What i need is some particular data, 'geo' and 'coordinates' to be specific. There do exist a parameter named 'skip_status=true' to skip the status. But please let me know if either 'geo and coordinates' or 'status' alone could be fetched.
"users": [
{
"id": 3233xxxxxx,
"id_str": "3233428303",
"name": "Mars",
"screen_name": "Mars9411",
"location": "",
"description": "",
"url": null,
"entities": {
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 1,
"friends_count": 0,
"listed_count": 0,
"created_at": "Tue Jun 02 09:58:03 +0000 2015",
"favourites_count": 0,
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"verified": false,
"statuses_count": 9,
"lang": "en",
"status": {
"created_at": "Tue Oct 27 12:31:11 +0000 2015",
"id": 6589842841878xxxx,
"id_str": "65898428418781xxxx",
"text": "Hey, Download the app in your phone and you can have an Emergency Contact for FREE. It's Great.\nhttps://t.co/kEZg",
"source": "iOS",
"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,
"geo": {
"type": "Point",
"coordinates": [
28.612486,
77.377425
]
},
"coordinates": {
"type": "Point",
"coordinates": [
77.377425,
28.612486
]
},
"place": {
"id": "2e6064382c71b343",
"url": "https://api.twitter.com/1.1/geo/id/2e606438.json",
"place_type": "city",
"name": "Noida",
"full_name": "Noida, Uttar Pradesh",
"country_code": "IN",
"country": "India",
"contained_within": [],
"bounding_box": {
"type": "Polygon",
"coordinates": [
[
[
77.302126,
28.4439811
],
[
77.6953257,
28.4439811
],
[
77.6953257,
28.6471308
],
[
77.302126,
28.6471308
]
]
]
},
"attributes": {}
},
"contributors": null,
"retweet_count": 0,
"favorite_count": 0,
"entities": {
"hashtags": [],
"symbols": [],
"user_mentions": [],
"urls": [
{
"url": "https://t.co/kEZ",
"expanded_url": "http://www.sav.net/apps",
"display_url": "sav.net/apps",
"indices": [
101,
124
]
}
]
},
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"lang": "en"
},
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "C0DEED",
"profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_tile": false,
"profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_0_normal.png",
"profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_0_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,
"has_extended_profile": false,
"default_profile": true,
"default_profile_image": true,
"following": true,
"follow_request_sent": false,
"notifications": false,
"muting": false,
"blocking": false,
"blocked_by": false
},
{
"id": 741xxxxxx,
"id_str": "741xxxxxx",
"name": "Food",
"screen_name": "food",
"location": "Fort, IN",
"description": "Locally xxxxx",
"url": "http://t.co",
"entities": {
"url": {
"urls": [
{
"url": "http://t.co",
"expanded_url": "http://Food.com",
"display_url": "food.com",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 1976,
"friends_count": 375,
"listed_count": 44,
"created_at": "Tue Aug 07 02:10:46 +0000 2012",
"favourites_count": 247,
"utc_offset": -14400,
"time_zone": "Eastern Time (US & Canada)",
"geo_enabled": true,
"verified": false,
"statuses_count": 1349,
"lang": "en",
"status": {
"created_at": "Sun Oct 25 01:52:10 +0000 2015",
"id": 658098694xxxxxxxxx,
"id_str": "658098694xxxxxxxxx",
"text": "#BenjamenKelly tonight!",
"source": "Twitter for iPhone",
"truncated": false,
"in_reply_to_status_id": 657368006075486200,
"in_reply_to_status_id_str": "657368006075486208",
"in_reply_to_user_id": 509529431,
"in_reply_to_user_id_str": "509529431",
"in_reply_to_screen_name": "Kelly",
"geo": null,
"coordinates": null,
"place": {
"id": "3877d6c867447819",
"url": "https://api.twitter.com/1.1/geo/id/3877d6c867447819.json",
"place_type": "city",
"name": "Fort",
"full_name": "Fort, IN",
"country_code": "US",
"country": "United States",
"contained_within": [],
"bounding_box": {
"type": "Polygon",
"coordinates": [
[
[
-85.336872,
40.95926
],
[
-85.003231,
40.95926
],
[
-85.003231,
41.214574
],
[
-85.336872,
41.214574
]
]
]
},
"attributes": {}
},
"contributors": null,
"retweet_count": 0,
"favorite_count": 1,
"entities": {
"hashtags": [],
"symbols": [],
"user_mentions": [
{
"screen_name": "Benj",
"name": "boy",
"id": 509529431,
"id_str": "509529431",
"indices": [
0,
14
]
}
],
"urls": []
},
"favorited": false,
"retweeted": false,
"lang": "en"
},
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "C0DEED",
"profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_tile": false,
"profile_image_url": "http://pbs.twimg.com/profile_images/2479745010/yz4eu6wrca8c5e2hw6x9_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/2479745010/yz4eu6wrca8c5e2hw6x9_normal.jpeg",
"profile_banner_url": "https://pbs.twimg.com/profile_banners/741935389/1444260221",
"profile_link_color": "0084B4",
"profile_sidebar_border_color": "C0DEED",
"profile_sidebar_fill_color": "DDEEF6",
"profile_text_color": "333333",
"profile_use_background_image": true,
"has_extended_profile": false,
"default_profile": true,
"default_profile_image": false,
"following": true,
"follow_request_sent": false,
"notifications": false,
"muting": false,
"blocking": false,
"blocked_by": false
}
This is what i am getting(supposing i have only 2 users in my following). What i need is as follows:
"geo": {
"type": "Point",
"coordinates": [
28.612486,
77.377425
]
},
"coordinates": {
"type": "Point",
"coordinates": [
77.377425,
28.612486
]
},
"geo": null,
"coordinates": null,
You need to filter out those details from the results yourself. The API will return the complete person object, not specific fields.
I am trying to download tweets from the London area using
curl --user xx:xx -X POST -d 'locations=-0.651,51.208,0.425,51.781' https://stream.twitter.com/1.1/statuses/filter.json > twitter.london.json
I am getting tweets that are way off. For example in (-6.71658144,50.48812681). Why is that?
The tweet:
{
"created_at": "Mon Apr 08 12:26:40 +0000 2013",
"id": 321237656321286144,
"id_str": "321237656321286144",
"text": "4dc9c54f70000000",
"source": "\u003ca href=\"http:\/\/www.google.com\/\" rel=\"nofollow\"\u003eGoogle\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": 61043461,
"id_str": "61043461",
"name": "GooGuns",
"screen_name": "googuns_prod",
"location": "",
"url": null,
"description": null,
"protected": false,
"followers_count": 86,
"friends_count": 0,
"listed_count": 2,
"created_at": "Tue Jul 28 22:49:22 +0000 2009",
"favourites_count": 0,
"utc_offset": -18000,
"time_zone": "Eastern Time (US & Canada)",
"geo_enabled": true,
"verified": false,
"statuses_count": 417708,
"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_3_normal.png",
"profile_image_url_https": "https:\/\/si0.twimg.com\/sticky\/default_profile_images\/default_profile_3_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": null,
"follow_request_sent": null,
"notifications": null
},
"geo": {
"type": "Point",
"coordinates": [50.48812681, -6.71658144]
},
* * "coordinates": {
"type": "Point",
"coordinates": [-6.71658144, 50.48812681]
},
* * "place": {
"id": "6416b8512febefc9",
"url": "http:\/\/api.twitter.com\/1\/geo\/id\/6416b8512febefc9.json",
"place_type": "country",
"name": "United Kingdom",
"full_name": "United Kingdom",
"country_code": "GB",
"country": "United Kingdom",
"contained_within": [],
"geometry": null,
"polylines": [],
"bounding_box": {
"type": "Polygon",
"coordinates": [
[
[-8.662663, 49.1626564],
[-8.662663, 60.86165],
[1.768926, 60.86165],
[1.768926, 49.1626564]
]
]
},
"attributes": {}
},
"contributors": null,
"retweet_count": 0,
"favorite_count": 0,
"entities": {
"hashtags": [],
"urls": [],
"user_mentions": []
},
"favorited": false,
"retweeted": false,
"filter_level": "medium",
"lang": "en"
}
According to the Twitter documentation, the location parameter accepts a comma separated list of longitude,latitude pairs specifying a set of bounding boxes.
If you just pass in a single latitude and longitude, then it will return the nearest Tweets to that location. Have you also specified a filter query, if so this will be massively cutting down the number of Tweets returned, meaning that the closest Tweet to London, is actually miles away. I had a similar problem.
Having said that, I just tried this out, if you use the lat and lon below, with NO other filter queries it works well.
{locations: [51.50,0.12,51.75,1.25]}
Another point to note, is that not a lot of Tweets actually have locations attached anymore, and often the ones which do are very inaccurate as they can actually be coming from the authors home location specified on their profile.