Skip to main content

Ralsina.Me — Roberto Alsina's website

Using TinyURL in python

Is­n'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'

It goes back to the last millenium....

I im­port­ed my old ad­voga­to di­ary so now this blog goes back to 2000/1/17 17:19:57.

For some rea­son I did­n't blog any­thing in 2002, though.

Son of bartleblog XI: the highlight of the syntax

I had a few min­utes wait­ing for yum to do its thing and added a cou­ple of easy fea­tures:

bartleblog9

The Sil­verCi­ty-based code-block syn­tax high­light­ing di­rec­tive was re­placed with a ver­sion us­ing Pyg­ment which sup­ports more lan­guages and is (I think) nicer look­ing... and comes with sev­er­al styles, as you can see above in the con­fig­u­ra­tion di­a­log.

Oth­er than that, I added sup­port in the back­end to:

  • Re­­gen­er­ate HTML from RST ev­ery­where

  • Do the same on­­ly on items marked "dirty"

  • A mod­­el thingie that shows if there are posts or sto­ries with RST er­rors

  • Some GUI love

I need to make the con­fig di­a­log sup­port more than one gad­get at the same time, though ;-)


Contents © 2000-2023 Roberto Alsina