Monthly Archives: November 2007

Clickable links in Twitter html/js badge

In standard Twitter badges, web addresses you write in your posts are not clickable and you need to copy and paste the link in the address bar to visit them. I partly modified the Twitter html/js badge javascript code to automatically recognize the http addresses and change them to proper links.

Twitter linkable badge

If you want to use it, you only need to change the code of your html badger, substituting “http://twitter.com/javascripts/blogger.js” in “http://www.soccio.it/code/twitter/blogger.js“.

Twitter code edit

If you want you can also download the file and place it in another place, or just copy the code and insert it inside your html code.

Magnificent Update!

Alan Hogan made an excellent work on the original script solving a bug and also making the @user clickable as well! Now everytime you address a twit to another user, the script will automatically insert a link to the addressed user twitter page. A great applause to Alan!

@User clickable

The old script has been updated: if you hot-linked it, you won’t need to change anything and it will start working automatically. Otherwise download it again.

Small Update [23 August 2008]

As asked by Jimmy in a comment, the script has been modified to handle links which are written without the classic http://. Now the script also recognizes addresses starting by www. So if you post an address remember to write the www at the beginning (unless there is already a http or other protocols prefix).

This is a quick and dirty edit maybe could be improved. if you hot-linked it, you won’t need to change anything and it will start working automatically. Otherwise download it again.

License [25 October 2008]

Alan and I were asked about the license. We decided the better license for this snippet is the BSD License. This means you can modify and distribute this code in both source and binary form, as long as you keep the copyright notice. A copy of the license is available as standalone file and is also included in the blogger.js file itself.

L’uso frustrante di Gstreamer e Sound Juicer

VioloncellistaSound Juicer è il lettore CD di Gnome, nonché programma adibito all’estrazione dei CD e alla trasformazione delle tracce in un formato compresso: installando tutti i plugin brutti e cattivi di gstreamer si riesce a usare molti formati: MP3, AAC (quello dell’iPod), Ogg Vorbis, Flac e Wave.

I problemi iniziano già subito: in Sound Juicer non è possibile modificare alcuni dettagli delle informazioni che verranno scritte nei file. Non è possibile aggiungere le note, l’autore, l’anno del disco. Ci si può limitare solo a quello che compare nella finestra principale: autore, titolo del brano, album e genere. Se a voi basta, a me certamente no. Per la musica classica, ad esempio, è mia consuetudine aggiungere l’elenco degli esecutori (orchestra, direttore, ecc.) nelle note. Inoltre, se si decide di usare il formato AAC, a mio modesto parere è quello che si sente meglio, su Ubuntu non esiste un solo programma in grado di modificarne i tag (correggetemi se sbaglio): quindi bisogna accontentarsi, e se si sbaglia occorre importare nuovamente il brano. A questo si può rimediare se si usa RhythmBox, che lascia all’utente un po’ più di spazio nella gabbia dell’(in)usabilità.

Detto questo è meglio usare l’MP3, che almeno funziona un po’ dappertutto. Una rapida sbirciata alla documentazione e si diventa in grado di modificare le chain di Gstreamer utilizzate da Sound Juicer per convertire i file. Infatti l’MP3 a 128 Kb/s non è un granché, ed è meglio codificare usando il Variable BitRate (VBR). Teoricamente, sarebbe sufficiente modificare nella chain Audio MP3 la parte relativa a lame in questo modo:

lame vbr=new vbr-mean-bitrate=192 vbr-quality=0

tutte opzioni documentate a cui si può accedere tramite

gst-inspect lame | less

Peccato che così facendo il file risultante avrà una lunghezza dichiarata cinque o sei volte maggiore del reale, colpa di Gstreamer. Meglio spiegare: Gstreamer per codificare gli MP3 utilizza la libreria liblame, che non è altro che il motore di Lame, LAME Ain’t an Mp3 Encoder, uno dei migliori encoder MP3 sulla piazza. Lame, però, con le stesse opzioni crea il file senza che si presenti alcun problema: le stesse opzioni usate tramite Gstreamer portano inesorabilmente ad un file che si sente bene, ma la cui durata è errata. Che, per quanto l’esperienza sonora resti, intatta può essere abbastanza seccante.

La cosa che fa più riflettere è che questo baco è noto almeno dal 16 marzo 2006 (un anno e mezzo fa) e che da allora nulla si è fatto per risolverlo. Magari gli sviluppatori erano troppo impegnati a vendere plugin proprietari tramite Fluendo.

E pazienza se Sound Juicer ha tre pulsanti in meno, ma io pur usando Gnome i CD me li carico usando KAudioCreator, che non usa Gstreamer, ma direttamente Lame. E funziona.
Sarò paziente: il quarto drago è vicino e ci brucerà tutti.