Nate Weiner

  • Archive
  • RSS

Block Facebook Beacon

So here I am, burning some brain cells and taking some time to relax playing a game on Kongregate, when a little window pops up in the corner of my screen and says “Kongregate is sending this to your Facebook profile: Nate played Desktop Tower Defense 1.5 at Kongregate.” Which immediately elicited a “Hellll no” from my mouth.

Maybe what shocked me was the way it was worded, essentially saying that Kongregate was sending the data without even asking my permission (even though there is a ‘No Thanks’ button in the corner) but needless to say, I was not too thrilled about my surfing habits showing up on my Facebook profile. So I clicked ‘No Thanks’, and hopped over to Facebook and looked at the privacy settings for this new program. And found they give you the options of choosing ‘allow’, ‘notify me’, or ‘never’. The problem however is, that even though you can choose whether or not it is made public that you visited these sites, Facebook still has the data regardless of your privacy settings. Now I don’t mean to sound like I’m tin-foil-hat-wearing paranoid, but that does seem to encroach a little past what Facebook’s role in my life should be. I want Facebook to sit still and let me check out how many of my friends enjoy the movie Sleepover and look at pictures of people I didn’t like in High School. I don’t need Facebook extrapolating data about me as I go about my business on the web. For those of you that don’t know, this is part of Facebook’s new advertising platform. Don’t get me wrong, I actually think Facebook’s new Beacon system is a great idea and a powerful tool for online advertisers. It is a great way to allow users to add more about their lives to their profiles. Unfortunately, it’s being done in a ‘you can opt-out’ manner, when it should be ‘you can opt-in’. As this gets rolled out to more and more sites, the potential for this being taken advantage of is pretty high. Because each site in the program will send requests to Facebook each time you arrive, which in-turn would allow Facebook to catalog a good chunk of the sites that you are surfing. So the easiest thing to do is just block it. I peaked at the javascript that controls the communication between the used site and Facebook and see that it’s quite easy to prevent the communication. (This assumes you use Firefox. If you don’t, just look around for ways to block specific pages in your browser):
  1. Download and Install the BlockSite plugin for Firefox.
  2. After restarting Firefox select ‘Add-ons’ from the Tools menu.
  3. Click the ‘Options’ button on the BlockSite extension
  4. Click the ‘Add’ button
  5. Enter http://*facebook.com/beacon/* into the input box
  6. Click ‘OK’
  7. Click ‘OK’ again and you are good to go.

If you look at the javascript that is used to make requests to Facebook, you will see that the requests are made to http://www.facebook.com/beacon/beacon.js.php so by blocking just the beacon folder, you are preventing the site from sending requests to Facebook without blocking the rest of Facebook. Update: As someone anonymously noted below, you should block both facebook.com and www.facebook.com, you can do that by replacing ‘www.’ with the wildcard character ‘*’ (see step 5 updated above)

Other Browsers

Commenters below have suggested ways to block Facebook Beacon in other browser’s, none of these have been tested by me, but here they are for your use:
  • Safari - PithHelment or SafariBlock (provided By Schmelding)
  • Opera - Site blocking is built in (suggested by George)
  • IE7 - IEPro (suggested by Offbeatmammal)
Follow Up: Two weeks after this post, I’ve written a follow-up about the response. Facebook Beacon - Two Weeks Later

    • #facebook
    • #facebook-beacon
    • #firefox
    • #kongregate
    • #plugins
  • 4 years ago
  • 47
  • Permalink
  • Share
    Tweet

Wordpress Plugin: Extra Comment Fields

Overview

This Wordpress plugin allows you to add additional fields for users to complete when submitting a comment. The extra data will be saved in the wp database and can be retrieved when showing a post’s list of comments. The extra comment variables will show up in the list of comments in your Wordpress admin and are editable through the standard admin comment edit page. This plugin requires a basic knowledge of HTML to modify your comment form. Jump to Download

Example of Use

For this example, we are going to add a field asking for a users age to the comments form.

1. First, add the field to your comments form.

