omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. robbielj31

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    robbielj31

    @robbielj31

    0
    Reputation
    480
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    robbielj31 Unfollow Follow

    Latest posts made by robbielj31

    • RE: Feature Requests

      I second the background running feature.

      posted in Pythonista
      robbielj31
      robbielj31
    • RE: PLS Help: Bitly URL Shortener

      This should work.
      first of all, long url should be url-quoted.
      then bitly api returns json data so needs json module to load.
      build a urllib2 opener to open formatted <code>bitly_url</code>, that's it.

      <pre>
      import clipboard
      import urllib2
      import json

      kurzurl = urllib2.quote(clipboard.get())

      def shorten_url(long_url):
      username = 'username'
      apikey = 'apikey'
      bitly_url = "http://api.bit.ly/v3/shorten?login=%s&apiKey=%s&longUrl=%s" %(username, apikey, long_url)
      r = urllib2.Request(bitly_url)
      opener = urllib2.build_opener()
      f = json.loads(opener.open(r).read())
      short_url = f['data']['url']
      return short_url

      print shorten_url(kurzurl)
      </pre>

      posted in Pythonista
      robbielj31
      robbielj31