Tag Archive | "smo"

Tags: , ,

Using the Digg API

Posted on 06 April 2008 by Ryan

Digg’s new API is impressive. Incorporating your digg user account activity or your domain’s popular posts into your blog or using it as part of a micro blogging strategy is a snap. The easiest way I have found is to use Nick Halstead’s Simple Digg API Usage script. This script doesn’t require PEAR and it works on PHP 4 & 5.

Digg User Lookup

The Basics

To get started, you need to create (as in ‘out of thin air’) an application key and a user agent. There is no application key signup like Google or Youtube, however the application key you choose should meet the following requirements:

from the digg api wiki
The value of the appkey argument must be a valid absolute URI (see IETF RFC 2396) that identifies the application making the request. The URI might point to:

  • The application itself, if it’s a web application.
  • A web page describing the application.
  • A web page offering the application for download.
  • The author’s web site.

Html

The html for the form to display to request digg user name.

<form action="" method="post">
<table border="0">
  <thead>
    <tr>
      <td colspan="2">User Lookup</td>
    </tr>
  </thead>
<tbody>
  <tr>
    <td>User Name</td>
    <td>
  <input maxlength="50" name="uid" size="25" type="text" /></td>
  </tr>
  <tr>
    <td></td>
    <td><input name="submit" type="submit" value="submit" /></td>
  </tr>
</tbody>
</table>
</form>

Code

The backend code to function the submit request

decode($response);
        foreach($decoded->users as &$user) {
             // $user = $decoded->users;
                $name = $user->name;
                $icon = $user->icon;
                $registered = $user->registered;
                $profileviews = $user->profileviews;
                              function timestamp_to_date ($registered)
                              {
                              $date = date ('m-d-Y' , $registered);
                              echo $date;
                              }
                echo "<div id=\"archivebox\">";
                echo "<h2><img src="\" alt="" />";
                echo "$name";
                echo "User Since: ";
                timestamp_to_date ($registered);
                echo "";
                echo "Profile Views: $profileviews ";
                echo "</h2><h3>User Links</h3>";
                echo "<ul>";
                }
                foreach($user->links as $link) {
                $href = $link->href;
                $description = $link->description;
                echo "<li><a href="$href">$description</a></li>";
                }
                echo "</ul>";
                echo "</div>";

        } else {             //form hasn't been submitted
        $user = "elebrio";
	require("JSON.php");
	ini_set('user_agent', 'ic/1.0');
	$appkey = 'http://indexedcontent.com';
        $response = file_get_contents("http://services.digg.com/user/$user?appkey=$appkey&type=json");
        $json = new Services_JSON();
	$decoded = $json->decode($response);
        foreach($decoded->users as &$user) {
             // $user = $decoded->users;
                $name = $user->name;
                $icon = $user->icon;
                $registered = $user->registered;
                $profileviews = $user->profileviews;
                              function timestamp_to_date ($registered)
                              {
                              $date = date ('m-d-Y' , $registered);
                              echo $date;
                              }
                echo "<div id=\"archivebox\">";
                echo "<h2><img src="\" alt="" />";
                echo "$name";

                echo "User Since: ";
                timestamp_to_date ($registered);
                echo "";
                echo "Profile Views: $profileviews ";
                echo "</h2><h3>User Links</h3>";
                echo "<ul>";
                }
                foreach($user->links as $link) {
                $href = $link->href;
                $description = $link->description;
                echo "<li><a href="$href">$description</a></li>";
                }
                echo "</ul>";
                echo "</div>";
		}
?>

In order to get this code working on your site, you will need to change two variables.

  • appkey – replace with your domain
     $appkey ='http://indexedcontent.com';
  • user agent
     ini_set('user_agent', 'ic/1.0');

    ic/1.0 is my site’s current user agent. You can basically name this whatever you want.

Additional Resources

Comments (0)

Tags: ,

Is the DIGG experience worth it ?

Posted on 26 February 2008 by Sergiu

There are a lot of debates when it comes to Digg and people like expressing their point of view no doubt about it. but when we talk about the Digg side effects we are talking about articles who reach the first page. Of course Digg has it’s own algorithm when it comes to ranking a page high but what could really happen if we were to have articles on the first page ?

Some people say that this would be some sort of bad luck because the traffic doesn’t convert well and certainly your site will crash due to high traffic (yea right) …

I think there are way many better (if not only) advantages for your site if you get articles on the first page of digg because:

Seo Advantages: You can get a lot of links (deep links) to your site with anchor texts that really do the job because of sites who use the digg mirror service or others who compose their articles reffering to you etc. Let’s not forget about other sites that collaborate with Digg or users who use more than one social bookmarking site thus giving you tons of backlinks.

Monetizing Ads: Even though your ads won’t convert as you would want them a huge traffic spike could earn you some decent money. Altough your traffic increased 20 times and your winnings barely tripled it’s still a progress no doubt about it.

Exposure: Having your story on the first page gives you great exposure. Basically all viral campaigns made it to the first page on Digg so if you have something to say why not do it the smart way

Readers: Everybody knows John Chow and what he did, how he monetized his sites, pissed off Digg and Google etc… But the smart thing i guess nobody though of was converting Digg fans into his own. This shows us that if you have some talent (when it comes to writing) you can easily convert readers and make them your own. Guess how the first page of Digg helps in this equation

So most people who say that Digg is this or that or fear of a server crash are just “little girls” who never experienced real traffic and of course they fear it. My logical piece of advice is get as much (content oriented if possible) traffic as you can get !

P.S. If you do find the secret of placing your article on #1 page of Digg don’t forget to whisper

Comments (0)

Blog Advertising - Advertise on blogs with SponsoredReviews.com Advertise Here