Scuttle Spam - reCAPTCHA Scuttle Bookmarking Script

Stop the SPAM! Those who use or own a Scuttle site know the spambot problem all to well. I also got sick and tired of the removal of all the spam users + bookmarks through MySQL.
And since the developer didn't want to make the step to put some minimal defence on this system, I had to. Either that or totally abandon the script.

Scuttle Spam Protection with reCAPTCHA
In this post I will show an example of how to protect your Scuttle script a little better, with the use of reCAPTCHA. It is pretty easy and can be implemented within minutes. (This does not guarantee you will be rid of spam, but should put a pretty good plug in the hole)

Remember to backup all files before you do this. I will not be responsible for people messing up the code.

First register for an account at reCAPTCHA to get your public and private key.
Download their ZIP file containing  recaptchalib.php (Upload recaptchalib.php to your Scuttle Root)

Then open your register.php and insert this:

require_once('recaptchalib.php');
$privatekey = "PUT YOUR PRIVATE KEY HERE";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) { // if both captchas don't match
$error = true;
$tplVars['error'] = T_('Wrong Code - Try Again!');
}

RIGHT BEFORE:

elseif ($userservice->addUser($posteduser, $_POST['password'], $_POST['email'])) {

Close and Upload.

Then open your /template/register.tpl.php and insert this:

<label for="spam">Spam Check</label>
<?php require_once('recaptchalib.php');
$publickey = "PUT YOUR PUBLIC KEY HERE";
echo recaptcha_get_html($publickey);
?>

RIGHT BEFORE:

<input name="submitted" size="20" type="submit" value="<?php echo T_('Register'); ?>" />

Upload this file and you are done. Voila. (Remember to insert your own unique Public and Private Key)

Test your signup process and make sure everything looks good and works as it should.

FYI: WordPress makes some different single-quotation marks. You will need to manually replace the ‘ with a normal one. (I will look for a fix on this)

Commentary

Leave a response »

  1. 1. February 26th, 2009

    Claus, we at Vidoop have a CAPTCHA solution that can be implemented in a similar fashion and may be easier on your readers. If you wish to check it out, our code is there and our main product page is my comment name. It is configurable too.

  2. 2. March 25th, 2009

    Claussssss … its frankie from Canada! Check out my blog http://www.youshouldknow.com leave me a comment and lets try to hookup as I have lots to talk about with you!

    frank from Canada
  3. 3. May 2nd, 2009

    Thanks, great post, awesome blog.

    ps; check out our forums Claus.

  4. 4. May 10th, 2009

    Thx a lot for this googl explanation, it works very well!

  5. 5. May 22nd, 2009

    @Frank: Hey buddy! Great to hear from you again.. I will check your site and give you a shout 😀

  6. 6. December 27th, 2009

    Thank for the information!

  7. 7. June 4th, 2010

    I see reCaptcha on many websites and wonder why it is so popular. I use very easy way how to stop spam (and yes, on quite popular websites). I simply add a question like “how do you spell word “word” backwards?” and I didn’t get single spam from robot for many years.

Trackbacks

  1. […] Update: Due to heavy spam on the Scuttle script, I have made a post about how to Protect a Scuttle site from Spam. […]

    Social bookmarking site in Denmark | Claus Heinrich - Webmaster Blog

Leave a comment, a trackback from your own site or subscribe to an RSS feed for this entry. Trackback URL for this entry Comments feed for this entry

Leave a response

Leave a URL

Preview
Dansk blog Engelsk blog
Twitter Claus Heinrich