1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
# documentation: http://code.google.com/p/bitly-api/wiki/ApiDocumentation
package require rest
set bitly(shorten) {
url http://api.bit.ly/v3/shorten
req_args { login: apiKey: }
opt_args { domain: }
body { argument longUrl }
check_result { {[dict get $result status_code] == "200"} {} }
}
set bitly(expand) {
url http://api.bit.ly/v3/expand
req_args { login: apiKey: }
body { arg shortUrl }
check_result { {[dict get $result status_code] == "200"} {} }
}
set bitly(clicks) {
url http://api.bit.ly/v3/clicks
req_args { login: apiKey: }
body { arg shortUrl }
check_result { {[dict get $result status_code] == "200"} {} }
}
set bitly(referrers) {
url http://api.bit.ly/v3/referrers
req_args { login: apiKey: }
body { arg shortUrl }
check_result { {[dict get $result status_code] == "200"} {} }
}
rest::create_interface bitly
|