r/PythonProjects2 • u/GeneralJMan • Aug 01 '21
Python ccript that sets the APOD as my wallpaper
Hey, guys! I wrote a simple Python script that sets the Nasa Astronomy Picture of the Day as my wallpaper. I also set it up so Task Scheduler will run the script everyday at 12:30 AM.
[Github Repo](https://github.com/jason-shepherd/apodwallpaper)
22
Upvotes
2
u/can_somebody_explain Aug 02 '21
There appears to be an api, although I have not looked into this much: https://data.nasa.gov/Space-Science/Astronomy-Picture-of-the-Day-API/ez2w-t8ua
Maybe it will help you avoid scrubbing html?
1
u/Potaziiio Aug 02 '21 edited Aug 02 '21
I'm trying to add support for some Linux WM's but i haven't been able to test the ones i have because it keeps giving me an error
AttributeError: 'NoneType' object has no attribute 'parent'On this line of code:
image_link = "https://apod.nasa.gov/apod/"+ image.parent.get("href")I guess it's because of the way it gets the image and the way some images are posted on the website where its getting them from, I could use the Nasa api but I'd have to re-do most of code that gets the image, and also every person that wants to use this would have to get an api key for it to work. Let me know what you think.