Skip to content

Commit 90a26e5

Browse files
committed
init
0 parents  commit 90a26e5

8 files changed

Lines changed: 1001 additions & 0 deletions

File tree

‎.github/workflows/deploy-pages.yml‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: barcoder-prod
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Assemble site
27+
env:
28+
# Prefer Secrets; fall back to Variables (current setup).
29+
CLIENT_ID: ${{ secrets.BARCODER_SPOTIFY_CLIENT_ID || vars.BARCODER_SPOTIFY_CLIENT_ID }}
30+
CLIENT_SECRET: ${{ secrets.BARCODER_SPOTIFY_SECRET_WEB || vars.BARCODER_SPOTIFY_SECRET_WEB }}
31+
run: |
32+
mkdir -p _site
33+
cp index.html app.js style.css favicon.svg _site/
34+
python3 - <<'PY'
35+
import json, os
36+
from pathlib import Path
37+
38+
client_id = os.environ.get('CLIENT_ID') or ''
39+
client_secret = os.environ.get('CLIENT_SECRET') or ''
40+
if not client_id or not client_secret:
41+
raise SystemExit('Missing BARCODER_SPOTIFY_CLIENT_ID or BARCODER_SPOTIFY_SECRET_WEB in barcoder-prod')
42+
43+
Path('_site/config.js').write_text(
44+
'window.BARCODER = {\n'
45+
f'\tclientId: {json.dumps(client_id)},\n'
46+
f'\tclientSecret: {json.dumps(client_secret)},\n'
47+
'}\n'
48+
)
49+
50+
counter = (
51+
'<script src=https://cdn.counter.dev/script.js '
52+
'data-id=4f8ae39e-3e03-4518-b3cd-2b44c8b60f93 '
53+
'data-utcoffset=4></script>\n'
54+
)
55+
index = Path('_site/index.html')
56+
html = index.read_text()
57+
if '</body>' not in html:
58+
raise SystemExit('index.html missing </body>')
59+
index.write_text(html.replace('</body>', counter + '</body>', 1))
60+
PY
61+
62+
- uses: actions/configure-pages@v5
63+
64+
- uses: actions/upload-pages-artifact@v3
65+
with:
66+
path: _site
67+
68+
- id: deployment
69+
uses: actions/deploy-pages@v4

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
config.js

‎README.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Barcoder
2+
3+
Lookup **ISRC** and **UPC** barcodes for Spotify albums and tracks.
4+
5+
**Live:** [https://barcoder.wrongwave.net](https://barcoder.wrongwave.net)
6+
7+
Paste an album or track URL to get release metadata, a tracklist with ISRCs, and a copyable text summary. Links are shareable via `?url=`.
8+
9+
## Local setup
10+
11+
1. Create a [Spotify Developer](https://developer.spotify.com/dashboard) app and copy the Client ID and Client Secret.
12+
2. Copy the config example and fill in your credentials:
13+
14+
```bash
15+
cp config.example.js config.js
16+
```
17+
18+
```js
19+
window.BARCODER = {
20+
clientId: '…',
21+
clientSecret: '…',
22+
}
23+
```
24+
25+
3. Serve the folder over HTTP (not `file://`), e.g.:
26+
27+
```bash
28+
python3 -m http.server 8765
29+
```
30+
31+
Open `http://127.0.0.1:8765`.
32+
33+
## The MIT License (MIT)
34+
Copyright © 2026 [Wrong Wave](https://wrongwave.net)
35+
36+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
37+
38+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
39+
40+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)