User:Neoksaal/Projects/good:bad bad:good: Difference between revisions

From neoksaal wiki
Jump to navigation Jump to search
Created page with "<div style="font-size:17px; text-align: right;"> . </div> =html page= '''[https://neoksaal.com/good:bad_bad:good/ online now (fix the - thing tomorrow)]''' <br> ==p5js== * [https://www.w3schools.com/jsref/jsref_match.asp match() w3c] * [https://editor.p5js.org/aferriss/sketches/ryZoXYB-X replace() p5js example], [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace mdn docs] * [https://p5js.org/reference/p5/text/ text()] * [http..."
 
Replaced content with "<div style="font-size:17px;"> cookbook <br> <br> :: research </div>"
Tag: Replaced
 
Line 1: Line 1:
<div style="font-size:17px; text-align: right;">
<div style="font-size:17px;">
.
[[/cookbook|cookbook]]
</div>
=html page=
'''[https://neoksaal.com/good:bad_bad:good/ online now (fix the - thing tomorrow)]'''
<br>
<br>
==p5js==
* [https://www.w3schools.com/jsref/jsref_match.asp match() w3c]
* [https://editor.p5js.org/aferriss/sketches/ryZoXYB-X replace() p5js example], [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace mdn docs]
* [https://p5js.org/reference/p5/text/ text()]
* [https://p5js.org/reference/p5/textWidth/ textWidth()]
* [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce reduce() mdn docs]
<br>
<br>
 
:: [[/research|research]]
==API==
</div>
===headlines===
https://newsapi.org/docs/endpoints/top-headlines woah!<br>
"free plan" only allows 100 api requests per day and i get the articles with 24 hours delay hm<br>
how long would it take for one cycle to finish then?<br>
think 100 request a day is an ample amount<br>
<br>
https://docs.gnews.io/endpoints/top-headlines-endpoint<br>
better, only 12 hours delay instead of 24. also much cheaper subscription fee with 7days free trial.<br>
<br>
can't work with neither of them apparently due to CORS<br>
for now i will just get them through terminal and copy and past to js file<br>
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.
<br>
<br>
<br>
<br>
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]"
<br>
<br>
===headlines from 100 years ago===
[https://www.loc.gov/newspapers/?dates=1900/1949 Library of Congress, massive archive but all scanned images]<br>
[https://guides.loc.gov/chronicling-america/additional-features Library of Congress API]<br>
[https://developer.nytimes.com/docs/archive-product/1/overview New York Times API archive]<br>
would be cute? to see those headlines slide through the ticker but i can't really develop it further atm
<br>
<br>
=ticker=
<br>
<br>
<br>
=swapping rules=
good : bad
bad : good

Latest revision as of 18:11, 21 July 2026