The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
January 31, 2004
(This post is from my old, old, super old site. My views have changed over the years, hopefully my writing has improved, and there is now more than a handful of folks reading my site. Enjoy.)

Saturday, January 31st, 2004

Well, looks like just about everything is ready for VoodooPad 1.1.2 to go final. Got the new icons, got the screenshots updated, and got the dmg's made. I'm going to wait a couple of days yet though before I release it.. just in case something happens like a show-stopping bug shows up.

But I'm happy- this will probably be my last minor release for the 1.1 series- so that means I can devote more effort into "The web application formerly known as VPWiki" and bigger improvements to VoodooPad that I didn't want to do while working on the little stuff.

I've got another GarageBand track that is sort of listenable (if you like blues guitar an plain 1-4-5 progressions). I call it.. um.. "One Four Five" cuz I'm lame. And this sucker is a 4.5M mp3.

Annnndwhatelse? For some reason the Atom blogging api caught my interest yesterday and I decided to see what the password encryption stuff they did is all about. Turns out it's pretty easy to do- I wrote a little python script that'll connect to TypePad (and now I've got an account over there.. their system is awesome).

import time, sha, sys, string, base64, urllib2, random

def passwordDigest(password, timestamp, nonce):   shad = sha.new(nonce + timestamp + password).digest()   return string.strip(base64.encodestring(shad))

def getNonce():   return sha.new(str("Random!@#@900000a") + str(time.time()) + str(random.random())).hexdigest()

grab our timestamp

timestamp = time.strftime('%YmdT%H:%M:%SZ', time.gmtime())

username = sys.argv[1] password = sys.argv[2]

nonce = getNonce() digest = passwordDigest(password, timestamp, nonce)

req = urllib2.Request("http://www.typepad.com/t/atom/weblog") req.add_header("Content-Type", "application/atom+xml")

authHeader = 'UsernameToken Username="%s", PasswordDigest="%s", Created="%s", Nonce="%s"' % (username, digest, timestamp, nonce)

req.add_header("X-WSSE", authHeader)

f = urllib2.urlopen(req)

print f.read()

Fun, and good stuff to know in case I ever feel like writing a blogging client again.

-- posted 1:45 pm