Blog Spammin’

Spam has as much value as this non-movie
Spam has as much entertainment value as this non-movie

One of the things that most entertains me is blog comments spam (okay not really), and as this is a newish blog, all of the comments I get are spam and scams. Obviously spam and scams aren’t the feedback I’m looking for and the Staff Sergeant in me wants to put a proper beat-down on these folks, but this is not ‘Nam. This is blogging. There are rules. So I will do what anyone else would do these days, vent into my own echo chamber which is my blog.

As I started my career as a developer one of the first things I do when learning a new language or platform is to create a “Hello World” program just to make sure I understand the mechanics, and that’s what I did here too, the Hello World post.

This acted like a spam magnet, to date with 30 comments, none real. I certainly experienced comment spam with blogger too, but not in this proportion. Then again this blog doesn’t have the same draw of highly topical content as my Grumpy properties. They seem to fall into 3 categories:

  • Blatant – these comments don’t waste time trying to trick you, and rely on the blogger who is too stupid or lazy to set up approvals on their blog comments and thus just get published. I’m not sure why spammers bother with this, as I would imagine the click thru rate must be something around zero. Maybe SEO or page rankings, that I don’t understand well enough to assess.
  • Flattering feedback – these folks have taken the time craft, and I mean craft, not write, comments generic enough to apply to a lot of post, especially knowing most blogs are personal in content or tone, they attempt to flatter you into approving it in the least or clicking it. Some favorites, remember these are in response to an initial “I have a blog” post:

    Excellent .. Amazing .. I will bookmark your blog

    An fascinating discussion is worth comment. I think which you will need to write alot more on this topic, it may well not be a taboo subject but frequently people aren’t sufficient to speak on such topics.

    This post is so help to me!

  • Something is wrong with your blog/website – these are clever enough not to bother with the fact that they aren’t reading the post and therefore the comment may not be on topic. The go right to the best marketing angle ever – fear. Great post, but I noticed there something wrong with you blog/site! You need to fix it right away. (Oh and I found this product you should check out that can fix it!)

The other common thing about spam comments is the entertaining misspellings and poor grammar, like you see in the Nigerian email scams.

So, bottom line – enable comments approvals and look into spam blockers for the platform you’re on, but also read them from time to time, you might just get a laugh.

Adding your Processing project to your website

Early in my exploration of Processing, I wanted to do a proof of concept on running a program from this website.

The Processing Development Environment includes a nice feature to Export your sketch (as Processing programs are called) to Windows, Mac OS, and Linux. If you are not running your own box, and like me are running your site on a linux hosting solution, then you don’t have the systems-admin type access to update your version of java, and deploy the files necessary. Or maybe you don’t have a sys-admin background, or maybe you just want an easier way to do it because you aren’t all that interested in that aspect of it and want to put your energies into the Processing program itself.

Unfortunately the search term “processing”, especially when paired with “website” tends to bring back a lot of payment solution providers. So I wanted to share the down and dirty version below, which I found after a few hours of search and experimentation. If you want an excellent and much more detailed discussion, vist pomax’s Processing on the web at nihongoresources.

Okay, so to get the point, how do we do this? The key is using Processing.js a sister project to Processing:

  1. Develop and test your Processing sketch, saving frequently.
  2. When you have got it “just right” go to Processing.js and download the latest “Production” release.
  3. Upload this file “processing-1.4.1.min.js” to a folder on your site that all your Processing projects can reference. For me it’s my “processing” folder, oddly enough.

    example processing folder
    example processing folder
  4. Upload your processing “.pde” file to your website as well. This can be in a same of different folder.
  5. Now you simply include a reference to both your sketch and the Processing.js file in your html, thusly:

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
    <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
    <title>Test Processing Page</title>
    <script type=”text/javascript” src=”processing-1.4.1.min.js”></script>
    </head>
    <body>
    <canvas id=”mysketch” data-processing-sources=”HelloProcessing2.pde”/></canvas>
    </body>
    </html>

    Note that the script tag should be somewhere in the <head> tag, and that both the script src element and the canvas data-processing-sources element need to include the relative path to the html file is you have chosen not to place them all in the same folder.

    <script type=”text/javascript” src=”[relative folder path]/processing-1.4.1.min.js”></script>
    </head>
    <body>
    <canvas id=”hellosketch” data-processing-sources=”[relative folder path]/HelloProcessing2.pde”/></canvas>
    </body>
    </html>

  6. Upload your html file and test. I have noticed that I have had to tweak my Processing sketches a little to get the same behavior our of Processing.js, for example I had to remove a
    delay(100);

    I had in for debouncing purposes, that was causing mousePressed not get picked up online.

  7. As noted above, it is generally good practice to include the <script> tag within the <head> tag, but it is not necessary. Here, I have simply included both in my WordPress page, on the “Text” tab, so you can see you can also do this without having to create your own WordPress templates, or html pages, etc. and just use the WordPress CMS.

    Example of processing.js inclusion in a WP page
    Example of processing.js inclusion in a WP page