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

help text
master
Elis Hirwing 2018-12-23 12:51:11 +01:00
parent d1aa2445b5
commit c9cde8299c
Signed by: etu
GPG Key ID: D57EFA625C9A925F
1 changed files with 21 additions and 0 deletions

View File

@ -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;