Typically your comments form is in your theme folder and is comments.php Most likely: (/wp-content/themes/YOURTHEME/comments.php) Enter the HTML of your new field into the desired spot. To add a textfield for the user to enter their age into, you would add the following to your form. I’ll add mine right below the url textfield.
<p><input type="text" name="age" id="age" size="22" />
<label for="url"><small>Website</small></label></p>

Screenshot of Adding Field

2. Next, we need to add the field-variable to Wordpress.

Inside your Wordpress admin, click the ‘Settings’ menu. Then click the ‘Extra Comment Fields’ menu. Next, enter the name of the field. This has to be the exact name attribute you gave to the field you added to your comments form. For example, I added this field to my form:
<p><input type="text" name="age" id="age" size="22" />
<label for="url"><small>Website</small></label></p>
The input’s name attribute is ‘age’, so the variable you would enter for this field is ‘age’. Note: This can only contain letters, numbers, and/or dashes.

3. Last we want to make use of the data somehow when showing comments.

Your extra fields will be in the $comments variable retrieved by Wordpress. The extra fields you added will have a prefix of ‘extra_’. So to access the data for our ‘age’ field, we use $comment->extra_age inside the comments loop. So, for example, if I modify the default theme’s comment.php file, I just insert one line to display the extra comment information (highlighted in bold).
<ol class=”commentlist”> <?php foreach ($comments as $comment) : ?> <li <?php echo $oddcomment; ?>id=”comment-<?php comment_ID() ?>”> <?php echo get_avatar( $comment, 32 ); ?> <cite><?php comment_author_link() ?></cite> Says: <?php if ($comment->comment_approved == ‘0’) : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> <br /> <small class=”commentmetadata”><a href=”#comment-<?php comment_ID() ?>” title=”“><?php comment_date(‘F jS, Y’) ?> at <?php comment_time() ?></a> <?php edit_comment_link(‘edit’,’ ‘,”); ?></small> <?php comment_text() ?> User’s Age is: <?php print $comment->extra_age; ?> </li> <?php /* Changes every other comment to a different class */ $oddcomment = ( empty( $oddcomment ) ) ? ‘class=”alt” ’ : ”; ?> <?php endforeach; /* end for each comment */ ?> </ol>

Another Example Posted on Problogger

How I added the Twitter ID field to comments on Twitip.com

Version History

1.2 - June 23rd, 2008
  • Corrected behavior when deleting/changing status of comment
1.1 Alpha - May 20th. 2008
  • Fixed blank comment content field
1.0 Beta - May 4th, 2008
  • Updated for WP 2.5
  • Added ability to edit comments
  • Added ability to view comments in admin
  • Extra Comments data deleted when comment is deleted
  • Fixed database table prefix
0.2 Alpha - Sept. 2007
  • Initial Release

Download

NOTE: I am no longer developing this plugin.  If you’d like to continue it, please consider it open source.  If you release a new version, update users in the comments below.  Thanks Download the Extra Comment Fields Wordpress Plugin version 1.2 Beta (For Wordpress 2.5+) Download the Extra Comment Fields Wordpress Plugin version 0.2 Alpha (Only for Wordpress 2.0 - 2.3) To install, unzip the files into your /wp- content/plugins/ folder. Then activate it under the Plugin menu in your Wordpress admin.

Important Note When Upgrading from 0.2 to 1

If your Wordpress database tables do not start with ‘wp_’, you will likely need to rename the wp_comments_extra table in your database to match the other table’s prefix. This is a result of the first version incorrectly assuming the prefix across all installations. For example, if you have have tables named called prefix_posts, prefix_comments, prefix_options, etc then you should rename the wp_comments_extra table to prefix_comments_extra.

    • #php
    • #plugins
    • #wordpress
  • 4 years ago
  • 6
  • Permalink
  • Share
    Tweet

About

Prototyper, water waster, developer of Pocket.

 

Follow

Twitter: @NateWeiner
Vimeo: Nate Weiner
500px: Nate Weiner
Blog: RSS

Pages

  • Contact
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr