Last active
August 28, 2026 20:30
-
-
Save lucasrangit/2acdd2a6a857f333a126b51192458eef to your computer and use it in GitHub Desktop.
Berlin Hack & Tell script that migrates meetup-archiver event photos to grain.social using grain_uploader.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Batch create Grain galleries for Berlin Hack and Tell events | |
| set -euo pipefail | |
| BASE_DIR="${1:-/home/$USER/Pictures/berlin-hack-and-tell}" | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| # Load .env if present | |
| if [ -f "$SCRIPT_DIR/.env" ]; then | |
| # shellcheck disable=SC1091 | |
| set -a | |
| source "$SCRIPT_DIR/.env" | |
| set +a | |
| fi | |
| # Map BLUESKY_APP_TOKEN to BSKY_APP_PASSWORD if needed | |
| export BSKY_APP_PASSWORD="${BSKY_APP_PASSWORD:-${BLUESKY_APP_TOKEN:-}}" | |
| upload_event() { | |
| local dir_name="$1" | |
| local bhnt_tag="$2" | |
| local event_url="${3:-https://bhnt.c-base.org/}" | |
| local event_dir="$BASE_DIR/$dir_name" | |
| local photos_dir="$event_dir/photos" | |
| if [ ! -d "$photos_dir" ] || [ -z "$(ls -A "$photos_dir" 2>/dev/null)" ]; then | |
| echo "⏭️ Skipping $dir_name (no photos)" | |
| return 0 | |
| fi | |
| # Parse YYYYMMDD date prefix and convert to YYYY-MM-DD | |
| local event_date="" | |
| local title="$dir_name" | |
| if [[ "$dir_name" =~ ^([0-9]{4})([0-9]{2})([0-9]{2})-(.*)$ ]]; then | |
| event_date="${BASH_REMATCH[1]}-${BASH_REMATCH[2]}-${BASH_REMATCH[3]}" | |
| local rest="${BASH_REMATCH[4]}" | |
| title="${event_date}-${rest}" | |
| fi | |
| local description="$bhnt_tag" | |
| if [ -n "$event_date" ]; then | |
| description="$description $event_date" | |
| fi | |
| description="$description @bhnt.c-base.org $event_url" | |
| echo "==================================================" | |
| echo "🚀 Uploading: $title" | |
| echo " Description: $description" | |
| echo " Directory: $photos_dir" | |
| echo "==================================================" | |
| if [ "${DRY_RUN:-0}" = "1" ]; then | |
| echo " [DRY RUN] Would run: uv run \"$SCRIPT_DIR/grain_upload.py\" --images \"$photos_dir\" --title \"$title\" --description \"$description\"" | |
| return 0 | |
| fi | |
| uv run "$SCRIPT_DIR/grain_upload.py" \ | |
| --images "$photos_dir" \ | |
| --title "$title" \ | |
| --description "$description" | |
| } | |
| upload_event "20110607-the-first-berlin-hack-and-tell" "BHNT #1" "https://bhnt.c-base.org/2011-06-07-no1-the-first-berlin-hack-and-tell" | |
| upload_event "20110621-2nd-hack-and-tell-in-berlin" "BHNT #2" "https://bhnt.c-base.org/2011-06-21-no2-2nd-hack-and-tell-in-berlin" | |
| upload_event "20110719-berlin-hack-and-tell-3" "BHNT #3" "https://bhnt.c-base.org/2011-07-19-no3" | |
| upload_event "20110830-berlin-hack-and-tell-4" "BHNT #4" "https://bhnt.c-base.org/2011-08-30-no4" | |
| upload_event "20111011-berlin-hack-and-tell-5" "BHNT #5" "https://bhnt.c-base.org/2011-10-11-no5" | |
| upload_event "20111117-berlin-hack-and-tell-6-gdd-edition" "BHNT #6" "https://bhnt.c-base.org/2011-11-17-no6-gdd-edition" | |
| upload_event "20111213-berlin-hack-and-tell-7" "BHNT #7" "https://bhnt.c-base.org/2011-12-13-no7" | |
| upload_event "20111217-special-api-hackathon-berlin-powered-by-geeklist" "BHNT Special" "https://bhnt.c-base.org/" | |
| upload_event "20120131-berlin-hack-and-tell-8-inhackable" "BHNT #8" "https://bhnt.c-base.org/2012-01-31-no8-inhackable" | |
| upload_event "20120228-berlin-hack-and-tell-9" "BHNT #9" "https://bhnt.c-base.org/2012-02-28-no9" | |
| upload_event "20120424-berlin-hack-and-tell-10" "BHNT #10" "https://bhnt.c-base.org/2012-04-24-no10" | |
| upload_event "20120529-berlin-hack-and-tell-11-birthday-bash" "BHNT #11" "https://bhnt.c-base.org/2012-05-29-no11-birthday-bash" | |
| upload_event "20120626-berlin-hack-and-tell-12" "BHNT #12" "https://bhnt.c-base.org/2012-06-26-no12" | |
| upload_event "20120731-berlin-hack-and-tell-13-lucky-number-13" "BHNT #13" "https://bhnt.c-base.org/2012-07-31-no13-lucky-number-13" | |
| upload_event "20120824-berlin-hack-and-tell-14-trip-to-campus-party" "BHNT #14" "https://bhnt.c-base.org/2012-08-24-no14-trip-to-campus-party" | |
| upload_event "20121002-berlin-hack-and-tell-15" "BHNT #15" "https://bhnt.c-base.org/2012-10-02-no15" | |
| upload_event "20121030-berlin-hack-and-tell-16-tobis-farewell-party" "BHNT #16" "https://bhnt.c-base.org/2012-10-30-no16-tobis-farewell-party" | |
| upload_event "20121211-berlin-hack-and-tell-17-almost-christmas-party" "BHNT #17" "https://bhnt.c-base.org/2012-12-11-no17-almost-christmas-party" | |
| upload_event "20130129-berlin-hack-and-tell-18-bwiwab" "BHNT #18" "https://bhnt.c-base.org/2013-01-29-no18-bwiwab" | |
| upload_event "20130325-berlin-hack-and-tell-19-twice-as-good" "BHNT #19" "https://bhnt.c-base.org/2013-03-25-no19-twice-as-good" | |
| upload_event "20130430-berlin-hack-and-tell-20-return-of-spring" "BHNT #20" "https://bhnt.c-base.org/2013-04-30-no20-return-of-spring" | |
| upload_event "20130528-berlin-hack-and-tell-21-let-the-summer-begin" "BHNT #21" "https://bhnt.c-base.org/2013-05-28-no21-let-the-summer-begin" | |
| upload_event "20130625-berlin-hack-and-tell-22-summer-hacks" "BHNT #22" "https://bhnt.c-base.org/2013-06-25-no22-summer-hacks" | |
| upload_event "20130827-berlin-hack-and-tell-23-vacation-is-over-lets-get-back-to-code" "BHNT #23" "https://bhnt.c-base.org/2013-08-27-no23-vacation-is-over-lets-get-back-to-code" | |
| upload_event "20130924-berlin-hack-and-tell-24-schools-on-time-to-learn-new-tricks" "BHNT #24" "https://bhnt.c-base.org/2013-09-24-no24-schools-on-time-to-learn-new-tricks" | |
| upload_event "20131029-berlin-hack-and-tell-25-almost-spooky" "BHNT #25" "https://bhnt.c-base.org/2013-10-29-no25-almost-spooky" | |
| upload_event "20131126-berlin-hack-and-tell-26-best-of-2013" "BHNT #26" "https://bhnt.c-base.org/2013-11-26-no26-best-of-2013" | |
| upload_event "20140128-berlin-hack-and-tell-27-new-year" "BHNT #27" "https://bhnt.c-base.org/2014-01-28-no27-new-year" | |
| upload_event "20140225-berlin-hack-and-tell-28-winter-hacks" "BHNT #28" "https://bhnt.c-base.org/2014-02-25-no28-winter-hacks" | |
| upload_event "20140429-berlin-hack-and-tell-29-back-in-hack" "BHNT #29" "https://bhnt.c-base.org/2014-04-29-no29-back-in-hack" | |
| upload_event "20140826-berlin-hack-and-tell-30-back-from-the-dead" "BHNT #30" "https://bhnt.c-base.org/2014-08-26-no30-back-from-the-dead" | |
| upload_event "20150127-berlin-hack-and-tell-31-reboot" "BHNT #31" "https://bhnt.c-base.org/2015-01-27-no31-reboot" | |
| upload_event "20150224-berlin-hack-and-tell-32-carnival-is-gone" "BHNT #32" "https://bhnt.c-base.org/2015-02-24-no32-carnival-is-gone" | |
| upload_event "20150331-berlin-hack-and-tell-33-spring-season-is-open" "BHNT #33" "https://bhnt.c-base.org/2015-03-31-no33-spring-season-is-open" | |
| upload_event "20150428-berlin-hack-and-tell-34-april-fools-hacks" "BHNT #34" "https://bhnt.c-base.org/2015-04-28-no34-april-fools-hacks" | |
| upload_event "20150526-berlin-hack-and-tell-35-hack-una-may-tata" "BHNT #35" "https://bhnt.c-base.org/2015-05-26-no35-hack-una-may-tata" | |
| upload_event "20150630-berlin-hack-and-tell-36-diving-into-code" "BHNT #36" "https://bhnt.c-base.org/2015-06-30-no36-diving-into-code" | |
| upload_event "20150728-berlin-hack-and-tell-37-july-andrews" "BHNT #37" "https://bhnt.c-base.org/2015-07-28-no37-july-andrews" | |
| upload_event "20150929-berlin-hack-and-tell-38-schools-back-on" "BHNT #38" "https://bhnt.c-base.org/2015-09-29-no38-schools-back-on" | |
| upload_event "20151027-berlin-hack-and-tell-39-hacktoberfest" "BHNT #39" "https://bhnt.c-base.org/2015-10-27-no39-hacktoberfest" | |
| upload_event "20151124-berlin-hack-and-tell-40-last-meetup-for-2015" "BHNT #40" "https://bhnt.c-base.org/2015-11-24-no40-last-meetup-for-2015" | |
| upload_event "20160126-berlin-hack-and-tell-41-start2016" "BHNT #41" "https://bhnt.c-base.org/2016-01-26-no41-start2016" | |
| upload_event "20160223-berlin-hack-and-tell-42-hackers-guide-to-the-galaxy" "BHNT #42" "https://bhnt.c-base.org/2016-02-23-no42-hackers-guide-to-the-galaxy" | |
| upload_event "20160329-berlin-hack-and-tell-43-easter-heggs" "BHNT #43" "https://bhnt.c-base.org/2016-03-29-no43-easter-heggs" | |
| upload_event "20160426-berlin-hack-and-tell-44-springtime-hacking" "BHNT #44" "https://bhnt.c-base.org/2016-04-26-no44-springtime-hacking" | |
| upload_event "20160531-berlin-hack-and-tell-45-summerhackertime" "BHNT #45" "https://bhnt.c-base.org/2016-05-31-no45-summerhackertime" | |
| upload_event "20160927-berlin-hack-and-tell-46-autumn-calling" "BHNT #46" "https://bhnt.c-base.org/2016-09-27-no46-autumn-calling" | |
| upload_event "20161025-berlin-hack-and-tell-46-october-spooks" "BHNT #47" "https://bhnt.c-base.org/2016-10-25-no47-october-spooks" | |
| upload_event "20161129-berlin-hack-tell-48-bye-forever-2016" "BHNT #48" "https://bhnt.c-base.org/2016-11-29-no48-bye-forever-2016" | |
| upload_event "20170131-berlin-hack-tell-49-hello-2017" "BHNT #49" "https://bhnt.c-base.org/2017-01-31-no49-hello-2017" | |
| upload_event "20170228-berlin-hack-tell-0x0032-tracing-rays" "BHNT #50" "https://bhnt.c-base.org/2017-02-28-no0x0032-tracing-rays" | |
| upload_event "20170425-berlin-hack-tell-51-twice-as-good" "BHNT #51" "https://bhnt.c-base.org/2017-04-25-no51-twice-as-good" | |
| upload_event "20170530-berlin-hack-tell-52-bhnttitles51" "BHNT #52" "https://bhnt.c-base.org/2017-05-30-no52-bhnttitles51" | |
| upload_event "20170627-berlin-hack-tell-53-the-hackening" "BHNT #53" "https://bhnt.c-base.org/2017-06-27-no53-the-hackening" | |
| upload_event "20170725-berlin-hack-tell-54-itshappeninggif" "BHNT #54" "https://bhnt.c-base.org/2017-07-25-no54-itshappeninggif" | |
| upload_event "20170829-berlin-hack-tell-55-post-eclipse-hacking" "BHNT #55" "https://bhnt.c-base.org/2017-08-29-no55-post-eclipse-hacking" | |
| upload_event "20171031-berlin-hack-tell-56-hackoween" "BHNT #56" "https://bhnt.c-base.org/2017-10-31-no56-hackoween" | |
| upload_event "20180130-berlin-hack-tell-57-off-by-one" "BHNT #57" "https://bhnt.c-base.org/2018-01-30-no57-off-by-one" | |
| upload_event "20180227-berlin-hack-tell-58-hacking-heavy" "BHNT #58" "https://bhnt.c-base.org/2018-02-27-no58-hacking-heavy" | |
| upload_event "20180327-berlin-hack-tell-59-stephen-hacking" "BHNT #59" "https://bhnt.c-base.org/2018-03-27-no59-stephen-hacking" | |
| upload_event "20180424-berlin-hack-tell-60-hacker-hearing" "BHNT #60" "https://bhnt.c-base.org/2018-04-24-no60-hacker-hearing" | |
| upload_event "20180529-berlin-hack-tell-61-revolutionary-may-hacks" "BHNT #61" "https://bhnt.c-base.org/2018-05-29-no61-revolutionary-may-hacks" | |
| upload_event "20180626-berlin-hack-tell-62-summer-ish-hacks" "BHNT #62" "https://bhnt.c-base.org/2018-06-26-no62-summer-ish-hacks" | |
| upload_event "20180731-berlin-hack-tell-63-meltdown" "BHNT #63" "https://bhnt.c-base.org/2018-07-31-no63-meltdown" | |
| upload_event "20180828-berlin-hack-tell-64-hackable" "BHNT #64" "https://bhnt.c-base.org/2018-08-28-no64-hackable" | |
| upload_event "20180925-berlin-hack-tell-65-dear-moon-hacks" "BHNT #65" "https://bhnt.c-base.org/2018-09-25-no65-dear-moon-hacks" | |
| upload_event "20181127-berlin-hack-tell-66-every-hack-is-a-target" "BHNT #66" "https://bhnt.c-base.org/2018-11-27-no66-every-hack-is-a-target" | |
| upload_event "20190129-berlin-hack-tell-67-hacking-memories" "BHNT #67" "https://bhnt.c-base.org/2019-01-29-no67-hacking-memories" | |
| upload_event "20190226-berlin-hack-tell-68-de-obfuscate-your-hacks" "BHNT #68" "https://bhnt.c-base.org/2019-02-26-no68-de-obfuscate-your-hacks" | |
| upload_event "20190326-berlin-hack-tell-69-upload-your-hacks" "BHNT #69" "https://bhnt.c-base.org/2019-03-26-no69-upload-your-hacks" | |
| upload_event "20190430-berlin-hack-tell-70-black-hole-tell" "BHNT #70" "https://bhnt.c-base.org/2019-04-30-black-hold-and-tell" | |
| upload_event "20190528-berlin-hack-tell-72-electing-hacks" "BHNT #71" "https://bhnt.c-base.org/2019-05-28-no71-electing-hacks" | |
| upload_event "20190625-berlin-hack-tell-72-off-by-one" "BHNT #72" "https://bhnt.c-base.org/2019-06-25-no72-off-by-one" | |
| upload_event "20190730-berlin-hack-tell-73-libre-not-libra" "BHNT #73" "https://bhnt.c-base.org/2019-07-30-no73-libre-not-libra" | |
| upload_event "20190924-berlin-hack-tell-74-post-cccamp19-hacks" "BHNT #74" "https://bhnt.c-base.org/2019-09-24-no74-post-cccamp19-hacks" | |
| upload_event "20191029-berlin-hack-tell-75-open-hardware-hacks" "BHNT #75" "https://bhnt.c-base.org/2019-10-29-no75-open-hardware-hacks" | |
| upload_event "20191126-berlin-hack-tell-76-cyberhacks" "BHNT #76" "https://bhnt.c-base.org/2019-11-26-no76-cyber-hacks" | |
| upload_event "20200128-berlin-hack-tell-77-hacking-2020" "BHNT #77" "https://bhnt.c-base.org/2020-01-28-no77-hacking-2020" | |
| upload_event "20200225-berlin-hack-tell-78-flash-your-hacks" "BHNT #78" "https://bhnt.c-base.org/2020-02-25-no78-flash-your-hacks" | |
| upload_event "20210831-bhnt-79-lockdown-hacks" "BHNT #79" "https://bhnt.c-base.org/2021-08-31-no79-lockdown-hacks" | |
| upload_event "20211026-bhnt-80-0b10g" "BHNT #80" "https://bhnt.c-base.org/2021-10-26-no80-0b10G" | |
| upload_event "20220531-rebooting-bhnt-may-2022" "BHNT #81" "https://bhnt.c-base.org/2022-05-31-no81-rebooting-bhnt" | |
| upload_event "20220927-panda-hacks-september-2022" "BHNT #82" "https://bhnt.c-base.org/2022-09-27-no82-panda-hacks" | |
| upload_event "20221129-hacks-sink-in-november-2022" "BHNT #83" "https://bhnt.c-base.org/2022-11-29-no83-hacks-sink-in" | |
| upload_event "20221227-hacks-in-parallel-bhnt-84-december-2022" "BHNT #84" "https://bhnt.c-base.org/2022-12-27-no84-hacks-in-parallel" | |
| upload_event "20230131-illuminati-hacks-january-2023" "BHNT Special" "https://bhnt.c-base.org/2023-01-31-no85-illuminati-hacks" | |
| upload_event "20230228-hackgpt-bhnt-86-february-2023" "BHNT #86" "https://bhnt.c-base.org/2023-02-28-no86-hackgpt" | |
| upload_event "20230328-moore-hacks-bhnt-87" "BHNT #87" "https://bhnt.c-base.org/2023-03-28-no87-moore-hacks" | |
| upload_event "20230425-shacka-bhnt-88" "BHNT #88" "https://bhnt.c-base.org/2023-04-25-no88-shacka" | |
| upload_event "20230725-camping-hacks-bhnt-89" "BHNT #89" "https://bhnt.c-base.org/2023-07-25-no89-camping-hacks" | |
| upload_event "20230926-post-utopia-hacks-bhnt-90" "BHNT #90" "https://bhnt.c-base.org/2023-09-26-no90-post-utopia-hacks" | |
| upload_event "20231031-hacks-of-spooky-times-bhnt-91" "BHNT #91" "https://bhnt.c-base.org/2023-10-31-no91-hacks-of-spooky-times" | |
| upload_event "20231128-closedai-hacks-bhnt-92" "BHNT #92" "https://bhnt.c-base.org/2023-11-28-no92-closedai-hacks" | |
| upload_event "20240130-unlocked-hacks-bhnt-93" "BHNT #93" "https://bhnt.c-base.org/2024-01-30-no93-unlocked-hacks" | |
| upload_event "20240227-reality-hacks-bhnt-94" "BHNT #94" "https://bhnt.c-base.org/2024-02-27-no94-reality-hacks" | |
| upload_event "20240326-devins-hacks-bhnt-95" "BHNT #95" "https://bhnt.c-base.org/2024-03-26-no95-devin-s-hacks" | |
| upload_event "20240528-portal-hacks-bhnt-96" "BHNT #96" "https://bhnt.c-base.org/2024-05-28-no96-portal-hacks" | |
| upload_event "20240730-crowdstruck-bhnt-97" "BHNT #97" "https://bhnt.c-base.org/2024-07-30-no97-crowdstruck" | |
| upload_event "20240827-groky-hacks-bhnt-98" "BHNT #98" "https://bhnt.c-base.org/2024-08-27-no98-groky-hacks" | |
| upload_event "20240924-reasoning-hacks-bhnt-99" "BHNT #99" "https://bhnt.c-base.org/2024-09-24-no99-reasoning-hacks" | |
| upload_event "20241029-annivercultureommunicationarboniteary-bhnt-100" "BHNT #100" "https://bhnt.c-base.org/2024-10-29-no100-annivercary" | |
| upload_event "20250128-singularity-inauguration-hacks-bhnt-101" "BHNT #101" "https://bhnt.c-base.org/2025-01-28-no101-singularity-inauguration-hacks" | |
| upload_event "20250225-gulf-of-hacks-bhnt-102" "BHNT #102" "https://bhnt.c-base.org/2025-02-25-no102-gulf-of-hacks" | |
| upload_event "20250429-plutocracy-on-signal-bhnt-103" "BHNT #103" "https://bhnt.c-base.org/2025-04-29-no103-plutocracy-on-signal" | |
| upload_event "20250527-habemus-hacker-bhnt-104" "BHNT #104" "https://bhnt.c-base.org/2025-05-27-no104-habemus-hacker" | |
| upload_event "20250729-mechahacker-bhnt-105" "BHNT #105" "https://bhnt.c-base.org/2025-07-29-no105-mechahacker" | |
| upload_event "20250930-30years-c-base-bhnt-106" "BHNT #106" "https://bhnt.c-base.org/2025-09-30-no106-hacks-of-30years-cbase" | |
| upload_event "20251028-chaos-unicorn-hacks-bhnt-107" "BHNT #107" "https://bhnt.c-base.org/2025-10-28-no107-chaos-unicorn-hacks" | |
| upload_event "20260127-global-disposition-hacks-bhnt-108" "BHNT #108" "https://bhnt.c-base.org/2026-01-27-no108-global-dis-position-hacks" | |
| upload_event "20260224-molten-hacks-bhnt-109" "BHNT #109" "https://bhnt.c-base.org/2026-02-24-no109-molten-hacks" | |
| upload_event "20260331-doom-hacks-bhnt-110" "BHNT #110" "https://bhnt.c-base.org/2026-03-31-no110-doom-hacks" | |
| upload_event "20260428-bhnt-111-put_linehello-moon" "BHNT #111" "https://bhnt.c-base.org/2026-04-28-no111-hello-moon" | |
| upload_event "20260526-bhnt-112-bamboo-hacks" "BHNT #112" "https://bhnt.c-base.org/2026-05-26-no112-bamboo-hacks" | |
| upload_event "20260728-bhnt-113-dwebcamp-hacks" "BHNT #113" "https://bhnt.c-base.org/2026-07-28-no113-dwebcamp-hacks" | |
| upload_event "20260825-bhnt-114" "BHNT #114" "https://bhnt.c-base.org/2026-08-25-no114-eclipse-hacks" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment