<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Michele Campeotto: Tag web</title>
    <link>http://blog.micampe.it/articles/tag/web?tag=web</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>I'm not Winston Wolfe.</description>
    <item>
      <title>Splicing your feeds with Yahoo! Pipes</title>
      <description>&lt;p&gt;One of the services that made me subscribe to &lt;a href="http://feedburner.com/"&gt;FeedBurner&lt;/a&gt; when it has been launched, was the ability to splice my Flickr pictures and my del.icio.us bookmarks together with my blog feed. The problem with doing this with FeedBurner is that it is somewhat limited: I can&amp;#8217;t splice together arbitrary feeds, just the ones from the supported services.&lt;/p&gt;

&lt;p&gt;The easiest solution I could come up with, was using a personal installation of &lt;a href="http://planetplanet.org/"&gt;Planet&lt;/a&gt; where I&amp;#8217;d subscribe my feeds and then take just resulting feed from there, but I never managed to do this, too much grunt work to do on my part: it wasn&amp;#8217;t fun.&lt;/p&gt;

&lt;p&gt;Then, Yahoo! launched &lt;a href="http://pipes.yahoo.com/"&gt;Pipes&lt;/a&gt;. Pipes is a very nice service which allows you to play with feeds and munge them together by applying different kinds of filters. Pipes are fun to play with you drag and drop the building blocks, connect them together, add some magic and you have your new feed.&lt;/p&gt;

&lt;p&gt;Some days ago, Gina Trapani posted an article on lifehacker explaining &lt;a href="http://lifehacker.com/software/feeds/geek-to-live--create-your-master-feed-with-yahoo-pipes-235726.php"&gt;how to build your master feed&lt;/a&gt;, collecting all the feeds you produce on various blogs and services together in a single feed. She also has an example on how to inspect the feed contents to filter some items from the resulting feed.&lt;/p&gt;

&lt;p&gt;In her article, Gina says she&amp;#8217;d like to add a prefix for the feed source to differentiate the item titles. Here I have a demonstration of the power of Yahoo!&amp;#8217;s new toy: you can do that, by &lt;a href="http://pipes.yahoo.com/pipes/qNtovDTH2xGi9LMuJzBjOg/"&gt;using the Regex operator module to change the contents of an item&amp;#8217;s element&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The steps to build a Pipe like this are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use a different Fetch source for each of your feeds&lt;/li&gt;
&lt;li&gt;filter the elements you don&amp;#8217;t want&lt;/li&gt;
&lt;li&gt;apply the Regex operator to the title to replace &amp;#8221;&lt;code&gt;^&lt;/code&gt;&amp;#8221; with &amp;#8221;&lt;code&gt;Source:&lt;/code&gt;&amp;#8221;, which is just Regex-fu for &amp;#8220;put the source name in front of the title&amp;#8221; (you&amp;#8217;ll have to put the actual name you want for the source instead of &amp;#8220;Source&amp;#8221;, see the example &lt;a href="http://pipes.yahoo.com/pipes/qNtovDTH2xGi9LMuJzBjOg/"&gt;pipe&lt;/a&gt; I created). (updated with &lt;a href="http://lifehacker.com/software/yahoo!/yahoo-pipes-master-feed-update-240520.php#c1034919"&gt;hint by muczachan&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;put all the resulting feeds in a Union operator&lt;/li&gt;
&lt;li&gt;sort the Union output feed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Optionally, you can limit the number of items in the resulting feed by using the Truncate operator. Also, should you have more feeds than the five input sockets of the Union module provides, you can add more Union modules and then combine them with another one.&lt;/p&gt;

&lt;p&gt;Feel free to clone the &lt;a href="http://pipes.yahoo.com/pipes/qNtovDTH2xGi9LMuJzBjOg/"&gt;pipe&lt;/a&gt; I created and adapt it to your own feeds.&lt;/p&gt;</description>
      <pubDate>Wed, 28 Feb 2007 06:42:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:1244163d-5d64-40b3-97b6-d678cffd7adc</guid>
      <author>micampe</author>
      <link>http://blog.micampe.it/articles/2007/02/28/splicing-your-feeds-with-yahoo-pipes</link>
      <category>English</category>
      <category>yahoo</category>
      <category>pipes</category>
      <category>feeds</category>
      <category>web</category>
      <category>mashup</category>
      <trackback:ping>http://blog.micampe.it/articles/trackback/1075</trackback:ping>
    </item>
    <item>
      <title>A little Django feature nobody tells you about</title>
      <description>&lt;p&gt;Recently i got involved in a &lt;a href="http://it.blogbabel.com/"&gt;new project&lt;/a&gt; which uses Django, so I started learning and using it. I won&amp;#8217;t tell you here it merits as those have alread been described at lenght.&lt;/p&gt;

