digg

Join DiggAbout

Integrate: "Digg This" Button
Updated

The Digg This button is for website and blog publishers that want to encourage their audience to submit or digg their content on Digg. Join thousands of sites that have already added Digg This and seen their content exposed to the Digg community.

We've given our latest Digg This button a brain - it's smart enough to:

  • Encourage users to submit new content from your site to Digg. We'll detect if the content exists already and provide either a Submit or Digging interface
  • Display the real-time Digg count for content already on Digg
  • Support News, Images, or Video content.
  • Be backward compatible with the last version of our Digg This button

There are a few different ways you can implement the Digg This button which are outlined below:

  1. "Digg This" with Submit Capability

    The best way to allow your site's visitors to Digg news and videos right on your site.

  2. Simple "Digg This" with Digg Count (original version)

    A more basic way to Digg news and videos.

  3. Custom Submission-Only Button

    A basic method to allow your site's visitors to submit and Digg news and videos. The advantage is you can use your own graphic or text.

 


 

"Digg This" with Submit Capability

The following examples illustrate the different ways the Digg This button can be used. The graphic above illustrates how your buttons might look.

Example: Simple usage for a web page you want to enable to be dugg.

Just drop the following code onto the page. It's that easy.

<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Example: When the URL you wish dugg differs from the current webpage.

What if you'd like to use a specific URL from a different webpage? Or what if you have user-specific or session data in your URL and you want your Digg This button to use a very specific version of the URL? No problem, just change the code like this:

<script type="text/javascript">
digg_url = 'WEBSITE_URL';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Replace WEBSITE_URL, with the URL that you want to use. Don't worry about URL-encoding it, our code will do that for you. For example:

http://example.com/yourstoryur/storypagedetails.html

This method will allow you to have a number of Digg This buttons on the same page of your site. Remember, the above two examples will also work to submit the page if the content hasn't yet appeared on Digg.

Example: Change the design of the button

What if you'd like a different background to your button so it looks better on your site? What if you'd like a smaller more compact version of the button? The Digg This button has three visual designs as shown below. Provide one or both of the following options to alter the visual appearance of your button:

<script type="text/javascript">
digg_url = 'WEBSITE_URL';
digg_bgcolor = '#ff9900';
digg_skin = 'compact';
digg_window = 'new';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

The digg_bgcolor option can take any valid CSS color and is used only to change the background color around the outer edge of the button. If omitted, the default color is white.

The digg_window option can be set to 'new' if you wish any clicks to open in a new window, as opposed to the default which is to open links in the same browser window.

The digg_skin option controls the look at the button. If omitted the button defaults to a standard digg button (much like the one you see on Digg itself). If specified as 'compact', then a smaller horizontal visual design is used that will fit better into a list of links.

If specified as 'icon', then only a 16x16 digger icon is returned. This 'icon' skin obviously doesn't have room for a digg button, but will still automatically choose whether to take the user to a submit page, or to the permalink of the story. It also will provide the current digg count of the story when the cursor hovers over it.

Example: Specifying defaults for submission

So what if you've just created new content and you'd like to suggest the exact story title, description and category for your content when that first person submits it to Digg? No problem, use the following additional Javascript variables to specify these values (note that the user who submits your content will be able to change these):

<script type="text/javascript">
digg_url = 'WEBSITE_URL';
digg_title = 'TITLE';
digg_bodytext = 'BODY';
digg_media = 'MEDIA';
digg_topic = 'TOPIC';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Simply replace those variable contents with the appropriate text for your content, and voila! The digg_media variable should be one of 'video', 'image', or 'news' (The default is 'news'). For the digg_topic variable, it must be one of the following topics:

  • apple
  • arts_culture
  • autos
  • baseball
  • basketball
  • business_finance
  • celebrity
  • comedy
  • comics_animation
  • design
  • educational
  • environment
  • extreme_sports
  • food_drink
  • football
  • gadgets
  • gaming_news
  • general_sciences
  • golf
  • hardware
  • health
  • hockey
  • linux_unix
  • microsoft
  • mods
  • motorsport
  • movies
  • music
  • nintendo
  • odd_stuff
  • olympics
  • other_sports
  • pc_games
  • people
  • pets_animals
  • playable_web_games
  • playstation
  • political_opinion
  • politics
  • programming
  • security
  • soccer
  • software
  • space
  • tech_news
  • television
  • tennis
  • travel_places
  • world_news
  • xbox

 


 

Simple "Digg This" with Digg Count (original version)

This original version of the Digg This button is used for stories after they have been submitted to Digg and are in the Digg database. Its purpose is to simply display the Digg count and allow users to Digg it. While we recommend the smarter Digg buttons above, we will continue to support this button for sites already using this code. The following examples illustrate the different ways the Digg This button can be used.

Example: Digg This without a submit option

<script type="text/javascript">
digg_url = 'DIGG_PERMALINK_URL';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

Make sure to use a Digg Permalink URL like this in place of DIGG_PERMALINK_URL such as:

http://digg.com/programming/Digg_s_Eli_White_Releases_PHP_Book

 


 

Custom Submission-Only Button

Example: Providing a link to your article that allows users to submit to Digg

What if I want to use my own button or text link to submit content to Digg? If I don't want a Digg This button, but just a link to help users submit my content to Digg, and allow them access to the previously submitted story

This only works for News, Video and Images, and you need to construct a URL like this for your link:

http://digg.com/submit?url=example.com&title=TITLE&bodytext=DESCRIPTION&media=MEDIA&topic=TOPIC

Submit URL Details:

url=example.com
Maximum length is 255 characters
Story URL should be unique and devoid of session or user-specific data
Please URL-encode all strings as appropriate. For example:
http%3A%2F%2Fyourwebsite%2Fyourstoryurl%2Fstorypagedetails.html
title=TITLE
Maximum length is 75 characters
Please also URL-encode the story title
bodytext=DESCRIPTION
Maximum length is 350 characters
Please also URL-encode the body text
media=MEDIA
This specifies the type of media being linked to, it should be news, video, or image. (The default value is news)
topic=TOPIC
Each story must be submitted into one and only one topic. Please reference the list of allowed topics above.
thumbnails=0
Disable the option to choose a thumbnail during submission. Works no matter which media type is specified.