As an experiment on this site, I’ve installed the digg Integrator WordPress plugin provided by Bill2Me.com. After seeing this plugin in use over at Gary Lee’s site, I decided it would be worth a try here.
Installation
The installation of the plugin was a breeze. After downloading the code, I simply dropped the diggIntegrator folder into my plugins directory and enabled the plugin. On the “Options” page, which for some reason is listed on the “Plugins” toolbar as opposed to the “Options” toolbar like most plugins, I adjusted the default settings to suit my style.
For the time being, I have opted to display the button on the main index page and on the single post page. In order to get the plugin to display, you need to add a little code snippet to the page. To avoid problems if the plugin is deactivated, I added an initial check to make sure the function exists before making the call. Here is the code snippet:
if(function_exists("wjt_diggThisPost"))
wjt_diggThisPost();
This code snippet must be placed inside the loop that displays each post. In my case, I have opted to display the plugin below the title information and set it to float to the left of the post content.
Problems
On Gary’s site, I’ve noticed a “Request-URI Too Large” error occurs from time to time with this plugin. From my initial look at the plugin, I would imagine this is because it includes the bodytext of your post in the URL to digg. Digging (sorry, no pun intended) into the code a little more, one of the functions that renders the “digg” button is limiting the bodytext to 340 characters but the other method does not truncate the bodytext at all.
If I had to guess, Gary is calling the “wjt_diJavaButton” or “wjt_diCheck” function to display the digg button. As you can guess, those are the functions that do not limit the length of the bodytext. In my case, I am calling the “wjt_diggThisPost” function and that does truncate the length of the bodytext so I do not believe I will experience the “Request-URI Too Large” error.
Okay, I just checked the site and realized that this error is occurring on my site as well so I will need to debug this script a little bit to resolve the issue.
Feedback
Please let me know if you encounter any odd behavior with the site now that this plugin is enabled. I’ll be trying to resolve the issue with the error message mentioned above in the meantime.
I’d be very interested to hear your thoughts on this new plugin. What do you think about the placement within the post? Do you think it will increase the “digg-ability” of any posts versus just having the “digg” link in the list of social bookmarks at the end of each post?
*Update* I confirmed the error was being caused by the bodytext not being truncated properly. The “wjt_diJavaButton” function requires a modification to limit the length of the bodytext. However, I am experiencing odd behavior with the bodytext when it includes HTML tags in the body. I tried to add the strip_tags method in PHP but that did not completely resolve the issues. For the time being, I have modified the diggIntegrator plugin to remove the bodytext parameter from the link as I think it is too buggy to be suitable for use.
New WordPress Plugin – digg Integrator
Stay In The Loop!
Subscribe to the Derek Semmler dot com feed via RSS or Email to receive notifications when new posts are published. Follow the WordPress ninja on Twitter too!
Previous post: Free Stuff – The Price Is Right
Next post: Text Link Ads Offers New Choices
{ 5 comments… read them below or add one }
I modified line 289 to:
‘digg_bodytext = “‘.urlencode(get_the_content(),0,340).'”;’;
There was no limit before and I was getting the same error. As soon as it limited to 340 characters, the error went away.
Just my 2 cents.
Thanks for sharing your fix. For the time being I have dropped the plugin in favor of the simple text link at the bottom of each post.
It was getting a little disheartening to see each post with the big “0” for the digg plugin. 😆
Thanks so much four sharing.It’s very usefull.
I still cant even get this plugin running….I dont understand whats wrong….
I’ve done some work checking out digg Integrator with WordPress 2.1 and everything appears to be working well.