Collect data for pledge rotation.

This commit is contained in:
Kim Taylor
2024-09-08 19:26:09 +10:00
parent 90a0fee735
commit ca0bab5071
3 changed files with 66 additions and 1 deletions

16
update-pledges.sh Normal file → Executable file
View File

@@ -1,8 +1,22 @@
#!/bin/bash
# If this runs as a cron job - might want to limit the number of revisions wordpress stores:
# wp-config.php:
# define( 'WP_POST_REVISIONS', 3 );
#wp post list --post_type=page
#wp post get 426 --field=content > current-homepage
#wp post get 1409 --field=content > movie-homepage
#wp post create --post_type=page --post_title="test_pledge" movie-homepage
#wp post update 1803 ../spl-data/movie-homepage
wp post update 1803 ../spl-data/movie-homepage
DATA_PATH="../spl-data"
candidates_files=()
for folder in "$DATA_PATH"/*; do
if test -f "$folder"/candidates.csv; then
candidates_files+=("$folder"/candidates.csv)
fi
done
php pledge-update/main.php --candidates-files "${candidates_files[*]}"