Last active
August 29, 2015 14:05
-
-
Save leipzig/050ee1d5346e70418718 to your computer and use it in GitHub Desktop.
access Haplogrep compatible input from a Genbank id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
my $userAgent = LWP::UserAgent->new(timeout => 1800); #a half-hour | |
my $request = POST 'http://mitomaster.mitomap.org/cgi-bin/websrvc.cgi', [ | |
gb => $ARGV[0], | |
fileType => 'id', | |
output => 'hsd' | |
]; | |
my $response = $userAgent->request($request); | |
print $response->error_as_HTML . "\n" if $response->is_error; | |
if ($response->is_success) { | |
print $response->decoded_content; | |
} else { | |
die $response->status_line; | |
} |
Author
leipzig
commented
Aug 20, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment