Browse Source

PSR-2 is important because it is

master
Alan Hardman 1 year ago
parent
commit
6d12a6d843
26 changed files with 727 additions and 728 deletions
  1. +25
    -25
      alicegrove.php
  2. +18
    -18
      blasternation.php
  3. +16
    -16
      commitstrip.php
  4. +36
    -36
      doa.php
  5. +36
    -36
      fanboys.php
  6. +33
    -33
      gaia.php
  7. +33
    -33
      girlswithslingshots.php
  8. +33
    -33
      gogetaroomie.php
  9. +36
    -36
      iamarg.php
  10. +38
    -39
      itswalky.php
  11. +7
    -7
      jl8.php
  12. +33
    -33
      kiwiblitz.php
  13. +27
    -27
      laura-kajpust-dailies.php
  14. +33
    -33
      letsspeakenglish.php
  15. +40
    -40
      licd.php
  16. +32
    -32
      loadingartist.php
  17. +15
    -15
      nerfnow.php
  18. +33
    -33
      octopuspie.php
  19. +19
    -19
      otaku-dad.php
  20. +15
    -15
      qc.php
  21. +33
    -33
      sandraandwoo.php
  22. +33
    -33
      sleeplessdomain.php
  23. +13
    -13
      sufficientlyremarkable.php
  24. +36
    -36
      superredundant.php
  25. +33
    -33
      twogag.php
  26. +21
    -21
      xkcd.php

+ 25
- 25
alicegrove.php View File

@@ -11,37 +11,37 @@
// Unfortunately the photoset filenames aren't always in the right order :/

if (!is_dir('alicegrove')) {
mkdir('alicegrove');
mkdir('alicegrove');
}

$start = 220;
$base = 'http://www.alicegrove.com/page/';

