Using TinyURL in python
Isn't this neat?
import urllib
def makeTiny(url):
url='http://tinyurl.com/api-create.php?'+urllib.urlencode({'url':url})
return urllib.urlopen(url).read()
>>> makeTiny('http://www.kde.org')
'http://tinyurl.com/3cnthx'
Isn't this neat?
import urllib
def makeTiny(url):
url='http://tinyurl.com/api-create.php?'+urllib.urlencode({'url':url})
return urllib.urlopen(url).read()
>>> makeTiny('http://www.kde.org')
'http://tinyurl.com/3cnthx'
I was going to write one, but there's absolutely no need when there is this one
I imported my old advogato diary so now this blog goes back to 2000/1/17 17:19:57.
For some reason I didn't blog anything in 2002, though.
I had a few minutes waiting for yum to do its thing and added a couple of easy features:

The SilverCity-based code-block syntax highlighting directive was replaced with a version using Pygment which supports more languages and is (I think) nicer looking... and comes with several styles, as you can see above in the configuration dialog.
Other than that, I added support in the backend to:
Regenerate HTML from RST everywhere
Do the same only on items marked "dirty"
A model thingie that shows if there are posts or stories with RST errors
Some GUI love
I need to make the config dialog support more than one gadget at the same time, though ;-)