CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Twitter with Perl


New User

Sep 3, 2010, 6:14 AM

Post #1 of 1 (724 views)
Twitter with Perl Can't Post


sometime ago I have programmed a small web application with Perl which is using its own Twitter Account to tweet important events and news. Somehow this application and the tweets have become popular in Germany...

Now, Twitter has changed from basic authorization to OAuth ( and I am trying to implement OAuth with Perl.

I think, I have all what I need. I have the base string and the signature and I have validated it successfully with the OAuth tester (

But I don't know exactly how to send the HTTP request to Twitter using HTTP::Request (I don't have NET:OAuth and I cannot install it).

In the Twitter docu ( as well as in the OAuth spec ( it is shown what you need to send.

I tried to do it this way, but it is not working:

my $request = HTTP::Request->new(POST => $api_url); 
authorization => 'OAuth realm="',
oauth_nonce => $oauth_nonce,
oauth_signature_method => $oauth_signature_method,
oauth_timestamp => $oauth_timestamp,
oauth_consumer_key => $oauth_consumer_key,
oauth_token => $oauth_token,
oauth_signature => $signature,
oauth_version => $oauth_version
status => $status
$request->content_type("text/xml; charset=utf-8");
my $res = $ua->request($request);

But it is not working. Can you help me to create the correct request with HTTP::Request?



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives