DiggBadger

Abstract

DiggBadger integrates the Digg tools "Digg This" button with dynamic data from WordPress to add a Digg badge to posts and pages in WordPress 2.x or greater. Stories already submitted will show how many times they have been dugg and stories not yet submitted will post to the submit story page with information pre-populated.

Purpose

After searching and trying several Digg link implementations for WordPress and discussing the pros and cons of each with my friends, I realized that there wasn't a plugin that was easy to use and met all my requirements for function and ease of use. I originally created this as just a block of code and wrote and article about using it, but after creating PicasaWebScraper, I realized that this was a perfect candidate for a plugin.

Solution

Utilizing the Javascript calls from Digg and pulling dynamic data from WordPress (and some more voodoo trickery), I was able to get all the dynamic data, including the first 350 characters (cleanly) from the post for first-time submission form pre-population.

Demo

Not currently available.

Download:

DiggBadger 1.1

WordPress Link: http://wordpress.org/extend/plugins/diggbadger/
Version: 1.1
Release Date: 08/29/2007
Requirements: WordPress 2.0 or greater, may work under older versions of WordPress
License: GNU General Public License Version 3
References: http://www.digg.com/tools/integrate
Installation: 1. Download DiggBadger

2. Upload PicasaWebScraper.php to ~/wp_contents/plugins/

​3. Activate DiggBadger plugin

Usage: 1. On the theme file where you would like to add DiggBadger, locate the line containing the_content() and place the following code immediately before or after that line: <?php getDiggBadger(); ?>

2. Save theme file

3. Optionally, add a class to your stylesheet to style DiggBadger. The class needs to be named .diggBadger. Here's a sample style:

.diggBadger
{
   float: right;
   margin-bottom: 4px;
   margin-left: 4px;
}

v1.1: You can now provide a second parameter that specifies the CSS class to use. The default CSS class is .diggBadger, but you can declare one or more classes ach time this function is called.

getDiggBadger([string $defaultTopic, [string $cssClass]])

defaultTopic - Optional. Default: ''. Specify the default topic for your posts. Valid strings can be found here: http://www.digg.com/tools/integrate#topics

cssClass (Added in 1.1) - Optional. Default: 'diggBadger'. Specifies the CSS class to use for styling the outer DIV. To disable styling, pass an unused class name, such as 'DoNotStyle'.

Uninstallation: To remove DiggBadger, not that you would ever want to, simply follow these instructions:

1. Edit the theme files containing the call: <?php getDiggBadger(); ?> and delete the code.

2. Save the theme files3. Deactivate the DiggBadger plugin 4. Delete diggbadger.php from ~/wp_contents/plugins/

Change Log

1.1 8/29/2007 Added optional parameter cssClass to specify CSS class to use in wrapping DIV.

Roadmap

I plan to add an optional parameter to allow for use of the smaller badge provided by the Digg API.

Questions/Support

If you have any questions, please post a comment to this page and I will do my best to answer it or perhaps someone else can as well.

Archive

Comments

Hey Kenny, great plugin!

Just thought I'd drop you a note and let you know that the main Plugin link for your Diggbadger (from the WP-admin plugin page) leads to a 404 Server Error page!

Not sure if this is a temporary problem, but thought I would let you know it is happening.

Here's the broken link:

http://www.kennycarlile.com/DiggBadger/

Regards,

Michael

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.