<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Overkill Email Obfuscation with Ruby and Javascript</title>
	<atom:link href="http://unixmonkey.net/?feed=rss2&#038;p=20" rel="self" type="application/rss+xml" />
	<link>http://unixmonkey.net/?p=20</link>
	<description>creative engineering and technological abuse</description>
	<lastBuildDate>Thu, 05 Aug 2010 19:47:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anonymous</title>
		<link>http://unixmonkey.net/?p=20&#038;cpage=1#comment-20426</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 13 Nov 2009 02:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://unixmonkey.net/?p=20#comment-20426</guid>
		<description>Good stuff.  Here is another method in Rails which relies on BlueCloth...

    def email_link(email)
      markdown(&quot;&quot;).gsub!(/\/?/, &#039;&#039;)
    end</description>
		<content:encoded><![CDATA[<p>Good stuff.  Here is another method in Rails which relies on BlueCloth&#8230;</p>
<p>    def email_link(email)<br />
      markdown(&#8221;").gsub!(/\/?/, &#8221;)<br />
    end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Macario Ortega</title>
		<link>http://unixmonkey.net/?p=20&#038;cpage=1#comment-16923</link>
		<dc:creator>Macario Ortega</dc:creator>
		<pubDate>Thu, 16 Jul 2009 17:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://unixmonkey.net/?p=20#comment-16923</guid>
		<description>Yet a bit cleaner:

  def html_obfuscate string
    string.unpack(&#039;C*&#039;).collect{ &#124;char&#124; &quot;&amp;##{ char };&quot; }.join
  end</description>
		<content:encoded><![CDATA[<p>Yet a bit cleaner:</p>
<p>  def html_obfuscate string<br />
    string.unpack(&#8217;C*&#8217;).collect{ |char| &#8220;&amp;##{ char };&#8221; }.join<br />
  end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin R.</title>
		<link>http://unixmonkey.net/?p=20&#038;cpage=1#comment-6283</link>
		<dc:creator>Justin R.</dc:creator>
		<pubDate>Sat, 02 Aug 2008 07:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://unixmonkey.net/?p=20#comment-6283</guid>
		<description>&lt;code&gt;
&lt;pre lang=&quot;ruby&quot;&gt;
def html_obfuscate(string)
    lower = (&#039;a&#039;..&#039;z&#039;).to_a
    upper = (&#039;A&#039;..&#039;Z&#039;).to_a
    string.split(&#039;&#039;).map { &#124;char&#124;  
      output = lower.index(char) + 97 if lower.include?(char)
      output = upper.index(char) + 65 if upper.include?(char)
      output ? &quot;&amp;##{output};&quot; : char
    }.join
  end
&lt;/pre&gt;
&lt;/code&gt;
 is a bit cleaner...</description>
		<content:encoded><![CDATA[<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">def</span> html_obfuscate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">string</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    lower = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'a'</span>..<span style="color:#996600;">'z'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span>
    upper = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'A'</span>..<span style="color:#996600;">'Z'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span>
    <span style="color:#CC0066; font-weight:bold;">string</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |char|  
      output = lower.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span>char<span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#006666;">97</span> <span style="color:#9966CC; font-weight:bold;">if</span> lower.<span style="color:#9966CC; font-weight:bold;">include</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>char<span style="color:#006600; font-weight:bold;">&#41;</span>
      output = upper.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span>char<span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#006666;">65</span> <span style="color:#9966CC; font-weight:bold;">if</span> upper.<span style="color:#9966CC; font-weight:bold;">include</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>char<span style="color:#006600; font-weight:bold;">&#41;</span>
      output ? <span style="color:#996600;">&quot;&amp;amp;##{output};&quot;</span> : char
    <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p></code><br />
 is a bit cleaner&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Wilmans</title>
		<link>http://unixmonkey.net/?p=20&#038;cpage=1#comment-5770</link>
		<dc:creator>Jan Wilmans</dc:creator>
		<pubDate>Sat, 19 Jul 2008 22:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://unixmonkey.net/?p=20#comment-5770</guid>
		<description>Hi, 

Nice code!

I&#039;ve changed it a bit to my liking, I think it&#039;s both shorter and safer:
The only thing I broke was noscript support, but I really dont care that
people using a non-javascript browser can&#039;t email me...

&lt;pre lang=&quot;ruby&quot;&gt;
# Rot13 encodes a string
def rot13(string)
  string.tr &quot;A-Za-z&quot;, &quot;N-ZA-Mn-za-m&quot;
end

# Takes in an email address and (optionally) anchor text,
# its purpose is to send the email address rot13&#039;d to
# javascript so it is never actually send in plain text
def antispam_email_link(email, linktext=email)

  content = &quot;it is : &lt;a&gt;&quot; + linktext + &quot;&lt;/a&gt;&quot;
  rot13_encoded_email = rot13(content) # obfuscate email address as rot13

  out = &quot;\n&quot;
  out += &quot;  &lt;!--\n&quot;
  out += &quot;    string = &#039;#{rot13_encoded_email}&#039;.replace(/[a-zA-Z]/g, function(c){ return String.fromCharCode((c = (c = c.charCodeAt(0) + 13) ? c : c - 26);});\n&quot;
  out += &quot;    document.write(string); \n&quot;
  out += &quot;  //--&gt;\n&quot;
  out += &quot;\n&quot;
  return out
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>Nice code!</p>
<p>I&#8217;ve changed it a bit to my liking, I think it&#8217;s both shorter and safer:<br />
The only thing I broke was noscript support, but I really dont care that<br />
people using a non-javascript browser can&#8217;t email me&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#008000; font-style:italic;"># Rot13 encodes a string</span>
<span style="color:#9966CC; font-weight:bold;">def</span> rot13<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">string</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">string</span>.<span style="color:#9900CC;">tr</span> <span style="color:#996600;">&quot;A-Za-z&quot;</span>, <span style="color:#996600;">&quot;N-ZA-Mn-za-m&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Takes in an email address and (optionally) anchor text,</span>
<span style="color:#008000; font-style:italic;"># its purpose is to send the email address rot13'd to</span>
<span style="color:#008000; font-style:italic;"># javascript so it is never actually send in plain text</span>
<span style="color:#9966CC; font-weight:bold;">def</span> antispam_email_link<span style="color:#006600; font-weight:bold;">&#40;</span>email, linktext=email<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  content = <span style="color:#996600;">&quot;it is : &lt;a&gt;&quot;</span> + linktext + <span style="color:#996600;">&quot;&lt;/a&gt;&quot;</span>
  rot13_encoded_email = rot13<span style="color:#006600; font-weight:bold;">&#40;</span>content<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># obfuscate email address as rot13</span>
&nbsp;
  out = <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span>
  out += <span style="color:#996600;">&quot;  &amp;lt;!--<span style="color:#000099;">\n</span>&quot;</span>
  out += <span style="color:#996600;">&quot;    string = '#{rot13_encoded_email}'.replace(/[a-zA-Z]/g, function(c){ return String.fromCharCode((c = (c = c.charCodeAt(0) + 13) ? c : c - 26);});<span style="color:#000099;">\n</span>&quot;</span>
  out += <span style="color:#996600;">&quot;    document.write(string); <span style="color:#000099;">\n</span>&quot;</span>
  out += <span style="color:#996600;">&quot;  //--&amp;gt;<span style="color:#000099;">\n</span>&quot;</span>
  out += <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span>
  <span style="color:#0000FF; font-weight:bold;">return</span> out
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Overkill Email Obfuscation with Ruby and Javascript &#124; Pest Identification</title>
		<link>http://unixmonkey.net/?p=20&#038;cpage=1#comment-966</link>
		<dc:creator>Overkill Email Obfuscation with Ruby and Javascript &#124; Pest Identification</dc:creator>
		<pubDate>Sat, 15 Mar 2008 00:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://unixmonkey.net/?p=20#comment-966</guid>
		<description>[...] Obfuscation with Ruby and Javascript Published in March 14th, 2008  Posted by Pest Control in Pests unknown wrote an interesting post today onHere&#8217;s a quick excerptRobot Spiders from Runaway The web is [...]</description>
		<content:encoded><![CDATA[<p>[...] Obfuscation with Ruby and Javascript Published in March 14th, 2008  Posted by Pest Control in Pests unknown wrote an interesting post today onHere&#8217;s a quick excerptRobot Spiders from Runaway The web is [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
