Jpeg to display from website?
#1
i want to be able to display a jpeg from a website. the webcam updates the jpeg every 30 seconds, but i don't care about it updating; i just want to see how heavy the traffic is at the time i go there. i tried to set it up as a stream on http://www.onlinestreams.nl/ but they don't support jpegs it seems. does anyone have a solution? many webcams work like this.

thanks
Reply
#2
this little script should do the trick...

Quote:import urllib
import xbmc
import xbmcgui

action_menu = 10 #'back'
root_dir = "q:\\scripts\\"
url_webcam = "http://www.tcomeng.com/webcams/emeraldhills.jpg"

class webcam(xbmcgui.window):
   def (self):
       imgpath = root_dir + "webcam.jpg"
       loc = urllib.urlopener()
       loc.retrieve(url_webcam, imgpath)
       self.addcontrol(xbmcgui.controlimage(100, 100, 0, 0, imgpath))    

   def onaction(self, action):
       if action == action_menu:
           self.close()

win = webcam()
win.domodal()
del win
Reply
#3
hi, im using this code
the script downloads the pic fine but then it just stays on a blank screen. checking the logs i get
"error picture::load:unable to open image: q:\scripts\wip\webcam.jpg" multiple times.
any help?

Quote:import urllib
import xbmc
import xbmcgui

action_menu = 10 #'back'
root_dir = "q:\\scripts\\wip\\"
url_webcam = "[url]http://www.tcomeng.com/webcams/emeraldhills.jpg"[/url]

class webcam(xbmcgui.window):
  def (self):
      imgpath = root_dir + "webcam.jpg"
      loc = urllib.urlopener()
      loc.retrieve(url_webcam, imgpath)
      self.addcontrol(xbmcgui.controlimage(100, 100, 0, 0, imgpath))    

  def onaction(self, action):
      if action == action_menu:
          self.close()

win = webcam()
win.domodal()
del win
Reply

Logout Mark Read Team Forum Stats Members Help
Jpeg to display from website?0