Automated webcam capture/image downloader

January 2nd, 2008

The other day I was checking out a webcam at a local ski resort, and wanted to see what an entire day’s worth of shots looked like played in a movie. I’m sure there are apps out there that do this sort of thing, and might even be an easier way of doing this. Regardless, I decided to have a play.

Below is a simple VB Script file (sorry windowless folks) that will download and save an image to your hard drive. It will save the images in the same directory the script is running.

Dim imageURL
imageURL = "http://www.mtbachelor.com/@@/cams/wvskycam.jpg"
Function SaveBinaryData(FileName, ByteArray)
	Const adTypeBinary = 1
	Const adSaveCreateOverWrite = 2
	Dim BinaryStream
	Set BinaryStream = CreateObject("ADODB.Stream")
	BinaryStream.Type = adTypeBinary
	BinaryStream.Open
	BinaryStream.Write ByteArray
	BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
End Function
Function BinaryGetURL(URL)
	Dim Http
	Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
	Http.Open "GET", URL, False
	Http.Send
	BinaryGetURL = Http.ResponseBody
End Function
Function doSave()
	Dim image, fName, p_month, p_day, p_hour, p_minute, p_second
	image = BinaryGetURL(imageURL)
	p_month = padZero(Month(Now))
	p_day = padZero(Day(Now))
	p_hour = padZero(Hour(Now))
	p_minute = padZero(Minute(Now))
	p_second = padZero(Second(Now))
	fName = p_month & "_" & p_day & "_" & Year(Now) & "-" & p_hour & "_" & p_minute & "_" & p_second & ".jpg"
	SaveBinaryData fName,image
End Function
Function padZero(val)
	If(Len(val) < 2) Then
		val = "0" & val
	End If
	padZero = val
End Function
doSave()

Copy and paste the above script into an empty text file. Go find a webcam you’d like to capture. When viewing the webcam image, right click and copy the images URL. Change the imageURL variable at the top of the script. Save the script (.vbs extension). Next you’ll need to set up an automated task to run the script. For help on how to set up tasks, check out this KB article. You’ll want to schedule it run somewhat frequently, but no more frequent than the webcam updates.

That’s pretty much all you need to do. If everything goes right, image files should start appearing in the directory that the script is located.

To create a movie from the sequence, you’ll need to find some software to do that. Out of sheer laziness, I just use QuickTime Pro, but there’s a bunch of shareware/freeware options available out there.

Have fun…

Microsoft Surface Parody

September 25th, 2007

One day, your computer will be a big-ass table…

The most annoying behavior : Backspace = Back Button

September 25th, 2007

This has got to be one of the WORST ever behaviors for a user interface. Who ever thought of this one, should be shot.

There is nothing worse than when you’re entering data in a form and hit backspace only to have your browser react as if you clicked the back button.

Arghhh.

Accordion 2.0

September 21st, 2007

Kevin Miller has updated his accordion control. The new version includes:

  • Open/Close functionality added (Click on an active accordion)
  • Nested Vertical Accordions
  • Accordions will dynamically resize on content added REAL TIME!

One of the better accordion widgets out there I must say.

Check it out!

CSSVista: Tweak CSS and see it in IE and Firefox at the same time

September 21st, 2007

CSSVista is a free Windows application for web developers which lets you edit your CSS code live in both Internet Explorer and Firefox simultaneously.

CSSVista is from the folks who gaves us Litmus

Julien Dupont

September 20th, 2007

I don’t want a pickle
Just want to ride on my motorsickle
And I don’t want a tickle
‘Cause I’d rather ride on my motorsickle
And I don’t want to die
Just want to ride on my motorcy…cle

Thank you Arlo…

Web-based software license compliance tool

September 15th, 2007

The Business Software Alliance is offering up to $1 million to whistle blowers who report software piracy and organizations are paying record fines for noncompliance. From initial fines to further audits from individual vendors, being found in noncompliance can be costly. So what help is there out there?

Centennial License Manager is a web-based software license compliance solution that helps you quickly reconcile license entitlement to software usage on your network. Not only can it help your licensing position, it can help you save money as well by showing instances where you may be over licensed.

For more details, visit the License Manager products page at Centennial Software.

Heavy Metal Umlaut - The Diacritical Mark of the Beast

September 11th, 2007

motorhead logo

While trying to find some information on umlauts and the German language, I came across this and about pissed myself: The Heavy mMetal Umlaut

Moan my IP

August 24th, 2007

Forget ipchicken.com. I’d much rather use moanmyip.com.

Back from the UK

August 22nd, 2007

Posting has been a bit sparse lately as I’ve been seriously busy with work. I also just returned from a trip to the UK for work.