&lt;p&gt;One of the features I like about Django are its pluggable applications: you can build a generic piece of code and that can easily be plugged in other&amp;#8217;s sites to get some new functionality. Great examples of this are found in the &lt;code&gt;django.contrib&lt;/code&gt; package, which include the already famous administrative interface, two comments systems, an authentication/authorization framework and more.&lt;/p&gt;

&lt;p&gt;One problem you&amp;#8217;ll soon find is that some of these are tied to be plugged at a fixed URL prefix. The auth system, for example, expects to be plugged in the &lt;code&gt;/accounts/&lt;/code&gt; directory and plugging it somewhere else leads to some more work for you. The easiest example is the &lt;code&gt;@login_required&lt;/code&gt; decorator, which checks the user that is calling a view and, if it is not authenticated, it redirects to &lt;code&gt;/accounts/login&lt;/code&gt;. If you have used a different URL prefix, you are forced to use the &lt;code&gt;@user_passes_test&lt;/code&gt; decorator, which allows you to set the redirect URL.&lt;/p&gt;

&lt;p&gt;Where is the problem? The problem is that those paths are explicitly hardocded in the views.&lt;/p&gt;

&lt;p&gt;How to solve it? Dynamically build your URLs from your &lt;code&gt;urlconf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;How do you do that? With &lt;code&gt;django.core.urlresolvers.reverse()&lt;/code&gt;&lt;/p&gt;&lt;p&gt;That little boy helps you by giving you the URL path that would be called given a view and a set of parameters. Here is an example, suppose your urlconf has something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;urlpatterns = patterns('',
    (r'^/blog/(?P&amp;lt;year&amp;gt;\d{4})/(?P&amp;lt;month&amp;gt;\d{2})/(?P&amp;lt;day&amp;gt;\d{2})/(?P&amp;lt;slug&amp;gt;[-\w]+)/$',
        'dlog.blog.views.entry'),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;you could create a function like this to get the URL of an entry:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    def get_absolute_url(self):
        return urlresolvers.reverse('dlog.blog.views.entry',
                kwargs={'year':self.pubdate.year,
                        'month':('%02d' % self.pubdate.month),
                        'day':('%02d' % self.pubdate.day),
                        'slug':self.slug})
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;when you then call an entry&amp;#8217;s &lt;code&gt;get_absolute_url()&lt;/code&gt; method, you&amp;#8217;ll get the URL as urlconf expects it.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/blog/2007/01/06/your-slug-goes-here
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I don&amp;#8217;t know why this isn&amp;#8217;t mentioned anywhere in the docs, I found it by hunting down the source code because I didn&amp;#8217;t like hardcoding paths in my views.&lt;/p&gt;

&lt;p&gt;I can understand it has some problems: it gives you only URLs relative to the root of the Django project, if you need an absolute URL or if you attached the site to a subdirectory of your domain, &lt;code&gt;urlresolvers.reverse()&lt;/code&gt; is not enough, but I still think it should be advertised in the documentation.&lt;/p&gt;

&lt;p&gt;One more thing, as everybody starting to use Django, I wrote a web log with it. But I haven&amp;#8217;t replaced this one, I created a new one, but this time in Italian and that will be more personal and, hopefully, a real blog that I update it more often than monthly and I actually &lt;a href="http://it.blogbabel.com/"&gt;participate&lt;/a&gt;. So, if you can read Italian follow me on &lt;a href="http://michele.campeotto.net/"&gt;my new corner&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 06 Jan 2007 07:38:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:f507f9ce-ec95-4420-a60b-845a11c08ef0</guid>
      <author>micampe</author>
      <link>http://blog.micampe.it/articles/2007/01/06/a-little-django-feature-nobody-tells-you-about</link>
      <category>English</category>
      <category>django</category>
      <category>web</category>
      <category>python</category>
      <trackback:ping>http://blog.micampe.it/articles/trackback/1071</trackback:ping>
    </item>
    <item>
      <title>Just because we are talking about freedoms</title>
      <description>&lt;blockquote&gt;
    &lt;p&gt;When &lt;a href="http://dig.csail.mit.edu/breadcrumbs/node/144"&gt;I invented the Web&lt;/a&gt;, I didn&amp;#8217;t have to ask anyone&amp;#8217;s permission. Now, hundreds of millions of people are using it freely. I am worried that that is going end in the USA.&lt;/p&gt;
&lt;/blockquote&gt;</description>
      <pubDate>Fri, 23 Jun 2006 02:06:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:76b04419-1428-408c-84df-83a37a7961d3</guid>
      <author>micampe</author>
      <link>http://blog.micampe.it/articles/2006/06/23/just-because-we-are-talking-about-freedoms</link>
      <category>English</category>
      <category>web</category>
      <category>freedom</category>
      <category>net</category>
      <category>telco</category>
      <category>information</category>
      <trackback:ping>http://blog.micampe.it/articles/trackback/243</trackback:ping>
    </item>
    <item>
      <title>Il grande switch</title>
      <description>&lt;p&gt;Nonostante il mio &lt;a href="http://blog.micampe.it/articles/2006/06/16/i-was-waiting-for-this-conversation"&gt;breve recente post&lt;/a&gt; fosse poco più che riportare un paio di link, ha avuto l&amp;#8217;effetto di stimolare un po&amp;#8217; la discussione anche intorno a me e mi sento in dovere di espandere un po&amp;#8217; quello a cui ho pensato leggendo queste discussioni.&lt;/p&gt;

&lt;p&gt;Credo che ci siano due filoni distinti, che sono stati raccolti da persone diverse: &lt;a href="http://diveintomark.org/archives/2006/05/30/bye-apple"&gt;Mark Pilgrim ha cambiato sistema operativo&lt;/a&gt; da Mac OS X a Ubuntu Linux (primo filone) perché vuole avere la sicurezza di poter conservare a lungo e intatti i propri dati (secondo filone).&lt;/p&gt;

&lt;p&gt;Entrambi i filoni possono prendere strade diverse, una, comune tra i due, è quella che riguarda &lt;a href="http://persone.softwarelibero.org/person/micampe&amp;amp;start=94"&gt;la libertà&lt;/a&gt; del software e dei formati che usiamo, un&amp;#8217;altra è quella più pratica, che riguarda più il software che usiamo e il modo in cui produciamo e trattiamo i nostri dati. Credo che una delle più grandi qualità di Mark e il motivo per cui è così efficace in quello che scrive, è che riesce a &lt;a href="http://diveintomark.org/archives/2004/05/14/freedom-0"&gt;collegare direttamente l&amp;#8217;importanza della libertà alle applicazioni pratiche&lt;/a&gt;, invece che concentrarsi su astratta filosofia che difficilmente convince chi il computer lo usa per risolvere i problemi pratici.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://qix.it/archive/20060616/quale-sistema-operativo"&gt;Ludo&lt;/a&gt; sceglie di commentare l&amp;#8217;abbandono di OS X e mi chiama direttamente in causa, &lt;a href="http://www.redmonk.com/sogrady/archives/001810.html"&gt;Stephen O&amp;#8217;Grady&lt;/a&gt; sullo stesso argomento si concentra di più sul &lt;em&gt;perché&lt;/em&gt; Mark ha scelto Ubuntu e sul perché questo è successo &lt;em&gt;ora&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Io fondamentalmente concordo con Stephen sul fatto che questa discussione sia arrivata ora perché Ubuntu ha alzato lo standard delle distribuzioni Linux, cosa appunto dimostrata dal fatto che Mark la considera sufficientemente buona da sostituire Mac OS X nonostante la sua più che ventennale esperienza su Mac. Come conseguenza, anche &lt;a href="http://www.tbray.org/ongoing/When/200x/2006/06/15/Switch-From-Mac"&gt;Tim Bray&lt;/a&gt; è stato portato a considerare nuovamente la possibilità di usare Linux.&lt;/p&gt;

&lt;p&gt;A Ludo ho risposto direttamente nei commenti, ma riporto qui la mia considerazione puramente pratica: Windows non riesco ad usarlo, nel senso che non sono capace. Quando lo uso sono lento, mi scontro con problemi (chi mi dice se e come posso far funzionare il deploy remoto da uno script ant su Tomcat su un server Windows?) che non capisco e non so da dove iniziare per risolvere. Alle partite non sono molto interessato quindi mi accontento di vederle in TV :).&lt;/p&gt;