for ($i = $start; $i > 0; $i--) {
if ($i == 1) {
$html = file_get_contents('http://www.alicegrove.com/');
} else {
$html = file_get_contents('http://www.alicegrove.com/page/' . $i);
}
if (strpos($html, 'class="photoset"')) {
echo "Downloading photoset...\n";
preg_match('@src="(/post/[0-9]+/photoset_iframe/alicegrovecomic/tumblr_[^"]+)"@', $html, $frames);
$frame = file_get_contents('http://www.alicegrove.com' . $frames[1]);
preg_match_all('@href="(http://[0-9]+\\.media\\.tumblr\\.com/[^"]+_1280\\.png)"@', $frame, $matches);
foreach ($matches[1] as $url) {
$data = file_get_contents($url);
$name = basename($url);
echo "Downloading $name\n";
file_put_contents("alicegrove/$name", $data);
if ($i == 1) {
$html = file_get_contents('http://www.alicegrove.com/');
} else {
$html = file_get_contents('http://www.alicegrove.com/page/' . $i);
}
} else {
preg_match_all('@<figure class="photo-hires-item">\s*<a href="[^"]+"><img src="([^"]+)"@', $html, $matches);
foreach ($matches[1] as $url) {
$data = file_get_contents($url);
$name = basename($url);
echo "Downloading $name\n";
file_put_contents("alicegrove/$name", $data);
if (strpos($html, 'class="photoset"')) {
echo "Downloading photoset...\n";
preg_match('@src="(/post/[0-9]+/photoset_iframe/alicegrovecomic/tumblr_[^"]+)"@', $html, $frames);
$frame = file_get_contents('http://www.alicegrove.com' . $frames[1]);
preg_match_all('@href="(http://[0-9]+\\.media\\.tumblr\\.com/[^"]+_1280\\.png)"@', $frame, $matches);
foreach ($matches[1] as $url) {
$data = file_get_contents($url);
$name = basename($url);
echo "Downloading $name\n";
file_put_contents("alicegrove/$name", $data);
}
} else {
preg_match_all('@<figure class="photo-hires-item">\s*<a href="[^"]+"><img src="([^"]+)"@', $html, $matches);
foreach ($matches[1] as $url) {
$data = file_get_contents($url);
$name = basename($url);
echo "Downloading $name\n";
file_put_contents("alicegrove/$name", $data);
}
}
}
usleep(500000);
usleep(500000);
}

+ 18
- 18
blasternation.php View File

@@ -10,29 +10,29 @@ $start = 'http://www.blasternation.com/comic/1-one-day-in-the-life-of-matthew-pa
$end = 'http://www.blasternation.com/comic/516-end';

if (!is_dir('blasternation')) {
mkdir('blasternation');
mkdir('blasternation');
}

$url = $start;
while ($url != $end) {
$html = file_get_contents($url);
preg_match('@src="http://www.blasternation.com/comics/([0-9a-zA-Z-]+\\.[a-z]{3,4})" id="cc-comic"@', $html, $matches);
if (!empty($matches[1])) {
$name = trim(substr($url, 35), '/');
if (glob("blasternation/{$name}*")) {
return;
}
$html = file_get_contents($url);
preg_match('@src="http://www.blasternation.com/comics/([0-9a-zA-Z-]+\\.[a-z]{3,4})" id="cc-comic"@', $html, $matches);
if (!empty($matches[1])) {
$name = trim(substr($url, 35), '/');
if (glob("blasternation/{$name}*")) {
return;
}

echo "Downloading {$name}\n";
$data = @file_get_contents('http://www.blasternation.com/comics/' . $matches[1]);
if ($data) {
$ext = pathinfo(parse_url($matches[1])['path'], PATHINFO_EXTENSION);
file_put_contents('blasternation/' . $name . '.' . $ext, $data);
}
}
echo "Downloading {$name}\n";
$data = @file_get_contents('http://www.blasternation.com/comics/' . $matches[1]);
if ($data) {
$ext = pathinfo(parse_url($matches[1])['path'], PATHINFO_EXTENSION);
file_put_contents('blasternation/' . $name . '.' . $ext, $data);
}
}

preg_match('@rel="next" href="(http://www.blasternation.com/comic/[0-9a-zA-Z-]+/?)"@', $html, $matches);
$url = $matches[1];
preg_match('@rel="next" href="(http://www.blasternation.com/comic/[0-9a-zA-Z-]+/?)"@', $html, $matches);
$url = $matches[1];

usleep(500000);
usleep(500000);
}

+ 16
- 16
commitstrip.php View File

@@ -9,26 +9,26 @@
$start = 'https://www.commitstrip.com/en/2012/02/22/interview/';

if (!is_dir('commitstrip')) {
mkdir('commitstrip');
mkdir('commitstrip');
}

$url = $start;
while ($url) {
$html = file_get_contents($url);
preg_match('@src="https://www.commitstrip.com/wp-content/uploads/([0-9a-zA-Z/-]+\\.[a-z]{3,4})"@', $html, $matches);
if (!empty($matches[1])) {
$name = str_replace('/', '-', trim(substr($url, 31), '/'));
if (!glob("commitstrip/$name*")) {
$data = @file_get_contents('https://www.commitstrip.com/wp-content/uploads/' . $matches[1]);
if ($data) {
$ext = pathinfo(parse_url($matches[1])['path'], PATHINFO_EXTENSION);
file_put_contents("commitstrip/$name.$ext", $data);
}
}
}
$html = file_get_contents($url);
preg_match('@src="https://www.commitstrip.com/wp-content/uploads/([0-9a-zA-Z/-]+\\.[a-z]{3,4})"@', $html, $matches);
if (!empty($matches[1])) {
$name = str_replace('/', '-', trim(substr($url, 31), '/'));
if (!glob("commitstrip/$name*")) {
$data = @file_get_contents('https://www.commitstrip.com/wp-content/uploads/' . $matches[1]);
if ($data) {
$ext = pathinfo(parse_url($matches[1])['path'], PATHINFO_EXTENSION);
file_put_contents("commitstrip/$name.$ext", $data);
}
}
}

preg_match('@href="(https://www.commitstrip.com/20[^"]+)" rel="next"@', $html, $matches);
$url = str_replace('.com/20', '.com/en/20', $matches[1]);
preg_match('@href="(https://www.commitstrip.com/20[^"]+)" rel="next"@', $html, $matches);
$url = str_replace('.com/20', '.com/en/20', $matches[1]);

usleep(500000);
usleep(500000);
}

+ 36
- 36
doa.php View File

@@ -9,47 +9,47 @@ $html = file_get_contents('http://www.dumbingofage.com/');
preg_match('@/comics/(.+\\.png)@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('doa')) {
mkdir('doa');
mkdir('doa');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('doa/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.dumbingofage.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("doa/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(http://www.dumbingofage.com/[0-9a-zA-Z/-]+)" class="navi navi-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.png)@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(500000);
if (is_file('doa/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.dumbingofage.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("doa/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(http://www.dumbingofage.com/[0-9a-zA-Z/-]+)" class="navi navi-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.png)@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(500000);
}

+ 36
- 36
fanboys.php View File

@@ -9,47 +9,47 @@ $html = file_get_contents('http://www.fanboys-online.com/');
preg_match('@/comics/([^"]+\\.[a-z]{3,4})@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('fanboys')) {
mkdir('fanboys');
mkdir('fanboys');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('fanboys/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.fanboys-online.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("fanboys/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(/index\\.php\\?id=[0-9]+)" class="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents('http://www.fanboys-online.com' . $prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/([^"]+\\.[a-z]{3,4})@', $html, $matches);
if (empty($matches[1])) {
echo "No image found! Exiting.\n";
return;
}
usleep(500000);
if (is_file('fanboys/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.fanboys-online.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("fanboys/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(/index\\.php\\?id=[0-9]+)" class="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents('http://www.fanboys-online.com' . $prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/([^"]+\\.[a-z]{3,4})@', $html, $matches);
if (empty($matches[1])) {
echo "No image found! Exiting.\n";
return;
}
usleep(500000);
}

+ 33
- 33
gaia.php View File

@@ -7,47 +7,47 @@ $html = file_get_contents('http://www.sandraandwoo.com/gaia/');
preg_match('@/gaia/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('gaia')) {
mkdir('gaia');
mkdir('gaia');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('gaia/' . $matches[1])) {
return;
}
if (is_file('gaia/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.sandraandwoo.com/gaia/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("gaia/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.sandraandwoo.com/gaia/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("gaia/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@href="(http://www.sandraandwoo.com/gaia/[0-9]{4}/[0-9]+/[0-9]+/[0-9a-zA-Z-]+/?)" rel="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/gaia/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@href="(http://www.sandraandwoo.com/gaia/[0-9]{4}/[0-9]+/[0-9]+/[0-9a-zA-Z-]+/?)" rel="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/gaia/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 33
- 33
girlswithslingshots.php View File

@@ -9,47 +9,47 @@ $html = file_get_contents('http://girlswithslingshots.com/comic/gws-chaser-1000'
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('girlswithslingshots')) {
mkdir('girlswithslingshots');
mkdir('girlswithslingshots');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('girlswithslingshots/' . $matches[1])) {
return;
}
if (is_file('girlswithslingshots/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://girlswithslingshots.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("girlswithslingshots/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://girlswithslingshots.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("girlswithslingshots/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@rel="prev" href="(http://girlswithslingshots.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@rel="prev" href="(http://girlswithslingshots.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 33
- 33
gogetaroomie.php View File

@@ -6,47 +6,47 @@ $html = file_get_contents('http://www.gogetaroomie.com/');
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('gogetaroomie')) {
mkdir('gogetaroomie');
mkdir('gogetaroomie');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('gogetaroomie/' . $matches[1])) {
return;
}
if (is_file('gogetaroomie/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.gogetaroomie.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("gogetaroomie/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.gogetaroomie.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("gogetaroomie/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@rel="prev" href="(http://www.gogetaroomie.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@rel="prev" href="(http://www.gogetaroomie.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 36
- 36
iamarg.php View File

@@ -10,47 +10,47 @@ $html = file_get_contents('http://iamarg.com/');
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
exit(1);
echo "No comic found on home page! :(\n";
exit(1);
}

if (!is_dir('iamarg')) {
mkdir('iamarg');
mkdir('iamarg');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('iamarg/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://iamarg.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("iamarg/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(http://iamarg.com/[0-9a-zA-Z/-]+)" class="navi navi-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
if (is_file('iamarg/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://iamarg.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("iamarg/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(http://iamarg.com/[0-9a-zA-Z/-]+)" class="navi navi-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 38
- 39
itswalky.php View File

@@ -13,46 +13,45 @@ $years = range(2012, date('Y'));
$months = [1,12];

if (!is_dir('itswalky')) {
mkdir('itswalky');
mkdir('itswalky');
}

foreach ($years as $y) {
foreach ($months as $m) {
// Skip known nonexistent months
if ($y == 2012 && $m < 8) {
continue;
}
$dir = $base . sprintf('%d/%02d/', $y, $m);
$html = file_get_contents($dir);
preg_match_all('@<a href="([^/"]+)">@', $html, $matches);
foreach ($matches[1] as $file) {
// Remove thumbnails
if (preg_match('/-[0-9]+x[0-9]+\\.(png|gif)$/', $file)) {
continue;
}
// Remove non-comics for now
if (!preg_match('/^[0-9]{4}/', $file)) {
continue;
}
// Skip already downloaded images
if (is_file("itswalky/$file")) {
continue;
}
// Download image
echo "Downloading $file\n";
$url = $dir . $file;
$data = @file_get_contents($url);
if ($data) {
file_put_contents("itswalky/$file", $data);
}
usleep(500000);
}
}
foreach ($months as $m) {
// Skip known nonexistent months
if ($y == 2012 && $m < 8) {
continue;
}
$dir = $base . sprintf('%d/%02d/', $y, $m);
$html = file_get_contents($dir);
preg_match_all('@<a href="([^/"]+)">@', $html, $matches);
foreach ($matches[1] as $file) {
// Remove thumbnails
if (preg_match('/-[0-9]+x[0-9]+\\.(png|gif)$/', $file)) {
continue;
}
// Remove non-comics for now
if (!preg_match('/^[0-9]{4}/', $file)) {
continue;
}
// Skip already downloaded images
if (is_file("itswalky/$file")) {
continue;
}
// Download image
echo "Downloading $file\n";
$url = $dir . $file;
$data = @file_get_contents($url);
if ($data) {
file_put_contents("itswalky/$file", $data);
}
usleep(500000);
}
}
}


+ 7
- 7
jl8.php View File

@@ -7,17 +7,17 @@
// update this to pull from the actual Tumblr blog instead.

if (!is_dir('jl8')) {
mkdir('jl8');
mkdir('jl8');
}

$url = 'http://limbero.org/jl8/comics/';
$html = file_get_contents($url);
preg_match_all('@href="([^"]+\\.jpe?g)"@', $html, $matches);
foreach ($matches[1] as $img) {
if (!is_file('jl8/' . $img)) {
echo "Downloading $img\n";
$data = file_get_contents($url . $img);
file_put_contents('jl8/' . $img, $data);
usleep(500000);
}
if (!is_file('jl8/' . $img)) {
echo "Downloading $img\n";
$data = file_get_contents($url . $img);
file_put_contents('jl8/' . $img, $data);
usleep(500000);
}
}

+ 33
- 33
kiwiblitz.php View File

@@ -7,47 +7,47 @@ $html = file_get_contents('http://www.kiwiblitz.com/');
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('kiwiblitz')) {
mkdir('kiwiblitz');
mkdir('kiwiblitz');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('kiwiblitz/' . $matches[1])) {
return;
}
if (is_file('kiwiblitz/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.kiwiblitz.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("kiwiblitz/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.kiwiblitz.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("kiwiblitz/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@rel="prev" href="(http://www.kiwiblitz.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@rel="prev" href="(http://www.kiwiblitz.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 27
- 27
laura-kajpust-dailies.php View File

@@ -12,13 +12,13 @@ preg_match('@Date Posted:</strong> ([^<>]+)</div>@', $html, $dateMatches);
preg_match('@src="(https?:)?//((www|img[0-9]+).smackjeeves.com/images/uploaded/comics/[^"]+\\.(png|jpg|gif))@', $html, $matches);

if (empty($matches[2])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}
$date = date('Y-m-d-His', strtotime($dateMatches[1]));

if (!is_dir('laura-kajpust-dailies')) {
mkdir('laura-kajpust-dailies');
mkdir('laura-kajpust-dailies');
}

// Download current page's comic, load previous comic webpage, repeat
@@ -26,39 +26,39 @@ while (true) {
$ext = substr($matches[2], -3);
$name = basename($matches[2]);
$path = "laura-kajpust-dailies/$date-$name.$ext";
if (is_file($path)) {
return;
}
if (is_file($path)) {
return;
}

echo "Downloading {$matches[2]}\n";
$url = "http://{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents($path, $data);
}
echo "Downloading {$matches[2]}\n";
$url = "http://{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents($path, $data);
}

// Find previous page link
$regex = '@href="(http://falcdaily.smackjeeves.com/comics/[0-9a-zA-Z/-]+)"><i class="fa fa-angle-left"@';
preg_match($regex, $html, $prevMatch);
$regex = '@href="(http://falcdaily.smackjeeves.com/comics/[0-9a-zA-Z/-]+)"><i class="fa fa-angle-left"@';
preg_match($regex, $html, $prevMatch);

if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}

$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}

preg_match('@Date Posted:</strong> ([^<>]+)</div>@', $html, $dateMatches);
preg_match('@src="(https?:)?//((www|img[0-9]+).smackjeeves.com/images/uploaded/comics/[^"]+\\.(png|jpg|gif))@', $html, $matches);
if (empty($matches[2])) {
echo "No image found on page!\n";
return;
if (empty($matches[2])) {
echo "No image found on page!\n";
return;
}
$date = date('Y-m-d-His', strtotime($dateMatches[1]));

usleep(500000);
usleep(500000);
}

+ 33
- 33
letsspeakenglish.php View File

@@ -9,47 +9,47 @@ $html = file_get_contents('http://www.marycagle.com/letsspeakenglish/134-slow-mo
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('letsspeakenglish')) {
mkdir('letsspeakenglish');
mkdir('letsspeakenglish');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('letsspeakenglish/' . $matches[1])) {
return;
}
if (is_file('letsspeakenglish/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.marycagle.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("letsspeakenglish/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.marycagle.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("letsspeakenglish/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@rel="prev" href="(http://www.marycagle.com/letsspeakenglish/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@rel="prev" href="(http://www.marycagle.com/letsspeakenglish/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 40
- 40
licd.php View File

@@ -7,55 +7,55 @@ $home = file_get_contents('http://www.leasticoulddo.com/');
$regex = '@href="(http://www.leasticoulddo.com/comic/[0-9]+/?)" id="feature-comic"@';
preg_match($regex, $home, $homeMatch);
if (!empty($homeMatch[1])) {
$html = file_get_contents($homeMatch[1]);
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);
$html = file_get_contents($homeMatch[1]);
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);
} else {
echo "Unable to find link to latest comic! :(\n";
return;
echo "Unable to find link to latest comic! :(\n";
return;
}

if (empty($matches[2])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('licd')) {
mkdir('licd');
mkdir('licd');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('licd/' . $matches[1])) {
return;
}
echo "Downloading {$matches[2]}\n";
$url = "http://www.leasticoulddo.com/wp-content/uploads/{$matches[1]}/{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("licd/{$matches[2]}", $data);
}
// Find previous page link
$regex = '@href="(http://www.leasticoulddo.com/comic/[0-9]+/?)" id="nav-large-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(500000);
if (is_file('licd/' . $matches[1])) {
return;
}
echo "Downloading {$matches[2]}\n";
$url = "http://www.leasticoulddo.com/wp-content/uploads/{$matches[1]}/{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("licd/{$matches[2]}", $data);
}
// Find previous page link
$regex = '@href="(http://www.leasticoulddo.com/comic/[0-9]+/?)" id="nav-large-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(500000);
}

+ 32
- 32
loadingartist.php View File

@@ -7,43 +7,43 @@ $html = file_get_contents('https://loadingartist.com/latest');
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9a-zA-Z-]+\\.[a-z]{3,4})@', $html, $matches);

if (empty($matches[2])) {
echo "No comic found on starting page! :(\n";
return;
echo "No comic found on starting page! :(\n";
return;
}

if (!is_dir('loadingartist')) {
mkdir('loadingartist');
mkdir('loadingartist');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('loadingartist/' . $matches[1])) {
return;
}
echo "Downloading {$matches[2]}\n";
$url = "https://loadingartist.com/wp-content/uploads/{$matches[1]}/{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("loadingartist/{$matches[2]}", $data);
}
// Find previous page link
$regex = '@class="normal highlight prev comic-thumb" href="(https://loadingartist.com/comic/[0-9a-zA-Z-]+/?)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9a-zA-Z-]+\\.[a-z]{3,4})@', $html, $matches);
usleep(500000);
if (is_file('loadingartist/' . $matches[1])) {
return;
}
echo "Downloading {$matches[2]}\n";
$url = "https://loadingartist.com/wp-content/uploads/{$matches[1]}/{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("loadingartist/{$matches[2]}", $data);
}
// Find previous page link
$regex = '@class="normal highlight prev comic-thumb" href="(https://loadingartist.com/comic/[0-9a-zA-Z-]+/?)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/uploads/([0-9]+/[0-9]+)/([0-9a-zA-Z-]+\\.[a-z]{3,4})@', $html, $matches);
usleep(500000);
}

+ 15
- 15
nerfnow.php View File

@@ -11,30 +11,30 @@ $html = file_get_contents('http://www.nerfnow.com/');
preg_match('@/img/([0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);

if (!$matches[1]) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('nerfnow')) {
mkdir('nerfnow');
mkdir('nerfnow');
}

$start = $matches[1];

for ($i = $start; $i > 0; $i--) {
if (glob("nerfnow/$i-*")) {
continue;
}
if (glob("nerfnow/$i-*")) {
continue;
}

echo "Downloading #$i\n";
$html = file_get_contents('http://www.nerfnow.com/comic/' . $i);
preg_match('@/img/([0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);
echo "Downloading #$i\n";
$html = file_get_contents('http://www.nerfnow.com/comic/' . $i);
preg_match('@/img/([0-9]+)/([0-9]+\\.[a-z]{3,4})@', $html, $matches);

$url = "http://www.nerfnow.com/img/$i/{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("nerfnow/$i-{$matches[2]}", $data);
}
$url = "http://www.nerfnow.com/img/$i/{$matches[2]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("nerfnow/$i-{$matches[2]}", $data);
}

usleep(500000);
usleep(500000);
}

+ 33
- 33
octopuspie.php View File

@@ -8,47 +8,47 @@ $html = file_get_contents('http://www.octopuspie.com/2017-06-05/1023-1026-thats-
preg_match('@/strippy/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('octopuspie')) {
mkdir('octopuspie');
mkdir('octopuspie');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('octopuspie/' . $matches[1])) {
return;
}
if (is_file('octopuspie/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.octopuspie.com/strippy/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("octopuspie/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.octopuspie.com/strippy/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("octopuspie/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@href="(http://www.octopuspie.com/[0-9a-zA-Z/_-]+)" rel="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/strippy/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@href="(http://www.octopuspie.com/[0-9a-zA-Z/_-]+)" rel="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/strippy/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 19
- 19
otaku-dad.php View File

@@ -9,31 +9,31 @@ $start = 'http://www.otaku-dad.com/comic/i39m-embarrassed-by-my-otaku-dad';
$end = 'http://www.otaku-dad.com/comic/the-end';

if (!is_dir('otaku-dad')) {
mkdir('otaku-dad');
mkdir('otaku-dad');
}

$url = $start;
$i = 0;
while ($url != $end) {
$html = file_get_contents($url);
preg_match('@src="http://www.otaku-dad.com/comics/([0-9a-zA-Z-]+\\.[a-z]{3,4})" id="cc-comic"@', $html, $matches);
if (!empty($matches[1])) {
$name = trim(substr($url, 31), '/');
if (glob("otaku-dad/{$name}*")) {
return;
}
$html = file_get_contents($url);
preg_match('@src="http://www.otaku-dad.com/comics/([0-9a-zA-Z-]+\\.[a-z]{3,4})" id="cc-comic"@', $html, $matches);
if (!empty($matches[1])) {
$name = trim(substr($url, 31), '/');
if (glob("otaku-dad/{$name}*")) {
return;
}

echo "Downloading {$name}\n";
$data = @file_get_contents('http://www.otaku-dad.com/comics/' . $matches[1]);
if ($data) {
$ext = pathinfo(parse_url($matches[1])['path'], PATHINFO_EXTENSION);
file_put_contents("otaku-dad/" . str_pad($i, 2, '0', STR_PAD_LEFT) . "-$name.$ext", $data);
}
}
echo "Downloading {$name}\n";
$data = @file_get_contents('http://www.otaku-dad.com/comics/' . $matches[1]);
if ($data) {
$ext = pathinfo(parse_url($matches[1])['path'], PATHINFO_EXTENSION);
file_put_contents("otaku-dad/" . str_pad($i, 2, '0', STR_PAD_LEFT) . "-$name.$ext", $data);
}
}

preg_match('@href="(http://www.otaku-dad.com/comic/[0-9a-zA-Z-]+/?)" class="next"@', $html, $matches);
$url = $matches[1];
$i++;
preg_match('@href="(http://www.otaku-dad.com/comic/[0-9a-zA-Z-]+/?)" class="next"@', $html, $matches);
$url = $matches[1];
$i++;

usleep(500000);
usleep(500000);
}

+ 15
- 15
qc.php View File

@@ -9,27 +9,27 @@ $html = file_get_contents('http://www.questionablecontent.net/');
preg_match('@/comics/([0-9]+)\\.png@', $html, $matches);

if (!$matches[1]) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('qc')) {
mkdir('qc');
mkdir('qc');
}

$start = $matches[1];

for ($i = $start; $i > 0; $i--) {
if (is_file("qc/$i.png")) {
continue;
}
echo "Downloading #$i\n";
$url = "http://www.questionablecontent.net/comics/$i.png";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("qc/$i.png", $data);
}
usleep(500000);
if (is_file("qc/$i.png")) {
continue;
}
echo "Downloading #$i\n";
$url = "http://www.questionablecontent.net/comics/$i.png";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("qc/$i.png", $data);
}
usleep(500000);
}

+ 33
- 33
sandraandwoo.php View File

@@ -6,47 +6,47 @@ $html = file_get_contents('http://www.sandraandwoo.com/');
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('sandraandwoo')) {
mkdir('sandraandwoo');
mkdir('sandraandwoo');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('sandraandwoo/' . $matches[1])) {
return;
}
if (is_file('sandraandwoo/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.sandraandwoo.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("sandraandwoo/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.sandraandwoo.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("sandraandwoo/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@href="(http://www.sandraandwoo.com/[0-9]{4}/[0-9]+/[0-9]+/[0-9a-zA-Z-]+/?)" rel="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@href="(http://www.sandraandwoo.com/[0-9]{4}/[0-9]+/[0-9]+/[0-9a-zA-Z-]+/?)" rel="prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 33
- 33
sleeplessdomain.php View File

@@ -8,47 +8,47 @@ $html = file_get_contents('http://www.sleeplessdomain.com/');
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('sleeplessdomain')) {
mkdir('sleeplessdomain');
mkdir('sleeplessdomain');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('sleeplessdomain/' . $matches[1])) {
return;
}
if (is_file('sleeplessdomain/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://www.sleeplessdomain.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("sleeplessdomain/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://www.sleeplessdomain.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("sleeplessdomain/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@rel="prev" href="(http://www.sleeplessdomain.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@rel="prev" href="(http://www.sleeplessdomain.com/comic/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 13
- 13
sufficientlyremarkable.php View File

@@ -2,23 +2,23 @@
// Sufficiently Remarkable

if (!is_dir('sufficientlyremarkable')) {
mkdir('sufficientlyremarkable');
mkdir('sufficientlyremarkable');
}

$url = 'http://sufficientlyremarkable.com/';
while ($url) {
$html = file_get_contents($url);
preg_match("/data-current_comic_id=['\"]([0-9]+)['\"]/", $html, $idMatch);
preg_match('/src=[\'"]([^\'"]+)[\'"] class="comic"/', $html, $matches);
$name = basename($matches[1]);
if (!is_file("sufficientlyremarkable/{$idMatch[1]}-{$name}")) {
$data = file_get_contents($matches[1]);
echo "Downloading {$idMatch[1]}-{$name}\n";
file_put_contents("sufficientlyremarkable/{$idMatch[1]}-{$name}", $data);
}
$html = file_get_contents($url);
preg_match("/data-current_comic_id=['\"]([0-9]+)['\"]/", $html, $idMatch);
preg_match('/src=[\'"]([^\'"]+)[\'"] class="comic"/', $html, $matches);
$name = basename($matches[1]);
if (!is_file("sufficientlyremarkable/{$idMatch[1]}-{$name}")) {
$data = file_get_contents($matches[1]);
echo "Downloading {$idMatch[1]}-{$name}\n";
file_put_contents("sufficientlyremarkable/{$idMatch[1]}-{$name}", $data);
}

preg_match('/class="comicPagination nav-prev" href="([^"]+)"/', $html, $urlMatch);
$url = @$urlMatch[1];
preg_match('/class="comicPagination nav-prev" href="([^"]+)"/', $html, $urlMatch);
$url = @$urlMatch[1];

usleep(500000);
usleep(500000);
}

+ 36
- 36
superredundant.php View File

@@ -12,47 +12,47 @@ $html = file_get_contents('http://superredundant.com/');
preg_match('@<img src="http://superredundant.com/wp-content/uploads/([^"]+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
exit(1);
echo "No comic found on home page! :(\n";
exit(1);
}

if (!is_dir('superredundant')) {
mkdir('superredundant');
mkdir('superredundant');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('superredundant/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://superredundant.com/wp-content/uploads/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("superredundant/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(http://superredundant.com/[\\?0-9a-zA-Z/=-]+)" class="navi comic-nav-previous navi-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@<img src="http://superredundant.com/wp-content/uploads/([^"]+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
if (is_file('superredundant/' . $matches[1])) {
return;
}
echo "Downloading {$matches[1]}\n";
$url = "http://superredundant.com/wp-content/uploads/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("superredundant/{$matches[1]}", $data);
}
// Find previous page link
$regex = '@href="(http://superredundant.com/[\\?0-9a-zA-Z/=-]+)" class="navi comic-nav-previous navi-prev"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@<img src="http://superredundant.com/wp-content/uploads/([^"]+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 33
- 33
twogag.php View File

@@ -7,47 +7,47 @@ $html = file_get_contents('http://twogag.com/');
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);

if (empty($matches[1])) {
echo "No comic found on home page! :(\n";
return;
echo "No comic found on home page! :(\n";
return;
}

if (!is_dir('twogag')) {
mkdir('twogag');
mkdir('twogag');
}

// Download current page's comic, load previous comic webpage, repeat
while (true) {
if (is_file('twogag/' . $matches[1])) {
return;
}
if (is_file('twogag/' . $matches[1])) {
return;
}

echo "Downloading {$matches[1]}\n";
$url = "http://twogag.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("twogag/{$matches[1]}", $data);
}
echo "Downloading {$matches[1]}\n";
$url = "http://twogag.com/comics/{$matches[1]}";
$data = @file_get_contents($url);
if ($data) {
file_put_contents("twogag/{$matches[1]}", $data);
}

// Find previous page link
$regex = '@rel="prev" href="(http://twogag.com/archives/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
$regex = '@rel="prev" href="(http://twogag.com/archives/[0-9a-zA-Z-]+)"@';
preg_match($regex, $html, $prevMatch);
if (empty($prevMatch[1])) {
echo "No previous URL found!\n";
return;
}
$html = @file_get_contents($prevMatch[1]);
if (!$html) {
echo "Failed to load previous page!\n";
return;
}
preg_match('@/comics/(.+\\.(jpg|png|gif))@', $html, $matches);
if (empty($matches[1])) {
echo "No image found on page!\n";
return;
}
usleep(5e5);
}

+ 21
- 21
xkcd.php View File

@@ -8,30 +8,30 @@
$current = json_decode(file_get_contents('https://xkcd.com/info.0.json'));

if (!is_dir('xkcd')) {
mkdir('xkcd');
mkdir('xkcd');
}

for ($i = $current->num; $i > 0; $i--) {
if ($i == 404) {
continue;
}
if (glob('xkcd/' . $i . '-*')) {
continue;
}
$meta = json_decode(file_get_contents("https://xkcd.com/$i/info.0.json"));
if ($i == 404) {
continue;
}
if (glob('xkcd/' . $i . '-*')) {
continue;
}
$meta = json_decode(file_get_contents("https://xkcd.com/$i/info.0.json"));

echo "Downloading #$i - " . basename($meta->img), "\n";
$data = @file_get_contents($meta->img);
if ($data) {
file_put_contents("xkcd/$i-" . basename($meta->img), $data);
}
if ($i > 1084) {
// Download @2x img
$data = @file_get_contents(str_replace('.png', '_2x.png', $meta->img));
if ($data) {
file_put_contents("xkcd/$i-" . str_replace('.png', '_2x.png', basename($meta->img)), $data);
}
}
echo "Downloading #$i - " . basename($meta->img), "\n";
$data = @file_get_contents($meta->img);
if ($data) {
file_put_contents("xkcd/$i-" . basename($meta->img), $data);
}
if ($i > 1084) {
// Download @2x img
$data = @file_get_contents(str_replace('.png', '_2x.png', $meta->img));
if ($data) {
file_put_contents("xkcd/$i-" . str_replace('.png', '_2x.png', basename($meta->img)), $data);
}
}

usleep(500000);
usleep(500000);
}

Loading…
Cancel
Save