Cannot update geo #32

Closed
ccj opened this Issue Mar 2, 2012 · 5 comments

Projects

None yet

2 participants

@ccj
ccj commented Mar 2, 2012

$connection->url('1/statuses/update'), array("status" => $tweet_text, "lat" => $lat, "long" => $long, "display_coordinates" => 'true'));

Status is updated lat and long silently fail.

With Net-Twitter (Perl) this works
my $result = $nt->update({status => $tweet_text, lat=> $lat, long=>$long});

@themattharris themattharris was assigned Mar 2, 2012
@themattharris
Owner

Is geo enabled on the account you are trying to tweet to? Users can choose whether geo is enabled or not. It geo is disable the Twitter API will silently ignore the lat/long parameters. This is documented on dev.twitter.com in the statuses/update documentation: https://dev.twitter.com/docs/api/1/post/statuses/update

@ccj
ccj commented Mar 2, 2012

Thanks for your help.

Yes the account is geo enabled. I used the PERL script on that account and it worked.

@themattharris
Owner

Interesting, can you try again but this time var_dump the tmhOAuth connection when it finishes. I'd like to see the request params and how they are formatted.

When you copy the tmhOAuth object remember to remove the consumer_secret and oauth_secret (and any other information you don't want to share publicly)

@ccj
ccj commented Mar 3, 2012

oops! I can now. Using your sample code all works well. The code from http://140dev.com/twitter-api-programming-tutorials/hello-twitter-oauth-php/ seems to fail. Sorry to waste time
...
$connection->request('POST',
$connection->url('1/statuses/update'),
array("status" => $tweet_text, "lat" => $lat, "long" => $long));

return $connection->response['code'];

@themattharris
Owner

Great, glad you got it working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment