is_being_dugg() ?

Here’s a one-liner to help you figure out if you’re being dugg or not. You can use it in your WordPress to serve an altenative, less hefty version of a page. I hacked it in a couple of minutes, and Digg still don’t have an API so I couldn’t find another way. It’s very late, so please excuse me.

  1. #!/usr/bin/php
  2. <?php
  3. function is_being_dugg()
  4. {
  5. return !preg_match('/\<h3\>No results found\<\/h3\>/i',
  6. file_get_contents('http://digg.com/search?area=promoted&search='
  7. . urlencode($_SERVER['REQUEST_URI'])));
  8. }
  9. ?>
  10.  


Leave a Reply

Formatting: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Other Entries

Tweets from