Skip to content
JCGuestPublic

About

Web application to execute weekly email of nearby concerts by the artists in your Spotify library

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Encore

Weekly email of nearby concerts by the artists in your Spotify library. Users go through a setup wizard: they create their own free Spotify developer app, connect it, pick a city, preview their shows and turn on the weekly email.

What runs it, all on free tiers: Render (web) · Neon (Postgres) · Brevo (email) · cron-job.org (weekly timer) · Ticketmaster Discovery API (show data)

Spotify rules (Feb 2026): a developer app works only if its owner has Spotify Premium, and allows 5 users. That's why each Encore user makes their own app. The wizard handles this, but users without Premium can't use Encore.


Deploy (about 30 minutes, no credit card)

1. Put the code on GitHub

Create an empty GitHub repo, then from this folder:

git init && git add . && git commit -m "Encore"
git branch -M main && git remote add origin https://github.com/<you>/encore.git && git push -u origin main

2. Ticketmaster key

developer.ticketmaster.com → sign up → My Apps. Copy the Consumer Key. This one key serves every user: results are cached per city for 20 hours, so it stays well under the 5,000 calls/day limit.

3. Database: Neon

neon.tech → sign up → create a project (any region near your Render region) → Connect → copy the connection string (postgresql://…neon.tech/neondb?sslmode=require). Tables are created automatically on first start.

4. Email: Brevo

brevo.com → sign up (free: 300 emails/day) → Senders, Domains & Dedicated IPs → Senders → add and verify the address you'll send from. Then SMTP & API → API Keys → generate a key. Deliverability tip: sending "from" a Gmail address through a third party can land in spam. Authenticating your own domain in Brevo (or switching to Resend with EMAIL_PROVIDER=resend) fixes that if you own one.

5. Web service: Render

render.com → sign up with GitHub → New → Blueprint → choose your repo. render.yaml sets everything up, including random SECRET_KEY and CRON_SECRET values. When prompted, fill in:

Variable Value
BASE_URL leave blank: the app uses Render's own URL automatically. Set it only for a custom domain
TICKETMASTER_KEY from step 2
DATABASE_URL from step 3
BREVO_API_KEY from step 4
MAIL_FROM the verified sender address from step 4
LASTFM_API_KEY optional, see below: powers “You might also like”

Open https://<service>.onrender.com. You should see the landing page. The first load after it's been idle takes 30–60 s while the service wakes up.

5b. Suggested artists: Last.fm (optional, instant)

www.last.fm/api/account/create → log in or sign up → fill in app name Encore, then submit → copy the API key into LASTFM_API_KEY on Render. Without it, suggestions fall back to Ticketmaster genre matching.

6. Weekly timer: cron-job.org

Render → your service → Environment → copy the CRON_SECRET value. Then at cron-job.org → sign up → Create cronjob:

  • URL: https://<service>.onrender.com/tasks/run?key=<CRON_SECRET>
  • Schedule: every 10 minutes

Each call returns immediately and sends any emails that are due in the background. It also keeps the free Render service awake. 24/7 use is about 730 hours/month, within the 750 free hours.

7. Try it

Go through the wizard yourself. On the preview step, click Send a test email.


Run locally

python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
SECRET_KEY=dev TICKETMASTER_KEY=<key> EMAIL_PROVIDER=console .venv/bin/python app.py

Open http://127.0.0.1:8888. In your Spotify developer app, add http://127.0.0.1:8888/callback as a Redirect URI. With EMAIL_PROVIDER=console, emails print to the terminal. Without DATABASE_URL, data goes to encore.db (SQLite). That also makes the app runnable as-is on any always-on server, such as Oracle Cloud Always Free.

How it works

  • Wizard (/setup): the user pastes their app's Client ID, then signs in with OAuth + PKCE (no client secret is ever needed or stored).
  • Scan: everything the Spotify API exposes: every playlist the user owns or collaborates on (Spotify blocks other people's playlists in dev mode, and the UI lists the skipped ones), Liked Songs, saved albums, followed artists, top artists and top tracks across all time ranges, and recently played. Every credited artist on every track counts. Names are normalized (case, accents, “The”, “&”, parentheticals) and matched against billed acts and individual names in event titles (“A with B”) for Ticketmaster music events within the radius, about 12 months ahead.
  • Suggestions: the user's 40 most-played artists are seeds. With Last.fm, similar artists are scored by similarity × seed weight, and nearby shows by artists not in the library become “You might also like”, with the reason shown. Without Last.fm, Ticketmaster genres of the seeds build a taste profile instead. Last.fm and genre lookups are cached for 30–60 days, shared across users.
  • Weekly: /tasks/run sends to each active user on their chosen weekday after 9 AM local time, and catches up if a week was missed. Shows the user hasn't seen before are marked NEW.
  • Security: Spotify tokens are encrypted at rest (Fernet, key derived from SECRET_KEY), forms are CSRF-protected, every email has a one-click unsubscribe, and users can delete their account from the dashboard.

Limits

  • Ticketmaster only. Small clubs that sell through other platforms may be missing.
  • Exact name matching. A very generic artist name can occasionally match a different act with the same name.
  • Brevo free tier: 300 emails/day, which covers about 2,000 weekly users if spread across days.

About

Web application to execute weekly email of nearby concerts by the artists in your Spotify library

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages