in reply to Perl / New Twitter API

When I run your code without the eval, I get an error message:
use warnings; use strict; use Net::Twitter::Lite::WithAPIv1_1; use Scalar::Util 'blessed'; use Data::Dumper; my $nt = Net::Twitter::Lite::WithAPIv1_1->new(); my $terms = 'nyc'; # Just a test term my $r = $nt->search($terms); print Dumper($r); exit; __END__ 400: Bad Request

Replies are listed 'Best First'.
Re^2: Perl / New Twitter API
by DanielSpaniel (Scribe) on Jul 02, 2013 at 18:18 UTC

    Actually, I should have probably tried it without the eval block myself before posting; yes, I too just got the same 400 response.

    Odd. Even so, according to the module doc's the request is set up correctly, and I don't know what else might be wrong.

    I guess it literally is Twitter saying it's a bad request, but if anyone has any experience with the new API then I'd appreciate any thoughts.

    Thanks.

      Well, there's two bits that could be causing problems - Twitter's API, or the module isn't _quite_ right with their new API changes.

      If you're wanting to do something fairly straightforward, can you just hook straight into twitter? https://dev.twitter.com/docs/using-search

      I've just tried clicking through their example URLs, but it hasn't worked. But that might be a reasonable start point - after all, you can then just stick together using 'LWP'. I think that might be because (according to some quick and dirty googling) API 1.1 is now fussier about authentication.

      If you try opening: https://api.twitter.com/1.1/search/tweets.json?q=nyc - do you get a 215 'bad authentication' error like I do?