how to get fetlife photos #!/usr/bin/env perl # Download all FetLife pictures from a profile. # # Usage instructions: # * Fill in the constants. # * Make a folder named "images". # * Run the script. use strict; use warnings; use WWW::Mechanize; how to get fetlife photos PasteShr how to get fetlife photos use constant { USERNAME => 'username', PASSWORD => 'password', USERID => 'fetlife-userid' }; my $mech = WWW::Mechanize->new(); main($mech); how to get fetlife photos How to use it? how to get fetlife photos sub login { my $mech = shift; $mech->get('https://fetlife.com/login'); $mech->submit_form( with_fields => { 'nickname_or_email' => USERNAME, 'password' => PASSWORD how to get fetlife photos PasteShr how to get fetlife photos } ); } sub getPicturesOf { my $mech = shift; my $uid = shift; $mech->get("https://fetlife.com/users/$uid/pictures"); how to get fetlife photos How to use it? how to get fetlife photos my $next = $mech->find_link(text_regex => qr/Next /); while (defined($next)) { $next = $next->url; downloadPictures($mech, $uid); $mech->get("https://fetlife.com/$next"); $next = $mech->find_link(text_regex => qr/Next /); } downloadPictures($mech, $uid); } how to get fetlife photos How to get it for free? how to get fetlife photos sub downloadPictures { my $mech = shift; my $uid = shift; my @images = $mech->find_all_images(url_regex => qr{https://flpics\d.a.ssl.fastly.net/\d+/$uid/}); map { my $imgurl = $_->url; $imgurl =~ s/\d+\.jpg$/720.jpg/; if ($imgurl =~ m{/([^/]+)$}) { how to get fetlife photos How to get it? how to get fetlife photos print "Downloading $1\n"; $mech->get($imgurl, ":content_file" => "images/$1"); } else { print "No go.\n"; } } @images; } sub main { how to get fetlife photos How to use it? how to get fetlife photos my $mech = shift; login($mech); getPicturesOf($mech, USERID); } how to get fetlife photos