有時候我們產生的URL連結是又臭又長,很不美觀. 所以會常用縮短連結。 最常用的就是 Google URL shortener

 

$http.post('https://www.googleapis.com/urlshortener/v1/url?key=#key',{longUrl:'http://kenneth2011.pixnet.net/blog/post/111980533'}).success(function(data,status,headers,config){
            $scope.shortUrl=data.id;}).
        error(function(data,status,headers,config){});
文章標籤
全站熱搜
創作者介紹
創作者 Kenneth 的頭像
Kenneth

Kenneth的部落格

Kenneth 發表在 痞客邦 留言(0) 人氣(37)