Yo Dan! @predawka emailed me a fix for the viewcount tutorial, I can't find your email to forward it to you though. I'm just gonna dump it here if that's chill with you: https://pastebin.com/raw/dw7s2Th3
(Bonus tip: when I got to the screen where I create an application or "worker," I had to pick the Hello World template and then find the button to edit the code to find a place to paste this script in)
this is my first time seeing a script on how to access the api. i assume fetching sitedata from the api using a simple fetch() function in a script on your website is blocked by neocities? cause it be a hell of a lot easier to just do that
@brachypelmide yes, since 2024 neocities blocks any fetch calls for new free accounts. @dann's tutorial mentions this, @dabric has made an article detailing how the neocities csp works: https://content-security-policy.neocities.org/
@v0idspace it's the same data fields you're formatting, only the proxy through which you get that data changes, so the last updated field will still work - i have it too
@predawka ah damn that sucks. i assume that was probably done to reduce load
@v0idspace i THINK you should just be able to fetch the worker URL and get a working infoset from that (psuedocode, i suck at async: https://pastebin.com/raw/vHsrwMGi)
Thanks for this. I need to brush up on Cloudflare, workers, and all the things I've missed by living in the past. At a glance, it appears to be doing the same thing that the weirdscifi proxy was doing--mainly handling the API call on the server side where Cross Origin isn't an issue, and then making it public again without the restriction.
It would be cool is the site name could be passed as a variable, but I'm not sure if that's possible. I'd just host it myself on my PHP server, but godaddy has me in this grandfathered plan where I get unlimited domains and space, but none of the modern stuff like SSL, which neocities won't touch unless implemented.
^_^
thanks for sharing this!
this is my first time seeing a script on how to access the api. i assume fetching sitedata from the api using a simple fetch() function in a script on your website is blocked by neocities? cause it be a hell of a lot easier to just do that
@brachypelmide yes, since 2024 neocities blocks any fetch calls for new free accounts. @dann's tutorial mentions this, @dabric has made an article detailing how the neocities csp works: https://content-security-policy.neocities.org/
How can i use this in order to make my "last updated xx.xx.xx" widget work again? Because afaik it uses the same method here.
@v0idspace it's the same data fields you're formatting, only the proxy through which you get that data changes, so the last updated field will still work - i have it too
@predawka ah damn that sucks. i assume that was probably done to reduce load @v0idspace i THINK you should just be able to fetch the worker URL and get a working infoset from that (psuedocode, i suck at async: https://pastebin.com/raw/vHsrwMGi)
Thank you! I dont know if im gonna go trough with this because i dont wanna make another account for something, but i will keep it in mind!
Thanks for this. I need to brush up on Cloudflare, workers, and all the things I've missed by living in the past. At a glance, it appears to be doing the same thing that the weirdscifi proxy was doing--mainly handling the API call on the server side where Cross Origin isn't an issue, and then making it public again without the restriction.
It would be cool is the site name could be passed as a variable, but I'm not sure if that's possible. I'd just host it myself on my PHP server, but godaddy has me in this grandfathered plan where I get unlimited domains and space, but none of the modern stuff like SSL, which neocities won't touch unless implemented.
I might see if I can still use cloudflare on one of my sites to get HTTPS active, then I won't be relying on others.
That's nice. I'll give it a try since I already have a Cloudflare account. Thanks for the tip!
My god, this is so damn easy I can't believe it. It's just a couple of clicks, paste and deploy. Thank you so much, guys!