From 94d01186cf09620403a63da08878ac0daefe14f4 Mon Sep 17 00:00:00 2001 From: ryanmcgrath Date: Mon, 13 Sep 2010 02:21:26 -0700 Subject: [PATCH] Migrated from generic-functions v1 --- Generic-Functions.textile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Generic-Functions.textile diff --git a/Generic-Functions.textile b/Generic-Functions.textile new file mode 100644 index 0000000..58288ce --- /dev/null +++ b/Generic-Functions.textile @@ -0,0 +1,24 @@ +h1. Generic Tango Functions + +The following functions serve basic needs, both in terms of the library itself, and some auxiliary functions. + +shortenURL() + +Returns a specified url shortened by is.gd. The choice of url shortener can be overridden if necessary. Most url shorteners have API limits; be sure to investigate this before you use this in a widespread manner. + +Parameters: + url_to_shorten: (Required) The url that you want shortened. + shortener: (Optional) The url of your desired shortener API. Defaults to http://is.gd/api.php. + query: (Required if overriding default service) The name of the url parameter you're passing to the service. + +
+
+import tango
+
+# Shortening URLs requires no authentication, huzzah
+twitter = tango.setup()
+shortURL = twitter.shortenURL("http://www.webs.com/")
+
+print shortURL
+
+
\ No newline at end of file