added nfws restriction and changed some shit in the ps

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-07-06 14:32:34 +02:00
parent d615dfdf95
commit 0229f63df2
2 changed files with 12 additions and 13 deletions

View File

@ -1,10 +1,8 @@
Function Set-WallPaper($Value){
$url = "https://motd.ping-mee.de/wallpaper.png";
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, "C:\temp\wallpaper.png")
Invoke-WebRequest $url -OutFile C:\temp\wallpaper.png
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value
Invoke-WebRequest "https://motd.ping-mee.de/wallpaper.png" -OutFile "$($value)wallpaper.png"
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value "$($value)wallpaper.png"
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
Set-WallPaper -value "C:\temp\wallpaper.png"
Set-WallPaper -value "C:\temp\"

View File

@ -27,13 +27,14 @@ subreddit = reddit.subreddit(subreddit_name)
posts = subreddit.top(time_filter="day", limit=5)
for post in posts:
try:
print(post.url)
if post.url.endswith(".png") or post.url.endswith(".jpg"):
debugging_message("Found a new post: "+post.title+" ("+post.id+")")
if post.over_18 == False:
print(post.url)
debugging_message("Saving post to file")
with open(current_path+'/wallpaper.png', "wb") as file:
file.write(requests.get(post.url).content)
debugging_message("Saving post to file done")
if post.url.endswith(".png") or post.url.endswith(".jpg"):
debugging_message("Found a new post: "+post.title+" ("+post.id+")")
print(post.url)
debugging_message("Saving post to file")
with open(current_path+'/wallpaper.png', "wb") as file:
file.write(requests.get(post.url).content)
debugging_message("Saving post to file done")
except:
debugging_message("Error while getting post skipping and continuing")