Why won't twitter use my coordinates?
I'm using the PHP twitteroauth library to post tweets to my account. I have latitude and longitude coordinat开发者_运维百科es for each tweet (it's for a client who's walking solo to the North Pole so it's quite interesting).
Here's the call
$connection->post('statuses/update', array(
"status"=> $tweet,
"lat" => 51.527407,
"long" => -0.081566
));
The API documentation is wonderfully example free, making it a pure joy to work with, but I think that's right.
I've also made sure that I've allowed location tweets in my twitter settings, but still nothing.
I'm finding API documentation regarding Locations is impenetrable.
You can see my ham-fisted attempts to get this working here...
Can anyone point out what I'm overlooking?
You should enable "display_coordinates" and "geo_enabled".
$post_status = $connection->post('statuses/update', array(
'status' => YOUR_MESSAGE,
'lat' => YOUR_LATITUDE,
'long' => YOUR_LONGITUDE,
'display_coordinates' => 'true',
'geo_enabled' => 'true'
));
Did you enable locations on the user's profile?
http://twitter.com/settings/account "Tweet Location"
Turns out the Lat and Long need to be strings.
$connection->post('statuses/update', array(
"status"=> $tweet,
"lat" => "51.527407",
"long" => "-0.081566"
));
See it working here
I feel dumb for not trying that sooner. Sorry about that.
Let me know, if its working in API console http://dev.twitter.com/console
精彩评论