LoginSignup
4
4

More than 5 years have passed since last update.

tmlib.js公式エディタrunstantで知った事(その2)

Last updated at Posted at 2014-07-23

googleのショートURLサービスはOKだが

runstantのURLはbit.lyではハッシュが長いのか、「ただしいURLではない」と怒られた。

ほぼサーバ通信の無いrunstantだが、共有機能ではgoogleのショートURLサービスを使っており、こちらのサービスだとrunstantのハッシュ付きURLも問題なく扱えている。

getShortURL = function(r, n) {
    return $.ajax({
        url: "https://www.googleapis.com/urlshortener/v1/url",
        type: "POST",
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify({
            longUrl: r
        }),
        dataType: "json",
        success: function(r) {
            return n(r.id)
        },
        error: function(r) {
            return console.error(r)
        }
    })
};

どうやらgoogleでも8k程度が限界の模様

bit.lyだと「+」付けるだけで統計情報みれて便利なのだが残念。

GoogleのショートURLサービスでも統計情報が見えた

http://goo.gl/#analytics/」のあとにhttp://をとったURLを
付け、「/day」などを付ければOKだった。

http://goo.gl/#analytics/goo.gl/TlEpfB/day

まとめ

runstant勉強になる。@phi さんのAceエディタの解説楽しみにしてます。

関連投稿

4
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4