It was the first time I’d ever been to the UK, or even Europe for that matter. It was a short visit unfortunately and I can’t wait to get back and explore some more.

I loved London - the busyness, the people, the architecture - all good stuff. I was only in London for an evening, but got to see some of the more touristy things like Buckingham Palace, Piccadilly Circus, Parliament and Big Ben, which was all cool.

Can’t wait to get back.

Seam carving for content aware image resizing

August 22nd, 2007

Ariel Shamir and Shai Avidan have come up with a method for “retargeting” photos. An algorithm is used to detect horizontal and vertical seams of pixels with the least gradient magnitude. This path of pixels can then be removed from the photo, shrinking it in size, but preserving the rest of the photo. To increase the size of the photo, pixels are added along the determined seam.

You can view a higher resolution movie at Ariel Shamir web site. There is also a pdf available, however server speeds prevented me from actually downloading it.

RegexPal - JavaScript Regular Expressions Tester

August 10th, 2007

RegexPal is a great little utility for testing JavaScript regular expressions. It’s fast and quite helpful to those learning regular expressions.

Some note features include:

  • Real-time regex syntax highlighting with backwards and forwards context awareness.
  • Lightning-fast match highlighting with alternating styles.
  • Inverted matches (match any text not matched by the regex).

Hip hop meets the violin

August 10th, 2007

Paul Dateh and inka one, layin’ it down. You can find their myspace pages here and here

Tsukuba - nonsense instruments

August 9th, 2007

dsHistory - Back button management with JavaScript

August 1st, 2007

dsHistory internally works somewhat similar to the other history solutions that exist, but it is implemented more like dojo’s bind than anything else. It requires no supporting libraries, it checks in at just over 7kb when compressed, and it is easy to use. The history is thought of as a series of events that have functions attached to them, and the bookmarkable window hash data is designed to be controlled independently from the events (if it is even utilized at all, which I’ve found isn’t desired at times).

See dsHistory in action
Read the full article

Breakin’ - Turbo’s Broom-Dance

August 1st, 2007

That’s hot.

@tomic XML-RPC JavaScript Client

August 1st, 2007

Jon Brisbin has created an XML-RPC JavaScript client called @tomic:

The @tomic XML-RPC client requires ExtJS 1.1, but has no other external requirements. It’s designed to be easy-to-use, flexible, and robust enough for anything you might throw at it. Since this is an initial release, I’m putting it out as a beta (under the GPL).

Ext.onReady( function()
{
    var xmlrpc = new Atomic.util.XMLRPC( {
        url: "xmlrpc.php",
        method: "blogger.getUsersBlogs"
    } );
    // Add parameters to the RPC call
    xmlrpc.addParameter( "0123456789ABCDEF" );
    xmlrpc.addParameter( "MyUsername" );
    xmlrpc.addParameter( "mypassword" );

    // Subscribe to events
    xmlrpc.addListener( "success", function( xhr, xml ) {
        // Handle the response from the XML-RPC service, which is in the 'xml' object
        console.log( xml );
    } );
    xmlrpc.addListener( "fault", function( xhr, fault ) {
        // Handle any faults issued by the XML-RPC server
        Ext.MessageBox.alert( "XML-RPC fault #" + fault.code, fault.message );
    } );

    // make the call
    xmlrpc.call( {
        method: "blogger.getUsersBlogs",
        params: [
             "0123456789ABCDEF",
             "MyUsername",
             "mypassword"
        ]
    } );
}

8BitBoy - Andre Michelle

July 30th, 2007

http://8bitboy.popforge.de/

Karsten Obarski invented 1987 - twenty years ago - the MOD format for his Ultimate Tracker running on Amiga computers. Since then, countless songs are created, especially for the demoscene.

MODs have special attributes. All samples are stored in 8bits and the number of voices is limited to four. To have something similarly to chords, the three notes of it are repeated very fast. This makes MODs sound so freaky.

Finally 8BitBoy brings those songs back online.

Neural Interface - Controlling objects

July 28th, 2007

Pretty sick. The applications are endless!

Helping the handicap and assisting astronauts is cool and all, but what about as a TV remote? Just think, you’d never have to waste your precious energy pushing those remote control buttons any more. If the consequence of sloth is only a pit full of snakes, bring it on.

Installing Apache, PHP and MySQL on Vista

July 27th, 2007

I was expecting the worst, but got everything up and running in about 30 minutes due to some damn easy to follow tutorials. I guess I probably could have figured it out myself, but it’s nice to just get it done.

Installing Apache on Vista
Installing PHP on Vista

Installing MySQL is a no-brainer. Hell, even I could do it.