Created
August 28, 2011 15:03
-
-
Save bjoerge/1176770 to your computer and use it in GitHub Desktop.
Rolfstangen webcam set as bg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'net/http' | |
file_name = '/tmp/rolfstangen-webcam.jpg' | |
Net::HTTP.start("www.rolfstangen.no") do |http| | |
resp = http.get("/webcam/cam_1.jpg") | |
open(file_name, 'wb') do |file| | |
file.write(resp.body) | |
end | |
`gconftool-2 --type string --set /desktop/gnome/background/picture_filename #{file_name}` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from appscript import app, mactypes | |
import urllib2 | |
file_name = '/tmp/rolfstangen-webcam.jpg' | |
u = urllib2.urlopen('http://www.rolfstangen.no/webcam/cam_1.jpg') | |
localFile = open(file_name, 'wb') | |
localFile.write(u.read()) | |
localFile.close() | |
app('Finder').desktop_picture.set(mactypes.File(file_name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment