So, perhaps all this is a little too advanced for a newb like me, however, let me explain what I'm trying to do:
I've got a website (what.cd) that uses authentication and cookies. What I want is a script or program that logs in, scrapes the site for anything labeled "Freeleech!" and downloads the associated file, which is actually a link titled "DL" right next to the "Freeleech!" label, then moves it to a certain directory.
I was told using Mojo::UserAgent would be best, so I installed the module and started looking at the documentation (http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Web-scraping).
This is the code I have so far:
#!/usr/bin/env perl -w
use strict;
use warnings;
use diagnostics;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $tx = $ua->get('what.cd');
my $cookie_jar = $ua->cookie_jar;
$ua = $ua->cookie_jar(Mojo::UserAgent::CookieJar->new);
say $ua->get('https://yuppie:password@what.cd/login.php')->res->body;
And here is the error it gives me:
Uncaught exception from user code:
Can't locate object method "say" via package "Mojo::UserAgent" at freeleech.pl line 15.
Is there a better way to go about this? I'm just trying to login right now.