jQuery Based Long URL Shortener Using Google or Bitly API - shortify

jQuery Based Long URL Shortener Using Google or Bitly API - shortify
File Size: 4.43 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

shortify is a lightweight jQuery plugin that automatically shorten a given URL using Google URL Shortener (goo.gl) or Bitly service.

See also:

How to use it:

1. Include the jQuery javascript library and jQuery shortify plugin in the web page.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery.shortify.js"></script>

2. Add an unique ID or CSS class to the link.

<a id="demo-googl" href="http://example.com">example.com</a>
<a id="demo-bitly" href="http://example.com">example.com</a>

3. Call the plugin and you're done. If you're using Bitly service, you must specify an API in the APIKEY option.

<script>
$(document).ready(function() {
$("#demo-googl").shortify({
service: 'googl',
apikey: 'YOUR GOO.GL ACCESS TOKEN'
});
$("#demo-bitly").shortify({
service: 'bitly',
apikey: 'YOUR BIT.LY ACCESS TOKEN'
});
});
</script>

This awesome jQuery plugin is developed by bprayudha. For more Advanced Usages, please check the demo page or visit the official website.