A URL shortener is an online application that converts your regular Long URL into short condensed format. User only have to copy its Long URL paste it into the URL shortening tool to create an short url.
Long URL : http://www.digiming.com/2016/08/things-you-should-do-to-optimize-your.html
Short URL : http://bit.ly/2bjGpaN
Now, using bit.ly’s API (Which used by Twitter to shortner URLS), we can create and publish short URL’s for every post on Blogger. So its easy your blog readers to share on twitter and on social media.
Lets Start !
It's Done.
Short URL makes easy to tweet and use in any other social networks.
Below is a example of how short url looks
Long URL : http://www.digiming.com/2016/08/things-you-should-do-to-optimize-your.html
Short URL : http://bit.ly/2bjGpaN
Now, using bit.ly’s API (Which used by Twitter to shortner URLS), we can create and publish short URL’s for every post on Blogger. So its easy your blog readers to share on twitter and on social media.
Lets Start !
1. To show a short URL at the bottom of every entry, do this search with the gadgets expanded:
<divclass='post-footer-line post-footer-line-3'> </div>
2.Inside any of the 3 footer lines, paste this code:
<b:if cond='data:blog.pageType == "item"'><form id='shorturl'/></b:if>
3. Next - Before the </head> tag Paste below script
<script type="text/javascript" charset="utf-8" src="http://bit.ly/javascript-api.js?version=latest&login=bturls&apiKey=R_37db93397f2c5d6b49a0f3d778d2e142"></script> <script type="text/javascript" charset="utf-8"> BitlyClient.addPageLoadEvent(function(){ BitlyCB.myShortenCallback = function(data) { // this is how to get a result of shortening a single url var result; for (var r in data.results) { result = data.results[r]; result['longUrl'] = r; break; } document.getElementById("shorturl").innerHTML = "Share this link: <input type='text' value='" + result['shortUrl'] + "' name='bitlyurl'/>"; } BitlyClient.shorten(document.location, 'BitlyCB.myShortenCallback'); }); </script>
It's Done.
Short URL makes easy to tweet and use in any other social networks.
Post A Comment: