MarlinsBaseball.com: Ballpark webcam image as wallpaper - MarlinsBaseball.com

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ballpark webcam image as wallpaper Have your desktop wallpaper automatically update to latest webcam img

#1 User is offline   substr 

  • Jammer
  • Group: Guppy
  • Posts: 7
  • Joined: June 18, 2008
  • Location:Boca Raton
  • Gender:Male

Posted August 9, 2009 - 11:00 AM

I had an urge to use the latest webcam image of the new ballpark as my desktop wallpaper, but given that they do not provide a link to the latest image file, I decided to write a script to do this for me. Using an app that would automatically update the wallpaper based on a user-defined URL and update interval, the latest available image is ALWAYS my desktop background. I figured I would share it with you guys. Let me know what you think!

Applications
[Windows] DynaDesk
[Windows + Linux (KDE 3.x & Gnome)] WebWallpaper

(if you know of any others that work, I'll add them to this list. All platforms welcome.)

URLs
Most recent image: http://marlins.mttkllr.com/recent.php
Most recent daytime image: http://marlins.mttkl...nt.php?day=true
Most recent nighttime image: http://marlins.mttkl....php?night=true

Posted Image Posted Image

#2 User is offline   Fish4Life 

  • Do you bleed Teal?
  • Group: Members
  • Posts: 6,682
  • Joined: October 30, 2005
  • Location:Miami
  • Gender:Male

Posted August 9, 2009 - 12:44 PM

SWEET!!!!!

#3 User is online   MiamiManiac131 

  • Hammerhead
  • Group: Members
  • Posts: 125
  • Joined: June 27, 2007
  • Location:Miami Beach, FL

Posted August 9, 2009 - 02:03 PM

Any ideas how to do this on a mac?

#4 User is offline   substr 

  • Jammer
  • Group: Guppy
  • Posts: 7
  • Joined: June 18, 2008
  • Location:Boca Raton
  • Gender:Male

Posted August 9, 2009 - 02:33 PM

View PostMiamiManiac131, on August 9, 2009 - 02:03 PM, said:

Any ideas how to do this on a mac?


Give Desktoptopia a go. I think it'll let you update from a specific url. Let me know if it doesn't work and I'll try to find something else. I'm away from my mac now so I can't really try it out.

#5 User is online   MiamiManiac131 

  • Hammerhead
  • Group: Members
  • Posts: 125
  • Joined: June 27, 2007
  • Location:Miami Beach, FL

Posted August 9, 2009 - 03:22 PM

Desktoptopia is installing alright but isn't changing the wallpaper. Based on some comments I've been reading, looks like the app's developer went quiet sometime last year...

#6 User is offline   Fish4Life 

  • Do you bleed Teal?
  • Group: Members
  • Posts: 6,682
  • Joined: October 30, 2005
  • Location:Miami
  • Gender:Male

Posted August 9, 2009 - 03:35 PM

Yea couldnt get it to work on my mac, so I just put it on my windows netbook

#7 User is offline   Rabbethan 

  • Member of Captain Mitre's Pirate Crew
  • Group: VIP
  • Posts: 12,771
  • Joined: May 22, 2007
  • Location:Miami/Doral, Fl
  • Gender:Male

Posted August 9, 2009 - 06:37 PM

Genius. Though, you should probably add a 5 min delay, since that's about what it takes for the new image to come up.

Any chance I could see the coding?

BTW, I see you're running Windows 7 as well. Ain't it grand?

#8 User is offline   substr 

  • Jammer
  • Group: Guppy
  • Posts: 7
  • Joined: June 18, 2008
  • Location:Boca Raton
  • Gender:Male

Posted August 9, 2009 - 08:37 PM

View PostMiamiManiac131, on August 9, 2009 - 03:22 PM, said:

Desktoptopia is installing alright but isn't changing the wallpaper. Based on some comments I've been reading, looks like the app's developer went quiet sometime last year...

View PostFish4Life, on August 9, 2009 - 03:35 PM, said:

Yea couldnt get it to work on my mac, so I just put it on my windows netbook

I am still looking for a Mac option. So far, no luck. I think it could be done as a cron job. I'll play with it tonight or tomorrow and post the results and the code if it works.



View PostRabbethan, on August 9, 2009 - 06:37 PM, said:

Genius. Though, you should probably add a 5 min delay, since that's about what it takes for the new image to come up.

Any chance I could see the coding?

BTW, I see you're running Windows 7 as well. Ain't it grand?

I've been using it since it leaked in December and haven't turned back.Running on my desktop, laptop, and netbook and it beats the pants offanything else I've tried on those systems thus far.

Below is obviously the code. Nothing fancy, kind of sloppy. At themoment the cutoff for day/night is hardcoded at 6 am and 8 pm. I canprobably stomach the bandwidth to maybe use GD and add a time & date watermark + the Marlins logo. I guess I could just cache thatimage server-side and call it a day. :cool

<?php

date_default_timezone_set('US/Eastern');

function image_time($time=false) {
    if(!$time) $time = time()-3600; // fall a minute back
    
    $t['t'] = $time;
    
    $t['y'] = date('Y', $time);
    $t['m'] = date('m', $time);
    $t['d'] = date('d', $time);
    $t['h'] = date('H', $time);
    $t['i'] = sprintf("%02d",floor(date('i', $time)/15)*15);
    
    return $t;
}

$t = image_time();

if($_GET['day'] == true) {
    // only return "day" hours
    if($t['h'] < 6) {
        // early morning, go to previous day
        $t = image_time(strtotime('yesterday 20:00'));
    }
    else if($t['h'] > 20) {
        // late evening, go to 20:00 of current day
        $t = image_time(strtotime('today 20:00'));
    }
}
else if($_GET['night'] == true) {
    // only return "night" hours
    if($t['h'] > 6 && $t['h'] < 20) {
        // day time, go to 6:00 of current day
        $t = image_time(strtotime('today 06:00'));
    }
}

$image_url ='http://archives.earthcam.com/archives5/ecnetwork/us/fl/miami/marlins//'.$t['y'].'/'.$t['m'].'/'.$t['d'].'/'.$t['h'].$t['i'].'.jpg';

header( 'Location: '.$image_url ) ;

?>


#9 User is offline   Benched 

  • Veteran
  • Group: Members
  • Posts: 7,606
  • Joined: September 7, 2006
  • Gender:Male

Posted August 9, 2009 - 08:43 PM

Got this to work with WebWallpaper on Windows 2000.

Awesome stuff. Thanks!

#10 User is offline   Rabbethan 

  • Member of Captain Mitre's Pirate Crew
  • Group: VIP
  • Posts: 12,771
  • Joined: May 22, 2007
  • Location:Miami/Doral, Fl
  • Gender:Male

Posted August 9, 2009 - 08:50 PM

View Postsubstr, on August 9, 2009 - 08:37 PM, said:

View PostMiamiManiac131, on August 9, 2009 - 03:22 PM, said:

Desktoptopia is installing alright but isn't changing the wallpaper. Based on some comments I've been reading, looks like the app's developer went quiet sometime last year...

View PostFish4Life, on August 9, 2009 - 03:35 PM, said:

Yea couldnt get it to work on my mac, so I just put it on my windows netbook

I am still looking for a Mac option. So far, no luck. I think it could be done as a cron job. I'll play with it tonight or tomorrow and post the results and the code if it works.



View PostRabbethan, on August 9, 2009 - 06:37 PM, said:

Genius. Though, you should probably add a 5 min delay, since that's about what it takes for the new image to come up.

Any chance I could see the coding?

BTW, I see you're running Windows 7 as well. Ain't it grand?

I've been using it since it leaked in December and haven't turned back.Running on my desktop, laptop, and netbook and it beats the pants offanything else I've tried on those systems thus far.

Below is obviously the code. Nothing fancy, kind of sloppy. At themoment the cutoff for day/night is hardcoded at 6 am and 8 pm. I canprobably stomach the bandwidth to maybe use GD and add a time & date watermark + the Marlins logo. I guess I could just cache thatimage server-side and call it a day. :cool

<?php

date_default_timezone_set('US/Eastern');

function image_time($time=false) {
    if(!$time) $time = time()-3600; // fall a minute back
    
    $t['t'] = $time;
    
    $t['y'] = date('Y', $time);
    $t['m'] = date('m', $time);
    $t['d'] = date('d', $time);
    $t['h'] = date('H', $time);
    $t['i'] = sprintf("%02d",floor(date('i', $time)/15)*15);
    
    return $t;
}

$t = image_time();

if($_GET['day'] == true) {
    // only return "day" hours
    if($t['h'] < 6) {
        // early morning, go to previous day
        $t = image_time(strtotime('yesterday 20:00'));
    }
    else if($t['h'] > 20) {
        // late evening, go to 20:00 of current day
        $t = image_time(strtotime('today 20:00'));
    }
}
else if($_GET['night'] == true) {
    // only return "night" hours
    if($t['h'] > 6 && $t['h'] < 20) {
        // day time, go to 6:00 of current day
        $t = image_time(strtotime('today 06:00'));
    }
}

$image_url ='http://archives.earthcam.com/archives5/ecnetwork/us/fl/miami/marlins//'.$t['y'].'/'.$t['m'].'/'.$t['d'].'/'.$t['h'].$t['i'].'.jpg';

header( 'Location: '.$image_url ) ;

?>


Heh, trust me, if there's one thing I understand it's sloppy code. That's good stuff though.

And about Win7, I've been running the 7100 RC, both x86 and x64, since they went public on both my desktop and my laptop. It finally gave me a reason to leave XP and I also haven't gone back since. I haven't tried it on my dad's netbook but I hear it runs ridiculously better than Vista does on those.

#11 User is offline   gizmo 

  • BALLGAME
  • Group: VIP
  • Posts: 2,808
  • Joined: July 1, 2008
  • Location:Orlando, FL
  • Gender:Male

Posted August 9, 2009 - 10:07 PM

Wow this is awesome!

#12 User is offline   djm305 

  • Marlins fan living in MN
  • Group: Members
  • Posts: 1,113
  • Joined: September 4, 2003
  • Location:Rochester, MN (orig. Miami, FL)

Posted August 10, 2009 - 11:20 AM

I have a Premium MSDN account through my work and I have been running the Beta and RC pretty much since they became available. I installed the RTM on 3 of my systems this weekend. I love Win7 and I am urging all my family and friends to upgrade.

I noticed that you still use desktop icons to launch your apps, I love making use of the new taskbar and I have pretty much all my GOTO programs pinned to my taskbar and I love it.

#13 User is offline   Rabbethan 

  • Member of Captain Mitre's Pirate Crew
  • Group: VIP
  • Posts: 12,771
  • Joined: May 22, 2007
  • Location:Miami/Doral, Fl
  • Gender:Male

Posted August 10, 2009 - 09:48 PM

View Postdjm305, on August 10, 2009 - 11:20 AM, said:

I have a Premium MSDN account through my work and I have been running the Beta and RC pretty much since they became available. I installed the RTM on 3 of my systems this weekend. I love Win7 and I am urging all my family and friends to upgrade.

I noticed that you still use desktop icons to launch your apps, I love making use of the new taskbar and I have pretty much all my GOTO programs pinned to my taskbar and I love it.

I got rid of the big icons and, because I have trouble letting go, I added the quick launch. Though I love having FireFox pinned.

#14 User is offline   Fish4Life 

  • Do you bleed Teal?
  • Group: Members
  • Posts: 6,682
  • Joined: October 30, 2005
  • Location:Miami
  • Gender:Male

Posted March 1, 2010 - 07:56 AM

Larry I found this thread, this is the one we were talking about but this is for windows based systems...

Thanks though

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users