Skip to content

Commit

Permalink
adds show_options menu
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuajharris committed Jun 7, 2017
1 parent 82b6b0a commit fb7d885
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 49 deletions.
Binary file added Medium.alfredworkflow
Binary file not shown.
48 changes: 0 additions & 48 deletions src/action.py

This file was deleted.

10 changes: 9 additions & 1 deletion src/medium.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ def search_posts(q):

############### WORKFLOW ###############

def show_options():
wf.add_item(
"Start Typing to search for posts.",
valid=False) # makes it not actionable

wf.send_feedback()
return 0;

def add_posts(posts):
for post in posts:
url = '{}/{}'.format(POST_URL, post['id'])
Expand Down Expand Up @@ -137,7 +145,7 @@ def main(wf):
# Show popular subreddits
# ------------------------------------------------------------------
if query == '':
log.debug("blah")
show_options()
else:
posts = search_posts(query)
add_posts(posts)
Expand Down

0 comments on commit fb7d885

Please sign in to comment.