summaryrefslogtreecommitdiffstats
path: root/tcllib/modules/rest/bitly
diff options
context:
space:
mode:
Diffstat (limited to 'tcllib/modules/rest/bitly')
-rw-r--r--tcllib/modules/rest/bitly34
1 files changed, 34 insertions, 0 deletions
diff --git a/tcllib/modules/rest/bitly b/tcllib/modules/rest/bitly
new file mode 100644
index 0000000..2d21305
--- /dev/null
+++ b/tcllib/modules/rest/bitly
@@ -0,0 +1,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