<p>In the last days, I&#8217;ve been changing some stuff in this blog. As requested by some users, I made a <span class="caps">RSS</span> feed for comments, so you can be warned when new comments are made. It was also meant to work with <a href="http://bloppy.info">Bloppy</a>, but there is some weird thing going on, I will correct with <a href="http://mywheel.net">M&#225;rio Lopes</a>, it&#8217;s author.</p>

<p>I&#8217;ve also added <a href="http://www.gravatar.com/" target="_blank">Gravatars</a> to the comments. For those who don&#8217;t know what it is, it&#8217;s simply a 80&#215;80px avatar that is associated with your email address and used in a lot of blog systems. As in the official website, there was <span class="caps">PHP</span>, <span class="caps">PERL</span>, ColdFusion and <span class="caps">JAVA</span> implementation, but no Python, here it goes:</p>

<div class="code">
_url_encre = re.compile(r"[^A-Za-z0-9_.!~*()-]")<br />_url_decre = re.compile(r"%([0-9A-Fa-f]{2})")<br />_html_encre = re.compile("[&<>\"'+]")<br />_html_encodes = { "&": "&amp;", "<": "&lt;", ">": "&gt;", "\"": "&quot;","'": "&#39;", "+": "&#43;" }<br /><br />def url_encode(raw):<br />&nbsp;&nbsp;&nbsp;&nbsp;if not isinstance(raw, unicode):<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw = str(raw)<br />&nbsp;&nbsp;&nbsp;&nbsp;return re.sub(_url_encre, lambda m: "%%%02X" % ord(m.group(0)), raw)<br /><br />
def gravatar(email,size='80',rating='R',default=''):<br />&nbsp;&nbsp;&nbsp;&nbsp;import md5<br />&nbsp;&nbsp;&nbsp;&nbsp;gr=md5.new(email)<br />&nbsp;&nbsp;&nbsp;&nbsp;return &quot;http://www.gravatar.com/avatar.php?gravatar_id=&quot; + str(gr.hexdigest()) + &quot;&amp;amp;size=&quot; + str(size) + &quot;&amp;amp;rating=&quot; + str(rating) + &quot;&amp;amp;default=&quot; + url_encode(str(default))
</div>

<p>And this code is part of my Pungi webmicroframework I think I might release in September. Let's see how it goes.</p>
<p>Yet regarding Gravatars, I was thinking of adding it to ejaki, but the fact that an API is not available for creating gravatars is taking that idea out of my mind. Who knows, with Gravatar v2...</p>


<p>Note: I&#8217;ve been victim of a slow internet connection for this weekend. I blame <a href="http://acesso.sapo.pt"><span class="caps">SAPO</span></a> and hope it will be restored as soon as possible :/</p>