Dented Reality

Slinky, a PHP class for URL shortening/lengthening

A few weeks ago, I tweeted that I was writing a PHP library for shortening/lengthening URLs using some of the common/popular services. I said it was going to be called Slinky, and that it’d support a bunch of different services. Well, it’s now available for download and I think it’s pretty cool, even if I do say so myself ;)

Please grab a copy, try it out and let me know what you think. It hasn’t actually been used for anything useful yet, so I’m also interested to hear what you’re using it for!

4 Comments

  1. Thorsten Ott says:

    Big thanks for implementing the cascade feature into it. That is exactly what I need due to frequent problems with bit.ly.

    • Beau Lebens says:

      Excellent! You might want to play with setting the timeout (there's a
      constant at the top of the file) a little lower if you want faster
      performance during cascade, otherwise enjoy ;)

  2. JamFX says:

    Hi, thank you for your Script. I tried to build it in my Yourls-Script, but have some trouble:
    a) you have some "unexpected : (colons) in your file on lines: 184, 189 and 194. Those need to be removed.
    and b) (here starts my problem!) Now I got the following problem: Fatal error: Call to undefined function curl_init() in mypath/slinky.php on line 334. What can I do about this?
    The line looks like: $ch = curl_init( $url );
    Any advise would be great! Thanks
    JamFX

  3. Beau Lebens says:

    Thanks for catching that – some bad copy and pasting!

    As for the curl errors, you'll need the curl extension for PHP
    installed and operational, as per the Requirements section of the
    project page.