• Index » 
  • Community » 
  • Tech » 
  • Script/app to pull a daily image off a blog and wallpaper it?
TheDonkey
Eat my bearrrrrrrrrrr, Tonighttt
+163|5733|Vancouver, BC, Canada
Ok, so what I'm looking for is some script or something that can parse a blog, and if there's a new post/image, download the image and set it as the wallpaper.

This site doesn't have any direct tools that do it (like the Flickr downloaders), so I'm looking for something else.

Worst case scenario, I see a machine running some sort of parse script to check if there a new image, and if there is, download it, rename it, and replace the old one. Then another program to re-set the wallpaper every __ hours. (To clear the wallpaper cache, because the WP doesn't automatically update when the physical image file is changed, it's loaded into RAM)

I have my own server with full root access so I can install anything as needed, and I have basic understanding of PHP/Web-based scripting, if given the official names for commands, I can look up how to compile the actual code.

P.S. Link
tkoi
Utahraptor!
+148|6163|Texas
well that site seems to have an rss feed so that should make it quite a lot simpler

i have written an ahk script that i use personally which randomly selects an image from my wallpaper folder and sets it as the wallpaper. i have a shortcut to it in my startup folder so i get a new wallpaper each time i turn on my pc. would be pretty easy to tweak it to parse an rss feed and download an image. would this functionality be sort of what you're looking for?
TheDonkey
Eat my bearrrrrrrrrrr, Tonighttt
+163|5733|Vancouver, BC, Canada
I'm currently using Displayfusion to do exactly what you're doing, but it switches every hour(on my second monitor, my main stays static)

That's pretty close to what I want, but I need it to also connect/download the most recent image and display that, instead of a random one.
tkoi
Utahraptor!
+148|6163|Texas
do you want it keep running and periodically check the rss for new images or just have it check once and terminate?
TheDonkey
Eat my bearrrrrrrrrrr, Tonighttt
+163|5733|Vancouver, BC, Canada
Probably just once, I'm not sure if it's possible, but it'd be great if it ran on windows Unlock instead of Log On. Seeing as I put my computer into standby very night, so in the morning when I unlock it it can recheck.
jsnipy
...
+3,276|6539|...

its actually pretty simple to write, let me know if you don't find anything.
TheDonkey
Eat my bearrrrrrrrrrr, Tonighttt
+163|5733|Vancouver, BC, Canada
I haven't really looked seeing as I have no idea what to search for
TheDonkey
Eat my bearrrrrrrrrrr, Tonighttt
+163|5733|Vancouver, BC, Canada
Turns out WIndows 7 already has this feature, sort of.

http://www.online-tech-tips.com/windows … -rss-feed/

But it doesn't seem to work with SOTM because the rss feed has text on it as well.
tkoi
Utahraptor!
+148|6163|Texas
you could keep a script running that hooks the WTS_SESSION_UNLOCK message and place it in the startup folder, that way the wallpaper would change each time you log on or unlock the workstation
Miggle
FUCK UBISOFT
+1,411|6758|FUCK UBISOFT

TheDonkey wrote:

Turns out WIndows 7 already has this feature, sort of.

http://www.online-tech-tips.com/windows … -rss-feed/

But it doesn't seem to work with SOTM because the rss feed has text on it as well.
huh? spawn of the mist? what?
https://i.imgur.com/86fodNE.png
tkoi
Utahraptor!
+148|6163|Texas
someone once told me. link in op.
tkoi
Utahraptor!
+148|6163|Texas
okay, this script parses the rss, checks if you already have the newest image, otherwise downloads and sets it as wallpaper. copy paste into notepad and save as .ahk. you need autohotkey and the com stdlib for ahk

if you don't want to download/install those, i can compile it into an standalone executable but i dunno if you want to trust me.

Code:

#SingleInstance force
#NoEnv

; change this if you want the images to be saved in a folder other than the one the script is in
; eg. SetWorkingDir, c:\users\me
SetWorkingDir, %A_ScriptDir%

;#NoTrayIcon ;uncomment this to hide the tray icon

; change this variable to one of the following:
; CENTER|TILE|STRETCH|MAX
WallpaperOptions = STRETCH

; rss url
rss = http://feeds.feedburner.com/SomeoneOnceToldMe



; constants
Gui, +LastFound
hwnd := WinExist()
WM_WTSSESSION_CHANGE := 0x02B1
WTS_SESSION_LOGON := 0x5
WTS_SESSION_UNLOCK := 0x8

; hook messages
DllCall("wtsapi32.dll\WTSRegisterSessionNotification", uint, hwnd, uint, 1)
OnMessage(WM_WTSSESSION_CHANGE, "fn")
OnMessage(WTS_SESSION_LOGON, "fn")

; run once when script is started
fn(0,0)
return


fn(wparam, lparam)
{
    global rss, WallpaperOptions
    tempfile = sotm.rss
    
    ; downlaod the rss file and extract the image url
    UrlDownloadToFile, %rss%, %tempfile%
    FileRead, rssdata, %tempfile%
    FileDelete, %tempfile%
    if not RegExMatch(rssdata, "is)^.*?<item>.*?<description>.*?img src=""(.*?)""", m)
        return false
    
    ; check if we already have this image
    SplitPath, m1, imgname
    if FileExist(imgname)
        return true
    
    ; download the image and set it as wallpaper
    UrlDownloadToFile, %m1%, %imgname%
    COM_Init() ; thanks to sean for this code    http://www.autohotkey.com/forum/topic16905.html
    pad := COM_CreateObject("{75048700-EF1F-11D0-9888-006097DEACF9}", "{F490EB00-1240-11D1-9888-006097DEACF9}")
    DllCall(NumGet(NumGet(1*pad)+28), "Uint", pad, "int64P", WPSTYLE_%WallpaperOptions%<<32|8, "Uint", 0) ;SetWallpaperOptions
    DllCall(NumGet(NumGet(1*pad)+20), "Uint", pad, "Uint", COM_Unicode4Ansi(wFile,imgname), "Uint", 0) ;SetWallpaper
    ; AD_APPLY_ALL | AD_APPLY_FORCE | AD_APPLY_BUFFERED_REFRESH = 7 | 8 | 16 = 31
    DllCall(NumGet(NumGet(1*pad)+12), "Uint", pad, "Uint", 31) ;ApplyChanges
    COM_Release(pad)
    COM_Term()
}

Last edited by GGF0RCE (2010-02-28 19:43:46)

TheDonkey
Eat my bearrrrrrrrrrr, Tonighttt
+163|5733|Vancouver, BC, Canada
If it wouldn't be too much trouble, I'd love for you to compile it for me. I don't use AHK...ever...so it'd be too much trouble to install/configure it all.

I shall karma's you for ever and ever, thanks.
  • Index » 
  • Community » 
  • Tech » 
  • Script/app to pull a daily image off a blog and wallpaper it?

Board footer

Privacy Policy - © 2024 Jeff Minard