Jump to content

frankspin

Member
  • Content Count

    71
  • Joined

  • Last visited

  • Days Won

    7

Reputation Activity

  1. Like
    frankspin got a reaction from thanasut in Airmail workflow   
    Edit: 2014-05-23
     
    Added some more search context options: subject and starred. Also adjusted the triggers to keep them shorter and simplier to trigger
     
    Edit: 2013-12-23
    The 1.3 update to Airmail seems to have broke the way this workflow worked. I'll work on getting it fixed.
     
     
    I know there is a thread going on in the help portion so I figured I'd share my current Airmail workflow. Right now it has two components: new mail and unified search(Big thank you to David Ferguson for helping me with this one).
     
    Compose new mail:
    Super basic as all it does it switch to Airmail and open a new composer window.
     
    Syntax: airmail new
     
    Unified Search:
    This relies on Applescript and has two caveats: 1. you have to have unified inbox enabled and 2. if the search field is active it wont work
     
    Syntax: airmail search {query}
     
     
    At some point I plan to make the compose mail workflow more robust and utilize the Airmail Applescript support, and also expand the unified search to check if the search field is active. I'm just on limited time right now but I at least wanted to get what I have out to peope. Feel free to add or help if you want!
     
    Download: https://github.com/fspinillo/alfred-airmail
  2. Like
    frankspin got a reaction from thanasut in Slackfred: Interact with your Slack channels, groups and IMs   
    Just re-uploaded the file to Packal and my GitHub. Please try again!
  3. Like
    frankspin got a reaction from thanasut in Slackfred: Interact with your Slack channels, groups and IMs   
    If you're having trouble getting the workflow to work and you're on V2 I am currently working on a solution. The issue is related to exporting a workflow from V3 and trying to have it run on V3.
  4. Like
    frankspin got a reaction from thanasut in Slackfred: Interact with your Slack channels, groups and IMs   
    Attention: I am no longer actively working on this Workflow. I don't have the time to dedicate to it anymore and provide the kind of updates I'd like. If you want to fork and contribute back to it, please do so via GitHub. I appreciate all the support and kind words shown by users for making this.
     
    slackfred
    =========

    Alfred workflow to interact, and perform various functions with the service Slack
     


    Alfred workflow to interact, and perform various functions with the service [slack](http://slack.com/). Now with multi-team support!

    I'm currently in the process of getting this updated to work with multiple organizations where possible, as well as adding some extra workflow options like private groups, stars and a few more things. Stay tuned!

    ## Getting started
    1. Install slackfred by visiting the download page in Github or via the [Packal page](http://www.packal.org/workflow/slackfred)
    2. Open alfred and type `slt`, then hold `cmd` (apple key) and press `enter`. This will open up the Slack API page. Then look for your team (make sure you're logged in) near the bottom. Next to your team name will be your token.
    3. Launch alfred and re-run `slt` to enter your token.

    ##### Multi-team use instructions
    In order to use the workflow with multiple organizations you will need to enter all of your keys as comma seperated strings with **no** spaces.  
    Example: `team-org-api-token-1,team-org-api-token-2`

    ## Currently Available Functionality
    * `slk`: Let's you switch easily between channels, groups and IMs. Thanks to buzali for getting this working with Slack's URL scheme.
    * `slt`: Set your API Token
      * Open alfred and type `slt`, then paste your token. If you don't have a token, then hold `cmd` to open the API page to get one (look for your team near the bottom of the page).
    * `slm`: Send messages to a channel
      * Open alfred and type `slm` to populate channels. Use your arrow keys to select a channel and hit TAB. Then you can enter your message and hit ENTER. * `slf`: Search files
      * Open alfred and type `slf` to search files. Selecting a file opens it in your browser
    * `slp`: Set your presence
      * Open alfred and type `slp active` or `slp away`
    * `slc`: View, leave and join channels or private groups
      * Open alfred and type `slc` to display a searchable list of channels. Selecting a channel with `alt` leaves and `ctrl` lets you join. Currently only `alt` is functional with groups.
    * `slclr`: Clear unread messages
      * This currently only marks Channels as read and not groups. Depending on the size of your organizations this can also take a few seconds to run.
    * `slim`: Enter a users name to search for most recent DM messages
    * `slr`: Search your starred items
      * Highlight a result and hitting enter opens the web client to that result
    * `sls`: Perform a query across all your channels in your organizations
      * Highlight a result and hitting enter opens the web client to that result
      * Depending on the size of your organization this can take a few seconds to run
    * `slz`: Snooze teams:
      * After finding a team hit TAB and enter the length of snooze in minutes
      * To turn off snooze to the above and enter 0
     
    ## To-do
    * Create a smoother API key/token process
    * Improve speed and performance

    This workflow was created with the help of Dean Jackson's library.
  5. Like
    frankspin got a reaction from davidzumini in Slackfred: Interact with your Slack channels, groups and IMs   
    This should be in the workflow already. Make sure you have the latest version.
  6. Like
    frankspin got a reaction from thec13 in Slackfred: Interact with your Slack channels, groups and IMs   
    Attention: I am no longer actively working on this Workflow. I don't have the time to dedicate to it anymore and provide the kind of updates I'd like. If you want to fork and contribute back to it, please do so via GitHub. I appreciate all the support and kind words shown by users for making this.
     
    slackfred
    =========

    Alfred workflow to interact, and perform various functions with the service Slack
     


    Alfred workflow to interact, and perform various functions with the service [slack](http://slack.com/). Now with multi-team support!

    I'm currently in the process of getting this updated to work with multiple organizations where possible, as well as adding some extra workflow options like private groups, stars and a few more things. Stay tuned!

    ## Getting started
    1. Install slackfred by visiting the download page in Github or via the [Packal page](http://www.packal.org/workflow/slackfred)
    2. Open alfred and type `slt`, then hold `cmd` (apple key) and press `enter`. This will open up the Slack API page. Then look for your team (make sure you're logged in) near the bottom. Next to your team name will be your token.
    3. Launch alfred and re-run `slt` to enter your token.

    ##### Multi-team use instructions
    In order to use the workflow with multiple organizations you will need to enter all of your keys as comma seperated strings with **no** spaces.  
    Example: `team-org-api-token-1,team-org-api-token-2`

    ## Currently Available Functionality
    * `slk`: Let's you switch easily between channels, groups and IMs. Thanks to buzali for getting this working with Slack's URL scheme.
    * `slt`: Set your API Token
      * Open alfred and type `slt`, then paste your token. If you don't have a token, then hold `cmd` to open the API page to get one (look for your team near the bottom of the page).
    * `slm`: Send messages to a channel
      * Open alfred and type `slm` to populate channels. Use your arrow keys to select a channel and hit TAB. Then you can enter your message and hit ENTER. * `slf`: Search files
      * Open alfred and type `slf` to search files. Selecting a file opens it in your browser
    * `slp`: Set your presence
      * Open alfred and type `slp active` or `slp away`
    * `slc`: View, leave and join channels or private groups
      * Open alfred and type `slc` to display a searchable list of channels. Selecting a channel with `alt` leaves and `ctrl` lets you join. Currently only `alt` is functional with groups.
    * `slclr`: Clear unread messages
      * This currently only marks Channels as read and not groups. Depending on the size of your organizations this can also take a few seconds to run.
    * `slim`: Enter a users name to search for most recent DM messages
    * `slr`: Search your starred items
      * Highlight a result and hitting enter opens the web client to that result
    * `sls`: Perform a query across all your channels in your organizations
      * Highlight a result and hitting enter opens the web client to that result
      * Depending on the size of your organization this can take a few seconds to run
    * `slz`: Snooze teams:
      * After finding a team hit TAB and enter the length of snooze in minutes
      * To turn off snooze to the above and enter 0
     
    ## To-do
    * Create a smoother API key/token process
    * Improve speed and performance

    This workflow was created with the help of Dean Jackson's library.
  7. Like
    frankspin got a reaction from smarg19 in Slackfred: Interact with your Slack channels, groups and IMs   
    Good catch! I just updated the workflow file to include the library. Can you give it another go? https://github.com/fspinillo/slackfred/blob/master/workflow/Slackfred.alfredworkflow
  8. Like
    frankspin reacted to deanishe in Workflow Library for Python   
    With regard to the GET parameters, workflow.web isn't very smart. The best thing to do is pass the GET parameters as a dictionary in the params arg, using a bare URL: web.get('https://slack.com/api/search.messages' params=dict(token=api_key, query=query, ...)) .

    requests is much smarter in this regard: you can pass GET parameters in the URL and/or via params. In either case, I'd recommend passing query via params as then both requests and workflow.web will ensure it's properly URL-encoded.

    Bummer you need to make two requests per API call

    Regarding threading: that can be a very tricky topic. In this case, you might be able to whip up something fairly simple using the Pool class from multiprocessing.dummy and its apply_async() or map_async() methods:
     
    from multiprocessing.dummy import Pool pool = Pool(5) # allow 5 simultaneous connections results = {} for url, params in urls: future = pool.apply_async(web.get, (url, params)) results[url] = future pool.close() # accept no more jobs pool.wait() # wait for queued jobs to finish and threads to exit # Populate `results` from the return value of the futures for url in results: future = results[url] results[url] = future.get() # Do what you want with results here... With regard to OOP, it doesn't make any difference. I didn't explain the issue very well. It's not so much that the function/class/whatever combines speaking with Alfred and speaking with an API, it's that the responsibilities aren't clearly separated and the code isn't properly layered.

    If there's an error, your functions bypass main() and talk directly to Alfred, which is otherwise the job of main(). That's a recipe for confusion. To be clear, it's not a huge deal for your functions to add an error message to the output with wf.add_item(), but they shouldn't be calling wf.send_feedback(). Effectively, that terminates the workflow and the lifetime of the workflow is main()'s responsibility.

    To give an analogy: you're the head of procurement (main()) and it's your job to collate all the internal orders and place the monthly order with your supplier (Alfred). You have several members of staff each responsible for different departments' orders. Normally, when they've collated their individual departments' orders, they bring them to you and you consolidate them into a single monthly order to the supplier.

    One of your team members (search_slack()) has an annoying habit of drafting his departmental order, but instead of giving it to you, he sometimes contacts the supplier himself and places the monthly order, but only for his stuff. And he doesn't even tell you when he's done this, so everyone else carries on preparing their orders without knowing it's too late to place them and they're wasting their time.

    Although that might be the right thing to do sometimes, he isn't in a position to know whether that's the case, and he's clearly overstepping his authority.

    In the script, if one of the API keys is invalid, search_slack() reports this, but also silently closes the reporting channel, so all the work done with other, valid API keys is silently thrown in the bin. Equally, any other keys that are invalid will also have their error reports thrown in the bin.
  9. Like
    frankspin reacted to deanishe in Browse Reddit   
    Reddit for Alfred

    Find subreddits and browse hot posts on Reddit.



    Download

    Get Reddit for Alfred from GitHub.

    Usage
    r/ — Show list of popular subreddits r/<query> — Search for subreddits matching <query> ↩ or ⇥ or ⌘+NUM — Show 50 hottest posts in subreddit r/subreddit/ — Show 50 hottest posts on subreddit <subreddit> r/<subreddit>/<query> — Filter posts by <query> ↩ or ⌘+NUM — Open post URL in default browser ⌘+↩ — Open Reddit comments in default browser ⌘+L — Show full post title in Alfred's Large Text window Note: OS X's "delete word" shortcut (⌥+⌫) is very handy for backing
    out of a subreddit.

    Description

    A fairly rudimentary workflow to browse subreddits.

    The subreddit search, r/<query>, uses Reddit's API to search for subreddits
    that match <query>. 25 results are retrieved by default.

    The subreddit search can be a bit odd, which is due to the oddness of Reddit's
    search function.

    Search within a subreddit, r/subreddit/<query>, only filters the list of hot
    results. 50 results are retrieved by default.
  10. Like
    frankspin reacted to deanishe in Workflow Library for Python   
    I'm afraid I don't quite understand what it is you're trying to do or what you think would be overwritten/replaced.
     
    If you just want to store multiple accounts/datasets in parallel, you might create a dictionary saved via the settings/stored data API that maps account names to a prefix, then use the appropriate prefix for the account in your caching/data/Keychain keys:
     
    # `account name:prefix` mapping, e.g. {'Personal': 'account1', 'Work':'account2'} accounts = wf.settings['accounts'] # or accounts = wf.stored_data('accounts')   account = 'Personal' prefix = accounts[account]   api_key = wf.get_password('{}-apikey'.format(prefix)) def wrapper(): url = 'https://api.example.com/v1/whatever.json' r = web.get(url, params={'api_key':api_key}) return r.json() some_cached_data = wf.cached_data('{}-thedata'.format(prefix), wrapper, max_age=0) ... ... Thus, some_cached_data would be stored under the key (filename) account1-thedata for account Personal and account2-thedata for account Work.
  11. Like
    frankspin reacted to Vero in Slackfred: Interact with your Slack channels, groups and IMs   
    Just to let you know, your workflow was featured on the blog yesterday:
    http://blog.alfredapp.com/2014/11/17/getting-work-done-with-slack-github-and-pinboard/
     
    Thanks for creating it
  12. Like
    frankspin got a reaction from palobo in Slackfred: Interact with your Slack channels, groups and IMs   
    Attention: I am no longer actively working on this Workflow. I don't have the time to dedicate to it anymore and provide the kind of updates I'd like. If you want to fork and contribute back to it, please do so via GitHub. I appreciate all the support and kind words shown by users for making this.
     
    slackfred
    =========

    Alfred workflow to interact, and perform various functions with the service Slack
     


    Alfred workflow to interact, and perform various functions with the service [slack](http://slack.com/). Now with multi-team support!

    I'm currently in the process of getting this updated to work with multiple organizations where possible, as well as adding some extra workflow options like private groups, stars and a few more things. Stay tuned!

    ## Getting started
    1. Install slackfred by visiting the download page in Github or via the [Packal page](http://www.packal.org/workflow/slackfred)
    2. Open alfred and type `slt`, then hold `cmd` (apple key) and press `enter`. This will open up the Slack API page. Then look for your team (make sure you're logged in) near the bottom. Next to your team name will be your token.
    3. Launch alfred and re-run `slt` to enter your token.

    ##### Multi-team use instructions
    In order to use the workflow with multiple organizations you will need to enter all of your keys as comma seperated strings with **no** spaces.  
    Example: `team-org-api-token-1,team-org-api-token-2`

    ## Currently Available Functionality
    * `slk`: Let's you switch easily between channels, groups and IMs. Thanks to buzali for getting this working with Slack's URL scheme.
    * `slt`: Set your API Token
      * Open alfred and type `slt`, then paste your token. If you don't have a token, then hold `cmd` to open the API page to get one (look for your team near the bottom of the page).
    * `slm`: Send messages to a channel
      * Open alfred and type `slm` to populate channels. Use your arrow keys to select a channel and hit TAB. Then you can enter your message and hit ENTER. * `slf`: Search files
      * Open alfred and type `slf` to search files. Selecting a file opens it in your browser
    * `slp`: Set your presence
      * Open alfred and type `slp active` or `slp away`
    * `slc`: View, leave and join channels or private groups
      * Open alfred and type `slc` to display a searchable list of channels. Selecting a channel with `alt` leaves and `ctrl` lets you join. Currently only `alt` is functional with groups.
    * `slclr`: Clear unread messages
      * This currently only marks Channels as read and not groups. Depending on the size of your organizations this can also take a few seconds to run.
    * `slim`: Enter a users name to search for most recent DM messages
    * `slr`: Search your starred items
      * Highlight a result and hitting enter opens the web client to that result
    * `sls`: Perform a query across all your channels in your organizations
      * Highlight a result and hitting enter opens the web client to that result
      * Depending on the size of your organization this can take a few seconds to run
    * `slz`: Snooze teams:
      * After finding a team hit TAB and enter the length of snooze in minutes
      * To turn off snooze to the above and enter 0
     
    ## To-do
    * Create a smoother API key/token process
    * Improve speed and performance

    This workflow was created with the help of Dean Jackson's library.
  13. Like
    frankspin reacted to rice.shawn in Packal: Workflow and Theme Repository   
    I'm happy to announce that after months of development, I'm ready to make a new workflow and theme repository available to the public as an open beta: Packal. Workflows and themes are taggable and searchable. You can add in the icons, screenshots, long descriptions, and brief ones. There are many different ways to find whatever you need there. Since this is an initial announcement, there isn't much content there yet, except for the workflows and themes that a few kind testers uploaded.
     
    Themes are stored as a simple application URL, which means there are no files to download, but, instead, they import directly into Alfred2. Workflows are scanned for viruses after they are submitted but before they are made available publicly. Workflow authors can easily update their workflows just by editing the page and replacing the workflow file there.
     
    What is even better is that Packal has its own updater for workflows. So, you have the option to update any workflows that you have downloaded from Packal.
     
    I think that these are exciting developments for Alfred, and this sort of repository is what many people have been waiting for since these forums were created.
     
    One great advantage for distributing your workflows via Packal is that you do not need to maintain your own download links for your workflows anymore, so you won't need to worry about download limits on sharing services. Another advantage is that it will receive more visibility as it is a place where people can look for workflows and themes without having to page through the impressive number of posts in these forums.
     
    So, please, head over to Packal, browse what's there, and, very importantly, submit your own workflows and themes.
     
    --Shawn
  14. Like
    frankspin reacted to deanishe in Workflow Library for Python   
    The idea of cached_data() is to avoid generating/fetching data if the cache is up-to-date. So, instead of passing it the data it should cache, you pass it a function it can call to get fresh data if the cached data is too old/non-existent.
     
    You're passing the results of a call to getBoards(). You need to pass the function itself, which cached_data() will then call if necessary.
     
    Normally, that looks something like this:
     
    def fetch_new_data():     # grab data from a web service/app here     # ...     return new_data data = wf.cached_data('cache-name', fetch_new_data, max_age=600)  
     Note that I'm passing fetch_new_data not fetch_new_data() to cached_data(), i.e. the function itself, not the data returned from calling the function.
     
    You can't just pass the function in this case, however, as getBoards() takes an argument.
     
    Check out the example script here. Look at the wrapper function and the call to cached_data() (lines 82–89). Note that I pass wrapper to cached_data without calling it.
     
    You could also pass lambda api_key: getBoards(api_key) or functools.partial(getBoards, api_key). I wrote a separate wrapper() function in the tutorial to make it clearer and more explicit (lambda is ugly).
     
    Does that help?
  15. Like
    frankspin reacted to deanishe in Workflow Library for Python   
    Much appreciated
     
    They're some pretty cool workflows you've written there.
     
    May I suggest you consider including the library (and info.plist, icon.png etc.) in your repos. That way, if someone downloads or forks the repo, they have a working workflow.
  16. Like
    frankspin reacted to idea4IT in Gmail Client for Alfred   
    Hi folks,
     
    I'm working on this new workflow which allows you to control your Gmail emails with Alfred.
     

     
    Features Quickly access your latest emails with Alfred Supported actions:Mark As Read/Unread Archive Move To Inbox/Trash Quick reply Add label Automatically uses a dark or light icon set depending on your current Alfred theme Background cache refresh Uses the official Gmail API to securely access your Gmail account Uses OAuth 2.0 to authorize the workflow Saves your access_token securely in OS X's keychain  
    Feel free to give some feedback!
     
    Github: https://github.com/fniephaus/alfred-gmail
     
    Download-Link: https://github.com/fniephaus/alfred-gmail/releases/latest
  17. Like
    frankspin got a reaction from smarg19 in Workflow Library for Python   
    This library really helped me re-jump into trying to learn programming . I've written three workflows now based around using this, each one building on the other and it's been super helpful.
  18. Like
    frankspin got a reaction from deanishe in Workflow Library for Python   
    This library really helped me re-jump into trying to learn programming . I've written three workflows now based around using this, each one building on the other and it's been super helpful.
  19. Like
    frankspin got a reaction from joshmedeski in Airmail workflow   
    Edit: 2014-05-23
     
    Added some more search context options: subject and starred. Also adjusted the triggers to keep them shorter and simplier to trigger
     
    Edit: 2013-12-23
    The 1.3 update to Airmail seems to have broke the way this workflow worked. I'll work on getting it fixed.
     
     
    I know there is a thread going on in the help portion so I figured I'd share my current Airmail workflow. Right now it has two components: new mail and unified search(Big thank you to David Ferguson for helping me with this one).
     
    Compose new mail:
    Super basic as all it does it switch to Airmail and open a new composer window.
     
    Syntax: airmail new
     
    Unified Search:
    This relies on Applescript and has two caveats: 1. you have to have unified inbox enabled and 2. if the search field is active it wont work
     
    Syntax: airmail search {query}
     
     
    At some point I plan to make the compose mail workflow more robust and utilize the Airmail Applescript support, and also expand the unified search to check if the search field is active. I'm just on limited time right now but I at least wanted to get what I have out to peope. Feel free to add or help if you want!
     
    Download: https://github.com/fspinillo/alfred-airmail
  20. Like
    frankspin got a reaction from thec13 in Airmail workflow   
    Edit: 2014-05-23
     
    Added some more search context options: subject and starred. Also adjusted the triggers to keep them shorter and simplier to trigger
     
    Edit: 2013-12-23
    The 1.3 update to Airmail seems to have broke the way this workflow worked. I'll work on getting it fixed.
     
     
    I know there is a thread going on in the help portion so I figured I'd share my current Airmail workflow. Right now it has two components: new mail and unified search(Big thank you to David Ferguson for helping me with this one).
     
    Compose new mail:
    Super basic as all it does it switch to Airmail and open a new composer window.
     
    Syntax: airmail new
     
    Unified Search:
    This relies on Applescript and has two caveats: 1. you have to have unified inbox enabled and 2. if the search field is active it wont work
     
    Syntax: airmail search {query}
     
     
    At some point I plan to make the compose mail workflow more robust and utilize the Airmail Applescript support, and also expand the unified search to check if the search field is active. I'm just on limited time right now but I at least wanted to get what I have out to peope. Feel free to add or help if you want!
     
    Download: https://github.com/fspinillo/alfred-airmail
×
×
  • Create New...