Gregory Bodnar: Still just telling stories

Tue, 23 Nov 2004

Funeral Spam

I didn't pay a lot of attention to the first few, but they seem to be growing in numbers. Things like this:
-> 32 N 11/22 mikechinwuba@tt (2.8K) STAND AS NEXT OF KIN TO LATE MR JIM CUMMING

It is just another variation of the Nigerian plea spam, but I'm really wondering if this tactic works any better than the others.

[2004-11-22T11:00:00Z] | [/meandering] | #
[65 words]

MPD+Audioscrobbler

The plugin is well into the third iteration already, and for the most part, it works. I've been submitting quite a few songs before a bug will sneak up and throw an exception that doesn't get handled.

For instance:

Changing state from Setup to Handshake
-->Handshaking
(url == http://post.audioscrobbler.com/?hs=true&c=tst&v=0.1&u=sapheron&p=1.1)
Traceback (most recent call last):
  File "./mpdscrobbler.py", line 62, in ?
    s.state_machine.run()
  File "/home/greg/source/python/libscrobbler/state.py", line 67, in run
    self[self.current_state].run()
  File "/home/greg/source/python/libscrobbler/state.py", line 39, in run
    self.run_fn()
  File "/home/greg/source/python/libscrobbler/libscrobbler.py", line 253, in handshake
    result = urllib2.urlopen(url).readlines()
  File "/usr/lib/python2.3/urllib2.py", line 129, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.3/urllib2.py", line 326, in open
    '_open', req)
  File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 901, in http_open
    return self.do_open(httplib.HTTP, req)
  File "/usr/lib/python2.3/urllib2.py", line 895, in do_open
    return self.parent.error('http', req, fp, code, msg, hdrs)
  File "/usr/lib/python2.3/urllib2.py", line 352, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 412, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Unavailable

In that case, the server went down, presumably for service or something out of my control. But I'm not handling it properly. I also just noticed that mpd can spit out track numbers as a ratio, which I should have realised. I'll have to parse the string before ripping out an integer value.

Not only am I finding bugs in my code, though, I found one on the server side, too. Time was showing up as NZST instead of NZDT. That might be the source of the current outage. I wonder if they're fixing it now.

[2004-11-22T11:00:00Z] | [/tech] | #
[273 words]