User:Neoksaal/Projects/good:bad bad:good/cookbook
html page
online now (fix the - thing tomorrow)
p5js
API
headlines
https://newsapi.org/docs/endpoints/top-headlines woah!
"free plan" only allows 100 api requests per day and i get the articles with 24 hours delay hm
how long would it take for one cycle to finish then?
think 100 request a day is an ample amount
https://docs.gnews.io/endpoints/top-headlines-endpoint
better, only 12 hours delay instead of 24. also much cheaper subscription fee with 7days free trial.
can't work with neither of them apparently due to CORS
for now i will just get them through terminal and copy and past to js file
curl -s "https://newsapi.org/v2/everything?q=world&language=en&pageSize=100&apiKey=eaff3186acf14d0788bc88b52c8e5a12" | python3 -c "import sys, json; data = json.load(sys.stdin); articles = data.get('articles', []); [print(f'\"{a[\"title\"].split(\" - \")[0].replace(\"\\\"\", \"\").strip()}\",') for a in articles]"
try with different searches to get more interesting outcome. dont want predominantly U.S. related headlines.
last week's news headlines that has "good" in it
curl -s "https://newsapi.org/v2/everything?qInTitle=good&language=en&pageSize=100&from=2026-03-15&to=2026-03-22&apiKey=eaff3186acf14d0788bc88b52c8e5a12" | python3 -c "import sys, json; data = json.load(sys.stdin); articles = data.get('articles', []); [print(f'\"{a[\"title\"].split(\" - \")[0].replace(\"\\\"\", \"\").strip()}\",') for a in articles]"
headlines from 100 years ago
Library of Congress, massive archive but all scanned images
Library of Congress API
New York Times API archive
would be cute? to see those headlines slide through the ticker but i can't really develop it further atm
ticker
swapping rules
good : bad bad : good