Hi,

Twitter recently updated their API (June 11th, 2013) and, not surprisingly, my code no longer works.

However, I found that, for Perl at least, it seemed an easy enough problem to solve, because a new/updated Perl module was also released to accommodate the new API.

My little test script is below:
#!/usr/bin/perl use strict; use Net::Twitter::Lite::WithAPIv1_1; use Scalar::Util 'blessed'; use Data::Dumper; my $nt=''; my $r=''; eval{ $nt = Net::Twitter::Lite::WithAPIv1_1->new; my $terms='nyc'; # Just a test term $r = $nt->search($terms); }; print Dumper($r); exit;

However, I never seem able to get data back, and the output from Dumper is always: $VAR1 = '', no matter what the search term.

So far as I can see I think I'm doing everything okay (module docs at: http://search.cpan.org/~mmims/Net-Twitter-Lite-0.12004/lib/Net/Twitter/Lite/WithAPIv1_1.pod), and from my perspective there's really not too much difference between using the new module and the old one.

I'm sure that many other people must also have had issues when Twitter updated their API, so I'm hoping maybe somebody can assist.

FYI, for reading tweets from Twitter, no authentication is required.

Any help would be much appreciated.

In reply to Perl / New Twitter API by DanielSpaniel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.