La Classe Américaine – Android

Hey, fel­low english-reading vis­i­tor, this post is going to be in French! Hope you don’t mind.

Si comme moi vous ne pou­vez pas vous empêcher de dire “flim”, “ouiche” ou encore “un pour l’argent, deux pour le spec­ta­cle et trois pour le cail­lou”, cette appli­ca­tion est pour vous.

Après une semaine de vacances avec une per­sonne touchée par cette mal­adie et sans avoir accès à Inter­net j’ai vite réal­isé qu’il me fal­lait une appli­ca­tion con­tenant tout le script de ce mag­nifique flim : La Classe Améri­caine. Je savais qu’un fou avait déjà fait tout le sale boulot et qu’il ne me restait plus qu’à extraire ces don­nées et créer l’interface pour les parcourir…

Grâce à Google Chrome et ses Out­ils de développe­ment j’ai pu injecter MooTools dans la page. Petite astuce très sim­ple et très pra­tique (script à copier/coller dans la console) :

var scriptNode = document.createElement('SCRIPT');
scriptNode.type = 'text/javascript';
scriptNode.src = 'https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js';
var headNode = document.getElementsByTagName('HEAD');
if (headNode[0] != null) headNode[0].appendChild(scriptNode);

Après ça, quelques lignes pour extraire les don­nées, les net­toyer et les stocker directe­ment dans le presse-papier au for­mat JSON :

var data=[];
var images=$$('table.script img');
for (var i=0; i<images.length; i++) {
    var tr=images[i].getParent().getParent();
    var o={};
    var scriptTag=tr.getElements('td')[2];
    scriptTag.getElements('a').dispose();
    data.push({
        ts:tr.getElement('small').get('text'),
        script:scriptTag.get('html')
			.split('’').join("'")
			.replace(/\n/, '')
			.replace(/<br>\n$/, '')
    });
}
console.log(data.length);
copy(JSON.encode(data));

Un petit coup de Flash Builder, saupoudré de Robot­legs et hop, une appli Android ! Pas de ver­sion iPhone pour l’instant, mais si quelqu’on m’offre de quoi me payer un cer­ti­fi­cat de développeur, je ne dis pas non !

Au revoir, Messieurs-Dames. C’est ça, la puis­sance intel­lectuelle. Bac + 2, les enfants.

Paper

Intro­duc­ing my lat­est project: TW Paper, a sim­ple iPhone/iPod touch wall­pa­per gallery+collection.

paper-blog-post

A lit­tle bit of JavaScript and some Photoshop/CSS trick­ery to present a grow­ing col­lec­tion of images designed for your favorite piece of technology!

The page also works on iPhone/iPod touch but looks a lit­tle dif­fer­ent for bet­ter usabil­ity. Just tap+hold on the image to save it.

Paper on iPhone

Expect the gallery to evolve, with new images and quotes!

Scroll Clock

I played with MooTools a bit and did that. Use­less, open­source, nerdy.

Scroll Clock

I also set up a gallery, so if you’ve got nice scroll­bars that aren’t here yet, send’ em right away!

TWPlaylist

I wanted to do this for quite some time: a place that logs tracks I lis­ten to.

TWPlaylist

Intro­duc­ing TWPlaylist! Thanks to Twit­ter and a Winamp Plu­gin, all tracks that I lis­ten to (at work) are stored on a dummy account (if you know a plu­gin that does the same for iTunes, please let me know). And to keep things nice and smooth, I set up a quick page that pulls this data and dis­plays it thanks to some AJAX magic… Tracks link to a Discogs search page to find more about them.

As you can read the project page’s bot­tom, every­thing I wrote is open­source. HTML, CSS and JS ; help your­self. Noth­ing too fancy, but it could pre­vent you from wast­ing time… By the way, the code should be self-explanatory, but if it’s not I can help.

You will prob­a­bly notice the some tracks’ data look weird, in fact the Winamp plu­gin chokes on spe­cial char­ac­ters such as “&” and accented let­ters… I hope this gets fixed one day.

I’ve never been a big fan of Twit­ter as I think most user don’t use it the way it should be used, for exam­ple by hav­ing pri­vate dis­cus­sions or retweet­ing too much. How­ever it’s a pretty inter­est­ing plat­form for exper­i­men­ta­tion and art projects. What do you think?

[Sept. 2011 Update] I “donated” the twplaylist Twit­ter account to a char­ity cam­paign, so I moved the account archives to twplaylist_bckp.