Search code examples
pythontwittermobileurl-shortener

Generating sharing message and shortened URL to Twitter


I am using a Twitter ghetto sharing on a very simple Python based mobile site

 return "http://mobile.twitter.com/home?status=" + urllib.quote(link)

I'd like to change the sharing so that Twitter messages gets the page title (I have it) and shortened URL.

Does there exist any general libraries/micro-frameworks for this purposes for Python?


Solution

  • I'd recommend implementing a URL-shortener API (ie: bit.ly). Even further, there are API wrappers available for most of these popular services (ie: Python API wrapper for bit.ly - http://code.google.com/p/python-bitly/).