Jump to content

x100s

Member
  • Posts

    3
  • Joined

  • Last visited

x100s's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Thank you for the fast replay. 4. Should this be enough ? search = ({query}) How can I return the result in a list e.g like the default search result in Alfreds HUD? And if i select one of the rows it will open the url in my default browser?
  2. I am new to this, so sorry if I am a little short here. How do I convert this to Alfred and return the data to alfred, and can open the URL via alfred ? #!/usr/bin/python # -*- coding: utf-8 -*- import sys import json import urllib2 if len(sys.argv) < 2: print ("Please add a search query") sys.exit(1) search = str(sys.argv[1]) req = urllib2.Request("http://example.com/?query="+search, None, {'user-agent':'json/'}) opener = urllib2.build_opener() f = opener.open(req) d = f.read() u = json.loads(d) if 'entries' in u.keys(): for info in u['entries']: country = info['country'] zip = info['zip'] state = info['state'] name = info['name'] adress = info['adress'] url = 'http://example.com/s...kup/p?zip=' zip print name.encode('utf-8')+" -", adresse.encode('utf-8'), zip, state.encode('utf-8')
×
×
  • Create New...