added nfws restriction and changed some shit in the ps
Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>master
parent
d615dfdf95
commit
0229f63df2
|
@ -1,10 +1,8 @@
|
||||||
Function Set-WallPaper($Value){
|
Function Set-WallPaper($Value){
|
||||||
$url = "https://motd.ping-mee.de/wallpaper.png";
|
Invoke-WebRequest "https://motd.ping-mee.de/wallpaper.png" -OutFile "$($value)wallpaper.png"
|
||||||
$wc = New-Object System.Net.WebClient
|
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value "$($value)wallpaper.png"
|
||||||
$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
|
|
||||||
rundll32.exe user32.dll, UpdatePerUserSystemParameters
|
rundll32.exe user32.dll, UpdatePerUserSystemParameters
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-WallPaper -value "C:\temp\wallpaper.png"
|
Set-WallPaper -value "C:\temp\"
|
|
@ -27,13 +27,14 @@ subreddit = reddit.subreddit(subreddit_name)
|
||||||
posts = subreddit.top(time_filter="day", limit=5)
|
posts = subreddit.top(time_filter="day", limit=5)
|
||||||
for post in posts:
|
for post in posts:
|
||||||
try:
|
try:
|
||||||
print(post.url)
|
if post.over_18 == False:
|
||||||
if post.url.endswith(".png") or post.url.endswith(".jpg"):
|
|
||||||
debugging_message("Found a new post: "+post.title+" ("+post.id+")")
|
|
||||||
print(post.url)
|
print(post.url)
|
||||||
debugging_message("Saving post to file")
|
if post.url.endswith(".png") or post.url.endswith(".jpg"):
|
||||||
with open(current_path+'/wallpaper.png', "wb") as file:
|
debugging_message("Found a new post: "+post.title+" ("+post.id+")")
|
||||||
file.write(requests.get(post.url).content)
|
print(post.url)
|
||||||
debugging_message("Saving post to file done")
|
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:
|
except:
|
||||||
debugging_message("Error while getting post skipping and continuing")
|
debugging_message("Error while getting post skipping and continuing")
|
Loading…
Reference in New Issue