ve3zsh.neocities.org
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. :)
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)).
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"))
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. :)
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)).
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"))