Bikin Short URL Otomatis di Blog

Discussion in 'HTML & Website Design' started by opeganteng, Mar 6, 2015.

  1. opeganteng

    opeganteng Member

    Joined:
    Oct 12, 2014
    Messages:
    22
    Likes Received:
    2
    Trophy Points:
    8
    Lama nggak bikin thread di sini :D

    Kali ini ane mau bikin tutorial (yang mungkin) bermanfaat buat kalian semua para sesepuh blogger ;)
    Tutorialnya adalah Buat Short URL Otomatis untuk Blog. Tutorial ini sementara hanya untuk pengguna Blogger, selain itu (ex: Wordpress, dll) ane belum nyoba. kaga tau cara pasangnya *berkeringat* contoh bisa lihat di blog ane :D http://www.opesite.web.id

    oke langsung saja.

    1. Daftar/buat akun di bitly.com
    2. Masuk ke link ini https://bitly.com/a/your_api_key. Perhatikan Bitly Username dan Bitly API Key-nya
    3. Masukkan CSS ini ke blog ente. Caranya? cari Gugel!

    Code:
    form#shorturl {
    color:#fff;
    font-size:12px
    z-index:99;
    margin:5px;
    }
    #shorturl input {
    color:#fff;
    border:1px solid #FF6666;
    width:300px;
    font-weight:bold;
    background-color:#FF6666  ;
    }
    #short-inner{
    width:510;
    padding:0px;
    background-color:#FF6666  ;
    z-index:-1;
    margin-top:1px;
    margin-bottom:1px;
    }
    4. Copy dan Paste script berikut ini diatas </head>

    Code:
    <script charset='utf-8' src='http://bit.ly/javascript-api.js?version=latest&amp;login=BITLY USERNAME&amp;apiKey=BITLY API KEY' type='text/javascript'/>
    <script charset='utf-8' type='text/javascript'>
    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[&#39;longUrl&#39;] = r;
    break;
    }
    document.getElementById(&quot;shorturl&quot;).innerHTML = &quot;Short link untuk artikel ini adalah: &lt;input type=&#39;text&#39; value=&#39;&quot; + result[&#39;shortUrl&#39;] + &quot;&#39; name=&#39;bitlyurl&#39;/&gt;&quot;;
    }
    BitlyClient.shorten(document.location, &#39;BitlyCB.myShortenCallback&#39;);
    });
    </script>

    Perhatikan Bitly Username dan Bitly API Key. Gantilah dengan punya ente sendiri (cara nomer 2)

    5. Selanjutnya copy script berikut ini dan paste entah di mana terserah ente. Bisa di bawah judul atau di akhir postingan.

    Code:
    <div id='short-inner'>
    <form id='shorturl'/>
    </div>
    6. Simpan template dan lihat hasilnya. Taraaaa!!! uwowo... *hore*

    Silahkan utak-atik sendiri CSS-nya untuk modifikasi tampilannya *jail*

    source : Opesite
     
    Damar likes this.
  2. Damar

    Damar Well-Known Member

    Joined:
    Jun 22, 2014
    Messages:
    1,472
    Likes Received:
    216
    Trophy Points:
    63
    Google+:
    Sip Den :D
    Akhirnya bisa buat short url otomatis dari Bitly *bagus*
     
  3. Damar

    Damar Well-Known Member

    Joined:
    Jun 22, 2014
    Messages:
    1,472
    Likes Received:
    216
    Trophy Points:
    63
    Google+:
    Wordpress sepertinya sama saja, tinggal paste di templatenya doang (Wordpress Self Hosting). :D
    tapi sudah disediakan juga sih shorturl dari wordpress :D *kagum*
     
  4. cayun

    cayun Member

    Joined:
    Feb 5, 2013
    Messages:
    661
    Likes Received:
    27
    Trophy Points:
    28
    Keren nih, tapi saya suka pke adf.ly wkwkw
     
  5. CaraPedi

    CaraPedi Member

    Joined:
    Jan 7, 2015
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    8
    Tapi g bisa lihat statistiknya dong? berapa kali link yang kita shorten diklik.
     
  6. Achmad Muharya

    Achmad Muharya Member

    Joined:
    Apr 29, 2014
    Messages:
    427
    Likes Received:
    23
    Trophy Points:
    18
    Mantabbb *bagus*, ditunggu thread-thread sejenis yang lainnya om :D
     
  7. opeganteng

    opeganteng Member

    Joined:
    Oct 12, 2014
    Messages:
    22
    Likes Received:
    2
    Trophy Points:
    8
    hahah.. iye karena berbayar
     
  8. opeganteng

    opeganteng Member

    Joined:
    Oct 12, 2014
    Messages:
    22
    Likes Received:
    2
    Trophy Points:
    8
    bisa, lihat di akun bitly-nya *bagus*
    contoh: http://prntscr.com/6damr1
     
  9. opeganteng

    opeganteng Member

    Joined:
    Oct 12, 2014
    Messages:
    22
    Likes Received:
    2
    Trophy Points:
    8
    oh iya wp ada sendiri *berkeringat*
     
  10. opeganteng

    opeganteng Member

    Joined:
    Oct 12, 2014
    Messages:
    22
    Likes Received:
    2
    Trophy Points:
    8
    mantap *bergaya*
     
  11. Ardilas

    Ardilas Super Level

    Joined:
    Feb 18, 2013
    Messages:
    4,243
    Likes Received:
    317
    Trophy Points:
    83
    Google+:
    Setelah saya lihat gambarnya, sepertinya suatu artikel berjudul 'Konflik Ahok vs DPRD Jakarta Karena USB?'. Hehehe, cuma ingin kasih tau Mas. Bukan USB tapi UPS.
     
  12. Musa M

    Musa M Member

    Joined:
    Apr 29, 2014
    Messages:
    838
    Likes Received:
    57
    Trophy Points:
    28
    kalau cara buat url shortener seprti milihnya den @Samehadaku ada yang tahu ? kalau ada yang share pasti manteb banget :D
     
  13. Musa M

    Musa M Member

    Joined:
    Apr 29, 2014
    Messages:
    838
    Likes Received:
    57
    Trophy Points:
    28
    wkwk , mungkin nulisnya terllau cepat bro . jadi salah ketik , tapi lucu juga sih :D
    update : setelah saya baca memang seperti itu judulnya :)
     
  14. Gesper

    Gesper Member

    Joined:
    Mar 1, 2015
    Messages:
    242
    Likes Received:
    9
    Trophy Points:
    18
    Google+:
    Ane coba ah den, terima kasih tips nya
     
  15. ayahnyanadia

    ayahnyanadia Well-Known Member

    Joined:
    Apr 4, 2013
    Messages:
    1,369
    Likes Received:
    153
    Trophy Points:
    63
    Google+:
    ngoprek css paling males dan bikin pusing..
     
  16. DwiKhasbullah

    DwiKhasbullah Well-Known Member

    Joined:
    Aug 7, 2014
    Messages:
    1,955
    Likes Received:
    138
    Trophy Points:
    63
    Manteb nih kayaknya, bisa bikin sendiri... *belajar*
     
  17. BangDen

    BangDen Member

    Joined:
    Dec 14, 2014
    Messages:
    223
    Likes Received:
    15
    Trophy Points:
    18
    bleh jga ni gan, kpn2 bsa dicoba.. thanks for share..
     
  18. tonbad

    tonbad Member

    Joined:
    Dec 21, 2014
    Messages:
    260
    Likes Received:
    24
    Trophy Points:
    18
    Google+:
    wew mantap nih tutorialnya bisa menghemat tenaga.. thanks..
     
  19. Wedepe

    Wedepe New Member

    Joined:
    Mar 18, 2015
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    6
    Google+:
    Wah keren nih short cut nya. makasih gan
     
Loading...

Share This Page