File: bitly

package info (click to toggle)
tcllib 1.20%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 68,064 kB
  • sloc: tcl: 216,842; ansic: 14,250; sh: 2,846; xml: 1,766; yacc: 1,145; pascal: 881; makefile: 107; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (34 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (8)
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