#!/usr/local/bin/perl # Copyright (C) 2008 Travis Spencer # All rights reserved # Licensed under the GNU GPL v. 2 # http://www.gnu.org/licenses/gpl-2.0.html use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use URI::Escape; use HTTP::Request; use Data::Dumper; use LWP::UserAgent; print header(-type => 'text/plain'); my $ua = LWP::UserAgent->new(); my $recording_url = uri_escape(param('RecordingUrl')); my $request = HTTP::Request->new("POST", "http://twitter.com/statuses/update.json", undef, "status=Someone has recording a greeting. " . "Click here to play it back: $recording_url"); $request->authorization_basic('tweetybot', 'PASSWORD'); my $response = $ua->request($request); open(LOG, ">>/home/linux/tspencer/tweetbot.log"); #print LOG "param('RecordingUrl') = ", param('RecordingUrl'), "\n"; #print LOG "Got the message: $recording_url\n"; #print LOG "Request: ", Dumper($request), "\n", print LOG "Response:", Dumper($response), "\n"; print "OK\n"; close(LOG);