短链接dlj.bz

短链接 http://dlj.bz上线啦!短链接 - 更好传递!!

curl调试方法
1
2
3
4
5
curl http://dlj.bz/api/urlshortener \
-H 'Content-Type: application/json' \
-d '{"long_url": "http://www.google.com/"}'

{"short_url":"http://dlj.bz/fBBa","long_url":"http://www.google.com/"}
ruby接口
1
2
3
4
5
6
7
8
9
10
gem install dljbz
irb -r dljbz

url = Dljbz.shorten('http://51qiangda.com')
url.short_url
=> "http://dlj.bz/51qd"
url.long_url
=> "http://51qiangda.com"
url.qr_code #二维码
=> "http://dlj.bz/51qd.qr"

ruby版本的api gem

Gem Version

原文地址:http://dlj.bz/kp0oGj

Comments