&lt;p&gt;Riguardo invece alla questione della conservazione dei dati non penso ci sia molto da dire, sta diventando sempre più importante man mano che la nostra vita diventa più digitale. L&amp;#8217;esempio più semplice sono le foto: tra vent&amp;#8217;anni quale sarà il corrispondete della scatola di cartone dove mia mamma tiene le foto di quand&amp;#8217;era piccola?&lt;/p&gt;

&lt;p&gt;Mi è piacuto molto anche il post di &lt;a href="http://tantek.com/log/2006/06.html#d17t2231"&gt;Tantek Çelik&lt;/a&gt; (uno dei pochi incentrato &lt;em&gt;direttamente&lt;/em&gt; sulla questione dei dati), in cui riflette sul fatto che al momento il modo più sicuro per salvare i propri dati è ancora il testo ASCII, ma che è ora di trovare qualcosa di nuovo e più evoluto. La sua idea che XHTML e i &lt;a href="http://microformats.org"&gt;microformati&lt;/a&gt; possano essere questo nuovo modo e garantire lo stesso grado di affidabilità del semplice testo è sicuramente interessante e ragionevolmente plausibile. É una soluzione limitata però al testo che, nonostante sia sicuramente il metodo più utilizzato per la trasmissione della conoscenza, non fa i conti con il fatto che &lt;a href="http://daringfireball.net/2006/06/drm_interoperability"&gt;musica e video&lt;/a&gt;, di nuovo grazie al &lt;em&gt;&amp;#8220;digital lifestyle&amp;#8221;&lt;/em&gt;, se mi si passa il termine, e a nuove formule per la &lt;a href="http://creativecommons.org/"&gt;distribuzione della conoscenza&lt;/a&gt;, sono sempre più alla portata di tutti.&lt;/p&gt;

