I'm getting errors from trends_location - the error I'm seeing looks
something like this:
{"request":"\/1\/trends\/location.json?woeid=1","error":"No data for
WOEID location"}
Here's the code:
#!/usr/bin/perl -w
use strict;
use warnings;
use Carp;
use English qw(-no_match_vars);
use Net::Twitter;
my $handle = Net::Twitter->new();
my $available = $handle->trends_available;
foreach my $entry (@$available) {
my $name = $entry->{name};
my $woeid = $entry->{woeid};
print "${name} ${woeid}\n";
}
my $object = eval {$handle->trends_location(1)};
if ($EVAL_ERROR) {
print "Hello world";
}
exit;
I'm running this in Komodo - I can set breakpoints and dump things. It
looks like what's happening is that the request getting built is
http://api.twitter.com/1/trends/location.json?woeid=1
When I try that in http://app.apigee.com/console/twitter I get the same
error:
{
"request" : "/1/trends/location.json?woeid=1",
"error" : "No data for WOEID location"
}
What Apigee builds for this function is
http://api.twitter.com/1/trends/{woeid}.json
When I do this with {woeid} = 1, it works.
I think Twitter changed the API - their documentation isn't quite clear.