<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Phillip Napieralski &#187; Spam</title>
	<atom:link href="http://blog.pnapieralski.com/category/spam/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pnapieralski.com</link>
	<description>Programmer, Engineer, Researcher.</description>
	<lastBuildDate>Tue, 20 Dec 2011 16:41:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Is it spam? (According to Akismet)</title>
		<link>http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/</link>
		<comments>http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 14:40:30 +0000</pubDate>
		<dc:creator>Phillip Napieralski</dc:creator>
				<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=44</guid>
		<description><![CDATA[Akismet is perhaps the most popular form of spam protection today. I made a form so you can see the sort of things that Akismet thinks is spam. <a href="http://pnapieralski.com/tuts/isitspam" rel="shadowbox">Check it out</a>.]]></description>
			<content:encoded><![CDATA[<p>Akismet is perhaps the most popular form of spam protection today. I made a form so you can see the sort of things that Akismet thinks is spam. <a href="http://pnapieralski.com/tuts/isitspam" rel="shadowbox">Check it out</a>.</p>
<h2>Things to look for</h2>
<p><b>Spelling Errors?</b><br />
Check out <i>spam case 1</i>, &#8220;sunlasses shop.&#8221; The biggest reason for its classification is the mispelled word &#8220;somwhere.&#8221; Fix the spelling and test it again. It should show up as &#8220;ham&#8221; now! The original is an actual spam comment I received on this blog a couple days ago, I changed the links and e-mail slightly, however.</p>
<p><b>Hyperlinks</b><br />
Check out <i>spam case 2</i>, &#8220;Jim Boots.&#8221; It&#8217;s obvious if someone posted this comment on your blog that they are simply trying to promote a product. However, what makes it spammy is simply because the hyperlink to Mr. Boot&#8217;s website also has the hyperlink text as the website. If you click on ham case 1, you will notice the hyperlink text says &#8220;here&#8221; instead of &#8220;www.cowboyboots4thawin.com,&#8221; and is no longer identified as spam. Although, interestingly, if you change where the hyperlink actually goes to in the original spam case (eg, leave the hyperlink text as www.cowboyboots&#8230;, but change the link to go to a naughty site or something)</p>
<p>Finally, look at <i>ham case 2</i>, &#8220;Trustworthy Guy.&#8221; This is the perfect comment: solid spelling, grammar is good enough, and no hyperlinks at all. This is simply an example of what a comment should look like!</p>
<h2>Conclusion</h2>
<p>If you want your comments to show up on blogs (or whatever Akismet is safeguarding), it might be helpful to test it with this form before submitting your comment.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Is+it+spam%3F+%28According+to+Akismet%29&amp;link=http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/&amp;notes=Akismet%20is%20perhaps%20the%20most%20popular%20form%20of%20spam%20protection%20today.%20I%20made%20a%20form%20so%20you%20can%20see%20the%20sort%20of%20things%20that%20Akismet%20thinks%20is%20spam.%20Check%20it%20out.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Is+it+spam%3F+%28According+to+Akismet%29&amp;link=http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/&amp;notes=Akismet%20is%20perhaps%20the%20most%20popular%20form%20of%20spam%20protection%20today.%20I%20made%20a%20form%20so%20you%20can%20see%20the%20sort%20of%20things%20that%20Akismet%20thinks%20is%20spam.%20Check%20it%20out.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Is+it+spam%3F+%28According+to+Akismet%29&amp;link=http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/&amp;notes=Akismet%20is%20perhaps%20the%20most%20popular%20form%20of%20spam%20protection%20today.%20I%20made%20a%20form%20so%20you%20can%20see%20the%20sort%20of%20things%20that%20Akismet%20thinks%20is%20spam.%20Check%20it%20out.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Is+it+spam%3F+%28According+to+Akismet%29&amp;link=http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/&amp;notes=Akismet%20is%20perhaps%20the%20most%20popular%20form%20of%20spam%20protection%20today.%20I%20made%20a%20form%20so%20you%20can%20see%20the%20sort%20of%20things%20that%20Akismet%20thinks%20is%20spam.%20Check%20it%20out.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Is+it+spam%3F+%28According+to+Akismet%29&amp;link=http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/&amp;notes=Akismet%20is%20perhaps%20the%20most%20popular%20form%20of%20spam%20protection%20today.%20I%20made%20a%20form%20so%20you%20can%20see%20the%20sort%20of%20things%20that%20Akismet%20thinks%20is%20spam.%20Check%20it%20out.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Is+it+spam%3F+%28According+to+Akismet%29&amp;link=http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/&amp;notes=Akismet%20is%20perhaps%20the%20most%20popular%20form%20of%20spam%20protection%20today.%20I%20made%20a%20form%20so%20you%20can%20see%20the%20sort%20of%20things%20that%20Akismet%20thinks%20is%20spam.%20Check%20it%20out.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="http://www.shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.pnapieralski.com/spam/is-it-spam-according-to-akismet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam-proof Contact Form with PHP/Akismet</title>
		<link>http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/</link>
		<comments>http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/#comments</comments>
		<pubDate>Sun, 09 May 2010 21:55:20 +0000</pubDate>
		<dc:creator>Phillip Napieralski</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[Akismet]]></category>
		<category><![CDATA[Spam Prevention]]></category>

		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=36</guid>
		<description><![CDATA[<a href="http://pnapieralski.com/contact.php">Check out the demo</a>

This is an addition to my previous post to create a <a href="http://blog.pnapieralski.com/php/simple-contact-us-form-with-php/">simple contact form</a>. This post will utilize the <a href="http://akismet.com/">Akismet</a> service to classify some messages as spam.]]></description>
			<content:encoded><![CDATA[<p><a href="http://pnapieralski.com/tuts/isitspam">Check out the demo</a></p>
<p>This is in addition to my previous post about creating a <a href="http://blog.pnapieralski.com/php/simple-contact-us-form-with-php/">simple contact form</a>. This post will utilize the <a href="http://akismet.com/">Akismet</a> service to classify some messages as spam.</p>
<h2>The Prerequisites</h2>
<p>To follow this tutorial, I assume you already have a <a href="http://blog.pnapieralski.com/php/simple-contact-us-form-with-php/">simple contact form</a> in place.</p>
<h2>Akismet PHP Library</h2>
<p>The folks at <a href="http://www.achingbrain.net">Aching Brain</a> created a nifty PHP class to make utilizing the Akismet service easier. <a href="http://www.achingbrain.net/stuff/php/akismet">Download this library</a> then put it in the same directory as your contact form file (Download mirror: <a href='http://blog.pnapieralski.com/wp-content/uploads/2010/05/AkismetPHPClass.zip'>AkismetPHPClass</a>).</p>
<p>There are implementations available in <a href="http://akismet.com/development/">other languages</a> as well.</p>
<h2>The PHP</h2>
<p>This code will completely replace the PHP code from the previous post. However, I assume the HTML used is unchanged.</p>
<p>First, include the Akismet library:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require &quot;Akismet.class.php&quot;;
</pre>
<p>Now, create a more generic function for sending an email:</p>
<pre class="brush: php; title: ; notranslate">
function send_mail( $name, $email, $website, $ip, $is_spam, $message)
  {
  		$subject = '';
  		if( $spam == true )
  			$subject = &quot;[SPAM?]&quot;;
  		$subject .= &quot;[Your_site.com] E-mail received from &quot;.$author_name.&quot;//&quot;.$author_email.&quot;//&quot;.$ip;

  		mail( &quot;send_to_this_address@to.com&quot;, $subject,
		$author_name.&quot;, &quot;.$author_email.&quot;, &quot;.$author_website. &quot;.\r\n\r\n&quot;.$message);
}
</pre>
<p>If the $is_spam parameter is set to true, we simply prepend &#8220;[SPAM?]&#8221; at the beginning of the subject line. This allows us to see right away what it is in our inbox. Further, you could create an <a href="http://mail.google.com/support/bin/answer.py?hl=en&#038;answer=6579">e-mail filter</a> to automatically put these messages in a different e-mail folder.</p>
<p>Now, we have to set-up the Akismet class. This will require a WordPress API Key. If you don&#8217;t have one, <a href="http://en.wordpress.com/api-keys/">it&#8217;s easy and free to get one</a>.</p>
<pre class="brush: php; title: ; notranslate">
	if(isset($_POST['action']))
	{
		$wp_key = 'xXxXxXxXxXxX';
		$our_url = 'http://www.your_website.com';

		$name = $_POST['name'];
		$email = $_POST['email'];
		$website = $_POST['website'];
		$message = $_POST['message'];
		$ip = $_SERVER['REMOTE_ADDR'];

		$akismet = new Akismet($our_url, $wp_key);
		$akismet-&gt;setCommentAuthor($name);
		$akismet-&gt;setCommentAuthorEmail($email);
		$akismet-&gt;setCommentAuthorURL($website);
		$akismet-&gt;setCommentContent($message);
		$akismet-&gt;setUserIP($ip);

		send_mail( $name, $email, $website, $ip, $akismet-&gt;isCommentSpam(), $message);
	}
?&gt;
</pre>
<p>That&#8217;s it! Now if a line of spammers hits your contact form, you have a safe guard against it. If you have questions about this piece of code or anything else, feel free to leave a comment!</p>
<p>In conlusion, Akismet is the best!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Spam-proof+Contact+Form+with+PHP%2FAkismet&amp;link=http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/&amp;notes=Check%20out%20the%20demo%0D%0A%0D%0AThis%20is%20an%20addition%20to%20my%20previous%20post%20to%20create%20a%20simple%20contact%20form.%20This%20post%20will%20utilize%20the%20Akismet%20service%20to%20classify%20some%20messages%20as%20spam.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%2524%257Btitle%257D%2B-%2B%2524%257Bshort_link%257D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Spam-proof+Contact+Form+with+PHP%2FAkismet&amp;link=http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/&amp;notes=Check%20out%20the%20demo%0D%0A%0D%0AThis%20is%20an%20addition%20to%20my%20previous%20post%20to%20create%20a%20simple%20contact%20form.%20This%20post%20will%20utilize%20the%20Akismet%20service%20to%20classify%20some%20messages%20as%20spam.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Spam-proof+Contact+Form+with+PHP%2FAkismet&amp;link=http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/&amp;notes=Check%20out%20the%20demo%0D%0A%0D%0AThis%20is%20an%20addition%20to%20my%20previous%20post%20to%20create%20a%20simple%20contact%20form.%20This%20post%20will%20utilize%20the%20Akismet%20service%20to%20classify%20some%20messages%20as%20spam.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Spam-proof+Contact+Form+with+PHP%2FAkismet&amp;link=http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/&amp;notes=Check%20out%20the%20demo%0D%0A%0D%0AThis%20is%20an%20addition%20to%20my%20previous%20post%20to%20create%20a%20simple%20contact%20form.%20This%20post%20will%20utilize%20the%20Akismet%20service%20to%20classify%20some%20messages%20as%20spam.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Spam-proof+Contact+Form+with+PHP%2FAkismet&amp;link=http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/&amp;notes=Check%20out%20the%20demo%0D%0A%0D%0AThis%20is%20an%20addition%20to%20my%20previous%20post%20to%20create%20a%20simple%20contact%20form.%20This%20post%20will%20utilize%20the%20Akismet%20service%20to%20classify%20some%20messages%20as%20spam.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Spam-proof+Contact+Form+with+PHP%2FAkismet&amp;link=http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/&amp;notes=Check%20out%20the%20demo%0D%0A%0D%0AThis%20is%20an%20addition%20to%20my%20previous%20post%20to%20create%20a%20simple%20contact%20form.%20This%20post%20will%20utilize%20the%20Akismet%20service%20to%20classify%20some%20messages%20as%20spam.&amp;short_link=&amp;shortener=google&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="http://www.shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.pnapieralski.com/php/spam-proof-contact-form-with-php-akismet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