&lt;p&gt;Torno quindi all&amp;#8217;inizio: la riflessione di Mark, come il tema dell&amp;#8217;incontro a cui ho partecipato &lt;a href="http://www.sherwood.it/Incontro-Copiare-il-software-non-e"&gt;ieri sera&lt;/a&gt; ha moltissime diramazioni e personalmente penso che la strada sia quella dell&amp;#8217;apertura. Citando l&amp;#8217;&lt;a href="http://daringfireball.net/2006/06/drm_interoperability"&gt;articolo di John Gruber&lt;/a&gt;, &lt;q cite="http://daringfireball.net/2006/06/drm_interoperability"&gt;Record industry executives refuse to believe what is patently obvious to anyone with a clue — they are never ever going to regain complete control over the distribution of recorded music.&lt;/q&gt; Credo che questo non si applichi solo alla musica.&lt;/p&gt;</description>
      <pubDate>Thu, 22 Jun 2006 05:03:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:36fd3e04-ba26-40ee-8b43-a92652c82c74</guid>
      <author>micampe</author>
      <link>http://blog.micampe.it/articles/2006/06/22/il-grande-switch</link>
      <category>Italiano</category>
      <category>web</category>
      <category>linux</category>
      <category>ubuntu</category>
      <category>opensource</category>
      <category>commons</category>
      <category>data</category>
      <category>operatingsystems</category>
      <trackback:ping>http://blog.micampe.it/articles/trackback/242</trackback:ping>
    </item>
    <item>
      <title>My first greasemonkey</title>
      <description>&lt;p&gt;Don&amp;#8217;t you find it annoying when &lt;a href="http://projects.edgewall.com/trac/"&gt;sites&lt;/a&gt; set numeric access keys and when you press &lt;code&gt;Alt-2&lt;/code&gt; to change tab you get the side effect of also changing the page you was reading?&lt;/p&gt;

&lt;p&gt;This is an &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=128452"&gt;old&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=264204"&gt;bug&lt;/a&gt; reported the first time for Mozilla, back when &lt;strike&gt;Phoenix&lt;/strike&gt; &lt;strike&gt;Firebird&lt;/strike&gt; Firefox didn&amp;#8217;t even exist, but to date no fix has been released (eh, the wonders of multi-platformness).&lt;/p&gt;

&lt;p&gt;My first greasemonkey script fixes this annoyance by &lt;a href="http://userscripts.org/scripts/show/4042"&gt;removing the numeric accesskeys&lt;/a&gt; from the page.&lt;/p&gt;

&lt;p&gt;Accesskeys are a strange feature in web sites: they are invisible, so you are not using them unless the site developer has been smart and displayed them himself, and they cause these kind of annoyances by triggering when you don&amp;#8217;t expect.&lt;/p&gt;

&lt;p&gt;The browser should show them in some way, maybe with an icon or a message in the status bar, or a (timed?) yellow notification like the one you get when popups are blocked.&lt;/p&gt;</description>
      <pubDate>Mon, 08 May 2006 00:39:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:b416f71e-ff75-4a2c-82d5-476749dbbd54</guid>
      <author>micampe</author>
      <link>http://blog.micampe.it/articles/2006/05/08/my-first-greasemonkey</link>
      <category>English</category>
      <category>firefox</category>
      <category>greasemonkey</category>
      <category>web</category>
      <category>annoyances</category>
      <trackback:ping>http://blog.micampe.it/articles/trackback/210</trackback:ping>
    </item>
  </channel>
</rss>
