diff --git a/Auto_Wallpaper_Changer/main_changer.py b/Auto_Wallpaper_Changer/main_changer.py new file mode 100644 index 0000000..7879d3f --- /dev/null +++ b/Auto_Wallpaper_Changer/main_changer.py @@ -0,0 +1,44 @@ +import os +import requests +import wget +import subprocess +import time + +def get_wallpaper(): + url = 'https://api.unsplash.com/photos/random?client_id=ZQfcb7DPk5z8ZH5W7Zaij6xG33M9U9BJ8ddfYifV6_E' + params = { + 'query': 'HD wallpapers', + 'orientation': 'landscape' + } + + response = requests.get(url, params=params).json() + image_source = response['urls']['full'] + + image = wget.download(image_source, 'D:\\Abdul Rehman\\AI Automations\\Unsplash_Images_API\\Images') + return image + +def change_wallpaper(): + wallpaper = get_wallpaper() + cmd = """/usr/bin/osascript<