On 2010-04-27 00:04, sadnem(gmx) wrote:
I was wondering how could i make this kind of script to the 4 sites I
use (Netload,hotfile,x7.to and ugotfile) can anyone instrusct me a
little bit how to do it? (And yes, I´ve read
http://curl.haxx.se/docs/manual.html,
http://curl.haxx.se/docs/httpscripting.html and curl --help and I´m
still a curl newbie)
Hi!
I whipped up a simple perl script to upload a file to hotfile.com,
perhaps it can serve as an example for you.
Call it like this:
$ perl hotfile.pl <filename>
Good luck!
Linus
#!/usr/bin/perl
$filename = $ARGV[0];
# Download the frontpage to get the action URL
$homepage = `curl -Ls http://www.hotfile.com`;
$homepage =~ /action="(http:\/\/.*?upload.cgi.*?)"/;
$action = $1;
# Upload the file
$result = `curl -Ls -F "iagree=on" -F "uploads[...@$filename" $action`;
# Extract the download link
$result =~ m|(http://hotfile.com/dl/.*?\.html)|s;
print "Download link: $1\n";
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html