perl - Twitter API Auth -


I have to get some twitter data (only username_name and password of my Twitter account). how can I do this? Is this possible? I know that it was possible almost 2 years ago. But I do not know what happens now, when I try to use Net :: Twitter :: Light (the Pearl module for it) with Basic Ath, it always returns 400 or 403 return codes. Code example:

  My $ nt = net :: Twitter :: Lite-> New (user name => "xxxx", password => "xxxx", legacy_lists_api = & gt; 0,); My $ result = eval {$ nt- & gt; Update ('hello, world!')};  

The result of $ is always empty, am I doing something wrong? Or maybe Twitter has blocked this opportunity to get its data.

First of all, Twitter recently updated the need for the SSL API, then enter your Net :: Twitter object:

  SSL => 1  

Above this, you will have to use an API 1.1 key-based login instead of the old username / password login which is disliked. I know that you have said that you want to use username / password, but due to security issues that handle third parties, Twitter; Store login details.

At the top, log in and generate a set of (read / write) keys. You should do something like this (taken directly from my codebase) - may be slightly different for net :: Twitter :: Lite , I have not used it:

< Pre = my $ net = net :: Twitter-> new (symptom => [qw / API :: RESTv1_1 /], consumer_key => $ consumer_key, consumer_secret => $ consumer_cent, access_token = & Gt; $ Token, access_token_secret = & gt; $ token_secret, ssl = & gt; 1);

From here, you'll find your update function:

  $ nt- & gt; Update ('must be able to call hello) world');  

Comments