/ Published in: Perl
Suitable for backup scripts.
Expand |
Embed | Plain Text
#!/usr/bin/perl use strict; use LWP::UserAgent; my $silent = 0; # set to 1 for no output on stdout my $logindata = { 'username' => 'fill in your username', 'password' => 'fill in your password', }; my $loginurl = 'http://snipplr.com/login/'; my $backupurl = 'http://snipplr.com/zipbackup.php'; my $backupdir = '.'; my $ua = LWP::UserAgent->new; $ua->cookie_jar({ file => "cookies.txt" }); my $devnull = $ua->get('http://snipplr.com/'); #get cookie my $loginresponse = $ua->post($loginurl, $logindata); my $backupfile = $ua->get($backupurl); binmode KI;
Comments
Subscribe to comments
You need to login to post a comment.

Hmm... I wish I knew what I was doing with this. It looks useful. Any working examples or a tutorial for an idiot in this subject?
I'm afraid I don't really understand you question... this is a very simple script, it just logs in to snipplr.com and downloads your own snippets if you fill your login data in the beginning of the script.
I just needed it for my nightly backup script to save everything I have here.