Skip to content

Instantly share code, notes, and snippets.

Created August 6, 2015 03:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Downloads projects from d.o to increase download count
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Request;
use LWP::UserAgent;
use Data::Dumper;
my $source = '<PROJECT LINK>';
#my $agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36"';
my $agent = 'DrupalDownloader/0.9';
our $ua;
sub create_request {
$ua = LWP::UserAgent->new;
sub download ($) {
my $count = shift;
print $count, "\n";
my $response = $ua->request(HTTP::Request->new(GET => $source));
if (!$response->is_success) {
print STDERR $response->status_line, "\n";
else {
print $response->status_line, "\n";
sub main {
my $pid;
for my $count (1..2) {
$pid = fork;
if ($pid == 0) {
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment