Neocities.org

VE3ZSH - Alexander Keller

ve3zsh.neocities.org

675 views
2 followers
242 updates
0 tips
Bit of a fun experimental piece of tech. https://ve3zsh.neocities.org/advice/index.html should automatically update every day with a new quote and hero image without relying on JavaScript.
berri 3 days ago

how could I implement this in my site? I have been looking for something like this for a while and I want to learn how to put it in mine. :)

ve3zsh 2 days ago

I did it with a bit of Python running on my computer. You can use the Neocities API to upload files (https://neocities.org/api). So, I wrote a script that picks a random quote and image and uploads them to the site every day at midnight. Then scheduled it (I used systemd's timers, but you could do it on Windows or Mac also (https://www.isunshare.com/windows-10/4-ways-to-open-task-scheduler-on-windows-10.html)).

ve3zsh 2 days ago

Essential Python code: requests.post("https://neocities.org/api/upload", headers={"Authorization": "Bearer YOUR_API_KEY_HERE", "User-Agent": "neocron/0.1"}, files={"path/to/put/image.jpg": open(file="C:\path\to\get\image.jpg", mode="rb"))

Cool stuff!
1 like
ve3zsh 2 weeks ago

Thanks. :)

1 like

Website Stats

Last updated 14 hours ago
CreatedMay 16, 2021
Site Traffic Stats

Tags

personal hamradio programming