Browse Source

Add gallery ids to file, use args to fetch specific years, and some

help text
master
Elis Hirwing 3 years ago
parent
commit
c9cde8299c
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 21
      main.php

21
main.php

@ -111,3 +111,24 @@ function getPhotoSetUrlsByPhotoSetId(int $photoSetId) : \Generator
}
}
}
// Map years to photo gallery ids
$photoGalleryIds = [
2016 => 3742586428944470221,
2017 => 3742586429170821662,
2018 => 3742586428889977272,
];
// Check arguments
if ($argv[1] === '--year' && isset($photoGalleryIds[$argv[2]])) {
// Loop through all galleries
foreach (getPhotoSetUrlsByPhotoSetId($photoGalleryIds[$argv[2]]) as $photoGallery) {
echo $photoGallery->group.' - '.$photoGallery->date.' - '.$photoGallery->url.PHP_EOL;
}
return;
}
// Print help
echo 'Usage: php '.$argv[0].' --year [year]'.PHP_EOL;
echo 'Valid years: '.implode(', ', array_keys($photoGalleryIds)).PHP_EOL;

Loading…
Cancel
Save