Skip to content

Instantly share code, notes, and snippets.

@coela
Created November 29, 2012 03:00
Show Gist options
  • Save coela/4166496 to your computer and use it in GitHub Desktop.
Save coela/4166496 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
my $referer = 'http://www.phosphosite.org/sequenceLogoAction.do';
my $url = 'http://www.phosphosite.org/sequenceLogoSubmitAction.do';
my $req = POST(
$url,
Content_Type => 'form-data',
Content => [
sequenceFile => ['./A2.txt'] ,
title => 'A2.txt',
logowidth => 18,
logoheight => 10,
firstnum => -6,
algorithm => 'freqTimesLogFold',
logounits => 'cm',
logostart => '',
logoend => ''
],
);
$req->referer($referer);
my $ua = LWP::UserAgent->new;
$ua->timeout(15);
$ua->agent('Mozilla');
my $response = $ua->request($req);
if ($response->is_success) {
print $response->content,"\n";
}
else{
print $response->status_line . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment