You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
4.0 KiB

  1. <?php
  2. // Crash Zoom Toon - Comics
  3. // https://www.crashzoomtoon.com/comics
  4. // This one is completely hard-coded right now as it relies on Wix's lightbox
  5. // system, which is unnecessarily hard to work with outside of an actual browser
  6. /*
  7. The Dustbusters URLs were determined by getting the source image URLs in the
  8. canvas elements and stripping the resampling parameters to get the originals:
  9. let items = document.querySelectorAll('.gallery-item');
  10. let images = [];
  11. items.forEach(item => {
  12. let src = item.getAttribute('data-src');
  13. if (src) {
  14. images.push(src).replace(/\/v1\/.+/, '');
  15. }
  16. });
  17. console.log(JSON.stringify(images));
  18. The other image URLs were manually taken from the DOM.
  19. */
  20. if (!is_dir('crashzoom')) {
  21. mkdir('crashzoom');
  22. }
  23. $data = [
  24. 'dustbusters' => [
  25. 'https://static.wixstatic.com/media/582a0a_dfc953b98ef84d569c6d827bb553bc84~mv2_d_1748_2480_s_2.png',
  26. 'https://static.wixstatic.com/media/582a0a_46721963409a4996a9470ce5d536b0df~mv2_d_3114_4354_s_4_2.png',
  27. 'https://static.wixstatic.com/media/582a0a_4e1ca341d2974968937c9e5a6e17a801~mv2_d_3169_4409_s_4_2.png',
  28. 'https://static.wixstatic.com/media/582a0a_10b1cb2523f444e0b2d721ab7365b41d~mv2_d_3169_4409_s_4_2.png',
  29. 'https://static.wixstatic.com/media/582a0a_7482d16d4d564ec5997f0290f0a21e74~mv2_d_3169_4409_s_4_2.png',
  30. 'https://static.wixstatic.com/media/582a0a_62622cf9ab1443ec9a72938018802f02~mv2_d_3169_4409_s_4_2.png',
  31. 'https://static.wixstatic.com/media/582a0a_fc1cdcb7c861471bbf78c0f2be740f2d~mv2_d_3169_4409_s_4_2.png',
  32. 'https://static.wixstatic.com/media/582a0a_379dc6c25b504706832ca0c256c86904~mv2_d_3169_4409_s_4_2.png',
  33. 'https://static.wixstatic.com/media/582a0a_18161b1aaf8646a9b4e0a50a6edfc771~mv2_d_3169_4409_s_4_2.png',
  34. 'https://static.wixstatic.com/media/582a0a_4f2b137aed38483f800b0d8937257152~mv2_d_3169_4409_s_4_2.png',
  35. 'https://static.wixstatic.com/media/582a0a_eda0f8eeaff04484972131ec368825b7~mv2_d_3169_4409_s_4_2.png',
  36. 'https://static.wixstatic.com/media/582a0a_1c3079a1df7d45db9a1ebe2831ea0a7d~mv2_d_3169_4409_s_4_2.png',
  37. 'https://static.wixstatic.com/media/582a0a_f66997a24b7d4b3ba7e4def34304da3a~mv2_d_3169_4409_s_4_2.png',
  38. 'https://static.wixstatic.com/media/582a0a_df57123d16684562ba52a86ec14901c1~mv2_d_3169_4409_s_4_2.png',
  39. 'https://static.wixstatic.com/media/582a0a_a7cead1d12f34b519063789e82a32c42~mv2_d_3169_4409_s_4_2.png',
  40. 'https://static.wixstatic.com/media/582a0a_f58a727a57354480a5eb9f05744c9013~mv2_d_3169_4409_s_4_2.png',
  41. 'https://static.wixstatic.com/media/582a0a_b39796008749483084f328c510a58e83~mv2_d_3169_4409_s_4_2.png',
  42. 'https://static.wixstatic.com/media/582a0a_dd456cbb336a4d8d8f56de33cfd6d0e8~mv2_d_3169_4409_s_4_2.png',
  43. 'https://static.wixstatic.com/media/582a0a_1342b388552843689d65420aefe8b05c~mv2_d_3169_4409_s_4_2.png',
  44. 'https://static.wixstatic.com/media/582a0a_1470051a0a7d473090de2b9f14fd6332~mv2_d_3169_4409_s_4_2.png',
  45. 'https://static.wixstatic.com/media/582a0a_f703e3d87ab245c2a4c4ce23c983d19f~mv2_d_3169_4409_s_4_2.png',
  46. 'https://static.wixstatic.com/media/582a0a_f89627d71ae44fe5ae1cacf6fe6d3c46~mv2_d_1748_2480_s_2.png',
  47. ],
  48. 'registered' => 'https://static.wixstatic.com/media/582a0a_5b94aa724dd3411aa747dcc2cea0bd72.png',
  49. 'jumper' => 'https://static.wixstatic.com/media/582a0a_6c4ddbe6b9104ed2972f7af2feb690c4.jpg',
  50. 'noise-complaint' => 'https://static.wixstatic.com/media/582a0a_c98e51356d4e4b58bfead9f71834d6cf.png',
  51. 'balloon' => 'https://static.wixstatic.com/media/582a0a_3881b0310c20474cb59b7e9169f7be83.png',
  52. ];
  53. foreach ($data as $name => $comic) {
  54. if (is_array($comic)) {
  55. foreach ($comic as $i => $page) {
  56. $ext = substr($page, -3);
  57. file_put_contents("crashzoom/$name-$i.$ext", file_get_contents($page));
  58. }
  59. } else {
  60. $ext = substr($comic, -3);
  61. file_put_contents("crashzoom/$name.$ext", file_get_contents($comic));
  62. }
  63. }