Posted By

jdstraughan on 04/03/09


Tagged

php digg tinyrul


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

jdstraughan
irishsk
xmartyxcorex


Create Digg Url with PHP


 / Published in: PHP
 

This function will convert any long url into a Diggbar url

  1. function digg_url($longurl)
  2. {
  3. $simple = shell_exec('curl http://services.digg.com/url/short/create?url='. urlencode($longurl));
  4. xml_parse_into_struct($p, $simple, $vals, $index);
  5. return $vals[1]['attributes']['SHORT_URL'];
  6. }

Report this snippet  

You need to login to post a comment.