<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://scox.info/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>scox.info - Random Thoughts - mephisto</title>
  <link>http://scox.info/</link>
  <description></description>
  <language>en</language>
  <pubDate>Wed, 11 Aug 2010 14:18:42 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Migrating from Mephisto to Dotclear 2</title>
    <link>http://scox.info/post/2008/06/10/Migrating-from-Mephisto-to-Dotclear-2</link>
    <guid isPermaLink="false">urn:md5:977d6bfa842850f31311d1d3a130f3e6</guid>
    <pubDate>Tue, 10 Jun 2008 02:42:00 +0200</pubDate>
    <dc:creator>scox</dc:creator>
        <category>code</category>
        <category>dotclear</category><category>mephisto</category>    
    <description>    &lt;p&gt;It's been a while since my last post. Beside the fact that I was busy, the reason preventing me from posting is that the blogging engine I was using (&lt;a href=&quot;http://mephistoblog.com/&quot; hreflang=&quot;en&quot;&gt;Mephisto&lt;/a&gt;) was in a bad shape.
It seemed &lt;a href=&quot;http://mephistoblog.com/2007/3/22/is-mephisto-dead&quot; hreflang=&quot;en&quot;&gt;unmaintaned&lt;/a&gt;, managed to consume all the server memory and didn't survive a rails upgrade.&lt;/p&gt;


&lt;p&gt;That's why I've decided to migrate to &lt;a href=&quot;http://dev.dotclear.net/2.0/&quot; hreflang=&quot;fr&quot;&gt;Dotclear 2&lt;/a&gt;, which seems to be a nice and clean blogging engine.
However, in the migration process, I didn't want to lose:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All my previsous posts (both published and pending)&lt;/li&gt;
&lt;li&gt;All the comments&lt;/li&gt;
&lt;li&gt;Associated metadata (categories, tags and so on)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dotclear has a nice builtin plugin called &lt;em&gt;Import/Export&lt;/em&gt; which let you save and restore backups of your blog.
All I did was writing a Ruby script that generates a dump of the Mephisto database using &lt;em&gt;ActiveRecord&lt;/em&gt; in the same format as &lt;em&gt;Import/Export&lt;/em&gt;, ready to be imported.
It is available &lt;a href=&quot;http://scox.info/public/code/export_to_dc2.rb&quot;&gt;here&lt;/a&gt; and works in the following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Place it under the &lt;em&gt;script&lt;/em&gt; directory of your Mephisto rails root&lt;/li&gt;
&lt;li&gt;Edit the first lines (set your Dotclear 2 &lt;strong&gt;login&lt;/strong&gt; and &lt;strong&gt;blog id&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Run it and redirect the output to your favorite location:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;ruby script/migrate_to_dc2.rb &amp;gt; public/dump.dc2&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Retrieve the dump file (e.g. dump.dc2) and import it in the &quot;Import/Export&quot; area, under the &lt;em&gt;Import a single blog&lt;/em&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's it, you're done. It should have imported all your blog posts (and preserved publish dates as well as many other attributes), comments, metadatas etc.&lt;/p&gt;


&lt;p&gt;I also wanted to maintain backward URL compatibility with Mephisto. A couple of &lt;em&gt;mod_rewrite&lt;/em&gt; rules did the trick:&lt;/p&gt;
&lt;pre&gt;
# Mephisto URL compatiblity
RewriteEngine On
# Feeds
RewriteRule ^/feed/atom.xml /feed/atom [L,R=301]
RewriteRule ^/feed/all_comments.xml$ /feed/atom/comments [L,R=301]
# Posts
RewriteRule (^/200\d.*) /post$1 [QSA,L,R=301]
&lt;/pre&gt;


&lt;p&gt;That's all. I hope it will be useful to anyone wishing to migrate to Dotclear 2, as the process of creating that script is quite annoying :)&lt;/p&gt;</description>
    
          <enclosure url="http://scox.info/public/code/export_to_dc2.rb"
      length="4598" type="text/plain" />
    
    
          <comments>http://scox.info/post/2008/06/10/Migrating-from-Mephisto-to-Dotclear-2#comment-form</comments>
      <wfw:comment>http://scox.info/post/2008/06/10/Migrating-from-Mephisto-to-Dotclear-2#comment-form</wfw:comment>
      <wfw:commentRss>http://scox.info/feed/rss2/comments/7</wfw:commentRss>
      </item>
    
  <item>
    <title>Mephisto Obfuscation Plugin</title>
    <link>http://scox.info/post/2007/4/23/mephisto-obfuscation-plugin</link>
    <guid isPermaLink="false">urn:md5:8831feb025fcf80055ac81337edac174</guid>
    <pubDate>Sun, 22 Apr 2007 20:42:00 +0000</pubDate>
    <dc:creator>scox</dc:creator>
        <category>spam</category>
        <category>mephisto</category><category>obfuscation</category><category>spam</category>    
    <description>    &lt;p&gt;Being tired of receiving &lt;strong&gt;tons&lt;/strong&gt; of spam everyday, I wanted to hide my e-mail address in a more efficient way than the usual &lt;em&gt;user at example dot com&lt;/em&gt;. I needed to obfuscate my address to spam crawlers while keeping it readable by human beings. I've created a simple &lt;a href=&quot;http://mephistoblog.com/&quot;&gt;Mephisto&lt;/a&gt; plugin to help me do so, called &lt;em&gt;MephistoObfuscate&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Basically, this plugin encodes email addresses (or any text you'd like) into &lt;a href=&quot;http://en.wikipedia.org/wiki/Base64&quot;&gt;Base64&lt;/a&gt; and lets the browser decode them using some JavaScript on the client side. That way, the address is protected from crawlers blindly scanning the HTML page but is still readable by JavaScript-enabled browsers.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Using &lt;em&gt;MephistoObfuscate&lt;/em&gt; is pretty straightforward, you can either use a Liquid filter on your templates (useful to show a contact address on the layout, just like the one on the right sidebar of this page):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ &quot;user@example.com&quot; | obfuscate }}&lt;/code&gt;&lt;/pre&gt;Or you can use a macro filter within your blog posts:
&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;filter:obfuscate&amp;gt;user@example.com&amp;lt;/filter:obfuscate&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Both of these will be obfuscated into something like:
&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;span class=&quot;obfuscated&quot;&amp;gt;dXNlckBleGFtcGxlLmNvbQ==l&amp;lt;/span&amp;gt;&lt;/code&gt;
&lt;br /&gt;&lt;br /&gt;Which is not something most if not all spam crawlers will understand. While loading the page the JavaScript code will restore the address back into a human readable fashion.
&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Installing&lt;/h3&gt;
To install just run
&lt;br /&gt;&lt;code&gt;&lt;br /&gt;script/plugin install svn://svn.sig11.org/mephisto_obfuscate&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;After this, add the javascript include statements into your layout:
&lt;br /&gt;&lt;code&gt;&lt;br /&gt;{{ 'obfuscate' | javascript }}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;That's it, you're done.</description>
    
    
    
          <comments>http://scox.info/post/2007/4/23/mephisto-obfuscation-plugin#comment-form</comments>
      <wfw:comment>http://scox.info/post/2007/4/23/mephisto-obfuscation-plugin#comment-form</wfw:comment>
      <wfw:commentRss>http://scox.info/feed/rss2/comments/3</wfw:commentRss>
      </item>
    
</channel>
</rss>