Skip to content

Commit

Permalink
(Feat) add versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
azai91 committed Nov 2, 2015
1 parent a03b19e commit a2e7efb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/cdn.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
import sys
from workflow import Workflow, ICON_WEB, web

wf = Workflow()
UPDATE_SETTINGS = {'github_slug' : 'azai91/alfred-cdn-workflow'}
HELP_URL = 'https://github.com/azai91/alfred-cdn-workflow/issues'

wf = Workflow(update_settings=UPDATE_SETTINGS, help_url=HELP_URL)

URL = 'http://api.cdnjs.com/libraries?'


def main(_):
url = 'http://api.cdnjs.com/libraries?'

if wf.update_available:
wf.add_item(
'An update is available!',
autocomplete='workflow:update',
valid=False)

if len(wf.args):
query = wf.args[0]
else:
query = None
params = dict(search=query, fields='version,description')
r = web.get(url, params)
r = web.get(URL, params)

r.raise_for_status()
results = r.json()['results']
Expand Down
1 change: 1 addition & 0 deletions src/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1

0 comments on commit a2e7efb

Please sign in to comment.