arul's code
free code snippets

Twitter script to set status

Twitter script to set status

This is a small script to automate Twitter status updates. Use it at your own risk. :)

Substitute MYUSERNAME for your real username and MYPASSWORD for your real password.


use strict;
use warnings;
use LWP::UserAgent;

# Set twitter status
my $status = shift || die "Enter Twitter status as parameter\n";

# Create user-agent
my $browser = LWP::UserAgent->new();
$browser->credentials('', 'Twitter API', 'MYUSERNAME', 'MYPASSWORD');
my $response = $browser->get('');
print $response->content."\n";
$response = $browser->post('', { status => $status });
print $response->content."\n";

Share this

Last Updated: Posted on 07 Feb 2015