BITLY URL Shortner PHP CLASS

Bitly is another great URL Shortening service. Bitly shortens more than one billion  links per month for use with websites, social networks, SMS and Email. It became popular when it became default URL Shortening Service for Twitter in 2009. Now we will learn how to integrate Bitly into any PHP application.

 

 

BITLY URL Shortner PHP CLASS

Here is a  simple PHP class that uses The Bitly API. It shorten URLs  and also convert short URLs to original ones.

Get oAuth Token:

Bitly requires you to generate generic oAuth token to shorten URL using API.

  •   Signup/login at http://bitly.com.
  •   Now to generate generic oAuth token click here.
  •   At bottom of the page confirm your account password and Bitly will generate oAuth token.
  •   Copy this oAuth token, it will be used in below Bitly PHP Class.

Bitly PHP Class:

 Usage:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

scroll to top