Powered By

Powered by Blogger

Tampilkan postingan dengan label short urls. Tampilkan semua postingan
Tampilkan postingan dengan label short urls. Tampilkan semua postingan

Kamis, 26 November 2009

How To Create Your Own Short URLs With Google Apps

There are loads of short url services these days, but a lot of them disappear and your links are lost. So what can you do in order to have control over your short URLs? It's pretty easy (assuming you have your own domain): create your own short url service with Google Apps. Obviously, this is a free service (as long as you have the domain name).

1. The first thing you need to do is set up Google Apps for your domain.

2. Then go to THIS link and click on "Add it now" button and enter your domain name. After logging in, enter the subdomain for your short URLs. For instance "sh.yoururl.com". You then need to create a new CNAME in your domain name control panel. Name (alias) this CNAME "sh" (for my example, it depends on what you have chosen), and redirect it to ghs.google.com

3. Let's take care of all the settings for our short URLs. Click on "Additional Short Links settings":

short url google apps

For the good of your own url shortening service, make sure you check the following boxes:

Access restrictions: Only administrators may create new links.

Miscellaneous options: Use permanent redirects (HTTP code 301).

4. To create your short url, go to the subdomain you have set up. In my example: http://sh.yoururl.com. You will reach as screen which looks like this:

google apps short url


You can now start creating your own short urls using Google Apps. You can either choose to create your custom short url or hashed short url (which will look like this: http://sh.yoururl.com/rtu62f)

Also, as you can see, there are also two bookmarklets you can use, one for private and one for public links. You can drag them to your browser toolbar and click whenever you want to create a short url.

And finally, you will also have some stats for your links so that's also something to take into consideration when deciding if you want to use your own url shortening service with Google Apps. As you can see, basically you won't lose any (or most of them) features other url shortening services have, and also, using Google Apps, you are sure you won't lose your short URLs!

Kamis, 01 Oktober 2009

Bit.ly URL Shortening Applet For Gnome [Linux]

bit.ly gnome applet

gbitly-applet is an applet for Gnome which enables creation of short urls without logging into bit.ly. Its still in its development stage but alpha version is available.

How it works: you will need to right click your Gnome panel, select "Add to Panel" and add gbitly-applet, then right clicking the applet you will see a form in which you must fill in the long URL which you want to get shortened. Also, the applet automatically detects a long URL you previously copied (from the clipboard) and adds it to the long URL field.

You can download it from HERE.

To install it is pretty easy. First, make sure you have libcurl-devel,panel-applet-devel and gtk-devel installed. For Ubuntu:
sudo apt-get install libcurl-devel panel-applet-devel gtk-devel
Then:
make
sudo make install


To make a bit.ly account, go to http://bit.ly/account/register?rd=/ and then get your API key from: http://bit.ly/account/ then copy the API key and paste on the API key in preferences of the applet.

Rabu, 12 Agustus 2009

Automatic ShortURL For Every Blogger Post [Widget]

This tutorial will explain how to automatically generate short urls (using the bit.ly API) for every Blogger post, and display this URL in a box at the bottom of each post - TechCrunch style. For Wordpress blogs there are plugins which you can use to achieve this but as always, making this possible for a Blogger blog is tricky.

shorturl box blogger

Before we get started, I would like to thank Francisco from BlogAndWeb for sharing this with us.

Now we can proceed to implementing this into a blogspot.com blog:

1. Expand Widget Templates Go to your Blogger dashboard > Layout > Edit HTML and check the "Expand Widget Templates" box. Now search for the following piece of code:
<div class='post-footer-line post-footer-line-3'>
Please note: it can be post-footer-line-1 or post-footer-line-2 instead of post-footer-line-3. Also, it can be a <p class= ... instead of <div class= ...

2. Paste the following code right after the line you found from step 1:
<b:if cond='data:blog.pageType == "item"'><form id='shorturl'/></b:if>
If you want this short url box to be displayed in some other area of your template, you can put the above code in some other location into your template.

3. Search for the </head> tag into your template, and paste this right above it:
<script type="text/javascript" charset="utf-8" src="http://bit.ly/javascript-api.js?version=latest&amp;login=bitlyapidemo&amp;apiKey=R_0da49e0a9118ff35f52f629d2d71bf07"></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 = "Dirección para compartir: &lt;input type='text' value='" + result['shortUrl'] + "' name='bitlyurl'/&gt;";
}
BitlyClient.shorten(document.location, 'BitlyCB.myShortenCallback');
});
</script>
If the above code returns an error, copy & paste the code from HERE instead of the one above.

If you want to track your shorturl clicks, replace the bit.ly login and API key in the code above with your own (you can get an API key by registering for an account on bit.ly - don't worry, it's free).

4. This is an optional step: you can also style this shorturl box. For this, in your template, search for ]]></b:skin> and paste this code right above it:
form#shorturl {
color:#666;
font-size:11px
}

#shorturl input {
color:#999;
border:1px inset #CDCDCD;
padding:1px 5px;
}

You can modify it, add some other styles, etc, all by using CSS.