From a4cc90817a4613654d0e477749c27b3d3cfcdb84 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 12 Feb 2018 16:01:00 +0100 Subject: Fetch admin email from API if we have logged in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- bin/archweb-login.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/archweb-login.pl (limited to 'bin/archweb-login.pl') diff --git a/bin/archweb-login.pl b/bin/archweb-login.pl new file mode 100755 index 0000000..d66ecff --- /dev/null +++ b/bin/archweb-login.pl @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use File::Basename; +use Config::Tiny; +use WWW::Mechanize; +use HTTP::Cookies; + +my $Config = Config::Tiny->new(); +$Config = Config::Tiny->read(dirname($0) . "/../settings.conf"); + +my $cookie_jar = HTTP::Cookies->new(file => dirname($0) . "/../cookie_jar", autosave => 1); +my $mech = WWW::Mechanize->new(agent => "arch-mirror-tools", cookie_jar => $cookie_jar); + +$mech->get("https://www.archlinux.org/login/"); +my $res = $mech->submit_form( + form_id => "dev-login-form", + fields => { + username => $Config->{account}->{username}, + password => $Config->{account}->{password} + } +); -- cgit v1.2.3-24-g4f1b