bit ly 域名缩短
首先到 bit.ly 官方网站(bit.ly)申请一个账号,然后获取API KEY。注册过后,通过该账号进行的域名缩短服务都会有记录,可以帮助用户进行分析等。
注册账号后,只要进入Setting,可以看到你的API key。
API 说明:
RESTAPI¶
/v3/shorten¶
For a long URL,/v3/shorten encodes a URL and returns a short one.
Parameters
- format (optional) indicates the requested response format. supported formats: json (default), xml, txt.
- longUrl is a long URL to be shortened (example: http://betaworks.com/).
- domain (optional) refers to a preferred domain; either bit.ly default or j.mp. This affects the output value of url.
- x_login (optional) is the end-user's login when make requests on behalf of another bit.ly user. This allows application developers to pass along an end user's bit.ly login.
- x_apiKey (optional) is the end-user's apiKey when making requests on behalf of another bit.ly user. This allows application developers to pass along an end user's bit.ly apiKey.
Notes
- Long URLs should be URL-encoded. You can not include a longUrl in the request that has '&', '?', '#', ' ', or other reserved parameters without first encoding it.
- Long URLs should not contain spaces: any longUrl with spaces will be rejected. All spaces should be either percent encoded (%20) or plus encoded (+). Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before shortening.
- Long URLs must have a slash between the domain and the path component. For example, http://example.com?query=parameter is invalid, and instead should be formatted as http://example.com/?query=parameter
- When including x_login and x_apiKey, the shortened URL will be inserted into the history for the user specified by x_login. it will not be inserted into the history for the user specified by login.
参考URL: http://code.google.com/p/bitly-api/wiki/ApiDocumentation#/v3/shorten
http://code.google.com/p/bitly-api/wiki/ApiBestPractices#Rate_Limiting
使用方法:
t通过HTTP请求的方式。
GET方式:
http://api.bit.ly/v3/shorten?login=XXX&apiKey=R_a2dc759....&longUrl=http%3A%2F%2Fwww.baidu.com%2F&format=xml
其中:
Login :表示用户名
Apikey:表示API key (注册账号后即分配)
longUrl:表示要被转换的长URL (注释格式必须正确)
format:表示指定返回值类型,bit.ly支持三种形式: json、xml、txt,默认为json。
还可以加其他的参数,具体参照上面的Parameters说明。
请求后返回结果:
上图中,url是缩短后的网址。
总结:
1.需要到bit.ly注册一个账号,需要用到 用户名、API key
2.注意选择返回值类型,json、xml、txt (系统默认json)
3.注意选择域名缩短的形式: bit.ly 、 m.jp
4.另外在进行域名缩短前,可能还得考虑bit.ly支持哪些国家等等信息。避免软件在其他国家使用时异常终止等事件的发生。
5.有访问频率限制。单个IP最多允许5个连接。访问频率每小时会刷新。
bit ly 域名缩短相关推荐
- bit.ly 域名缩短
首先到 bit.ly 官方网站(bit.ly)申请一个账号,然后获取API KEY.注册过后,通过该账号进行的域名缩短服务都会有记录,可以帮助用户进行分析等. 注册账号后,只要进入Setting,可以 ...
- 域名缩短源码PHP程序 分享 亲测可用
1.输入短域请加上http(s):// 2.中文域名请手动Punycode编码后再使用 3.网址最长支持1000字符 4.密语最长支持3000字符(合1000汉字) 5.手动填写短域以及密码为可选项目 ...
- 老域名有什么好处?老域名如何选择?
老域名有什么好处?老域名(Old Domain)可以帮助企业网站获得一些独特的优势,比如更好的搜索引擎优化(SEO).信誉度和受欢迎程度.老域名是指过去曾经使用过的域名,这些域名通常具有一定的权重,可 ...
- 复现20字符短域名绕过以及xss相关知识点
xss xss攻击 xss指黑客通过特殊的手段往网页中插入了恶意的 JavaScript 脚本,从而在用户浏览网页时,对用户浏览器发起 Cookie 资料窃取.会话劫持.钓鱼欺骗等各攻击. xss攻击 ...
- dns (域名系统)
dns (域名系统) DNS(Domain Name System,域名系统),因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP ...
- 网络知识科普 | 你未必了解的DNS
这几天一直在整理HTTPDNS相关的知识点,也准备写一篇关于DNS.EDNS.HTTPDNS.DNS的文章已经整理了一般,忽然看到了这篇文章,感觉写的甚好,遂狠心删掉了自己写的内容.这一篇来自阮一峰大 ...
- windows如何添加本机dns记录_运维必看!超清晰的 DNS 原理入门指南
来源:阮一峰的网络日志 作者:阮一峰 链接:http://www.ruanyifeng.com/blog/2016/06/dns.html DNS 是互联网核心协议之一.不管是上网浏览,还是编程开发, ...
- Web设计与开发终极资源大全
Web 技术突飞猛进,Web 设计与开发者们可以选择的工具越来越多,Web 开发者的技巧不再只限于 HTML 和 服务器端编程,还需要精通各种第三方资源,这些第三方资源有时候比你的项目更复杂,更专业, ...
- Web 设计与开发终极资源大全
Web 技术突飞猛进,Web 设计与开发者们可以选择的工具越来越多,Web 开发者的技巧不再只限于 HTML 和 服务器端编程,还需要精通各种第三方资源,这些第三方资源有时候比你的项目更复杂,更专业, ...
最新文章
- 菜鸟解读qt源码----qsqlfield.h
- 火星浏览器_「超详细Filecoin矿工手册」IPFS的应用以及意义 | 火星号精选
- 使用openssl生成ssl(https)证书
- 详解MySQL字符串函数CONCAT()、CONCAT_WS()、INSERT()、REPLACE()、LOWER()、UPPER()用法(二)
- python入门学习课程推荐
- c# DirectoryInfo 类和 FileInfo 类
- leetcode 88
- ui-router 1.0 001 - resolve, component, sref-active
- Netty实战一之异步和事件驱动
- Django-djangorestframework-异常模块-源码及自定义异常
- Cesium知识点:根据经纬度获取高程
- Conficker病毒新变种卷土重来 可关闭杀毒软件
- windows 匿名管道: 父进程与子进程通信 (进程间通信之CreatePipe)
- 竞品分析 | 不背单词、百词斩
- 某猫电影 css 加密解决方案
- Web自定义表单工具和协同办公系统之集成(1)
- VC++ 动态检测串口的热插拔(一)通过遍历实现
- ICP算法概述以及使用SVD进行算法推导
- 脉搏波相关概念及内容-记录整理
- fs模块下的readFile()和readFileSync()
热门文章
- 《Spatially Attentive Output Layer for Image Classification》论文翻译
- 湖北工业大学计算机学院研究生院,刘罡-欢迎访问湖北工业大学计算机学院官方网站...
- UDS入门至精通系列:Service 22
- 索尼推出有专用HDMI接口5G智能手机;黑莓与百度合作赋能下一代自动驾驶技术 | 美通企业日报...
- 鸿蒙系统会和安卓一样垃圾多,“鸿蒙系统”和“安卓系统”到底有什么区别?网友:细节定成败!...
- Canal同步mysql binlog至pulsar
- 扒一扒Lombok的@Slf4j注解,我发现还有点意思。
- android的休眠
- 三相逆变器双pi控制器参数如何调节_空间矢量LCL三相逆变器
- Xilinx Spartan6-XC6SLX16-22FTG256(2022.3.31)