Jump to content

Workflow Updater alpha


Recommended Posts

Posted

Hi all

 

Here's an idea for a Workflow Updater. Developers simply need to include a file called update_url in their workflow folders. In this file put the URL to the latest version of their workflow. If the remote file is newer than the local file the workflow will be listed to update. Alternatively use keyword 'update force' to list all workflows regardless of whether they are newer or not.

 

th_workflowUpdater

 

This is more of a proof of concept than a working product. I would like some feedback from you guys (especially David Ferguson since he made an updater for v1) as to whether the update_url file seems reasonable.

 

I have plans to extend this into an apt-like installer / package management tool.

 

If you would like to test how this works install any/all of these workflows I have setup to use this system, or include a updater_url file in your own workflows:

 

th_sshList

th_windowManager

th_filetypeSearch

 

I look forward to your thoughts.

 

Tom

Posted

Nice proof of concept! You might want to look at using the workflow's bundle id (set in the same panel as setting the name) as this is designed for uniquely identifying workflows for things like upgrades. This allows other things to change such as the name.

Posted

I've actually wanted to do something similar for a while but to implement what I wanted is a huge task. I wanted to make a site that would allow users to login, submit their workflows, people could comment or rate them, etc. Then, also, provide an api for searching it and checking for updates. This would obviously still require the update_url file that you are referring to. Then with the api, in Alfred be able to search using 'ws' (workflow search) or something similar and provide feedback into Alfred. With that, just as you are describing, people would have a central place where they could find extensions (online or via Alfred). They could install them from Alfred without having to go anywhere else.

 

I have loved the thought of this for a while but it's a big job to do alone especially with all the other stuff I have going on lately. 

Posted
I've actually wanted to do something similar for a while but to implement what I wanted is a huge task. I wanted to make a site that would allow users to login, submit their workflows, people could comment or rate them, etc. Then, also, provide an api for searching it and checking for updates. This would obviously still require the update_url file that you are referring to. Then with the api, in Alfred be able to search using 'ws' (workflow search) or something similar and provide feedback into Alfred. With that, just as you are describing, people would have a central place where they could find extensions (online or via Alfred). They could install them from Alfred without having to go anywhere else.

 

I have loved the thought of this for a while but it's a big job to do alone especially with all the other stuff I have going on lately. 

Well, I've got to prepare for a Citrix exam later this week so I'll be AWOL for a while, but after that I'll have more time to dedicate to Alfred and other projects. So having said that, and taking into account that my php is rusty, no to say it sucks, I'd be happy to help where possible.

Posted

Ratings, per-user logins etc. is definitely a big project. Starting small and having an update system is better than nothing though I think.

 

Off the top of my head a simple way to submit new workflows could be to have an ftp site that developers could drop their workflows into. An incrontab (on linux - osx folder actions don't work as reliably I've found ) could then process these files - add them to a database/text file/whatever. This could be queried by a server-side script that would return the xml.

 

I've got a couple of days of downtime at work which I'll use to progress this. 

Posted

Hey guys, I'll be away from the Mac for a few days so I can't look into this myself, but here's a quick thought/question. Currently, when importing a workflow, Alfred generates some random numbered folder, if however it would generate a folder base on the workflow name, this could be done which great ease using git.

Just include and action in the workflow to issue a git update and pull anything that had change, no need to download the whole workflow again. Feasible? Totally absurd? Let me know.

Posted
Hey guys, I'll be away from the Mac for a few days so I can't look into this myself, but here's a quick thought/question. Currently, when importing a workflow, Alfred generates some random numbered folder, if however it would generate a folder base on the workflow name, this could be done which great ease using git. Just include and action in the workflow to issue a git update and pull anything that had change, no need to download the whole workflow again. Feasible? Totally absurd? Let me know.

 

I was actually thinking something like this too. I don't think that the directories need to be named something specific. Each directory is just initialized with a git repository. Then it's easy to see if there are any updates and pull those. You can even just do a completely new checkout or in any other way force the update to overwrite everything. Of course, developers would have to put configurations in a config file then but that's best practice any way  :)

 

This also solves the problem of storing and managing all available workflows. They could simply sit in a repository on GitHub. This is also discussed here. New workflows are then added with a pull request. Easy peasy.

Posted

I can't confirm the naming of the folders issue as I haven't tried it but.. yeah, github COULD potentially do some of this stuff but that requires that every use have git installed and things like that. It could work as a stop-gap but not near as elegant of a solution as what tomhunt and I are discussing. The reason I say this is, yes, you could stick stuff on github and make it read a file there and such. I did that in v1. The major difference here that it seems like both tomhunt and I are searching for is a central location that would manage them all so it could be searched, pull updates, rate stuff etc. His solution is smaller initially but it would be amazing if we could pull something together that is similar to the overall goal I mentioned above. I'd really be interested to see if we could get a group of guys with some design, web experience and get something like this created. This could be the "Unofficial Alfredapp Workflow/Extension Store". Imagine how awesome it would be to be able to enter a keyword to fire a script filter and search the site and get back a list of matching workflows, press enter, and that be installed on your machine. Want simons youtube workflow, enter 'ws youtube' and it shows in a list of youtube related workflows, <enter>, its installed.

Posted

Yeah, makes sense. Workflow should/could be bundled with the initial install so as to facilitate things for new users.

  • 'ws top' - Top ten rated workflows;
  • 'ws new' - the x newest entries
  • 'ws update' - shows a list of installed workflows that have updates available, some way to display in Alfred, Growl etc what's new would also be cool, then hit enter to update selected workflow
  • 'ws update all' - updates all available
  • Similar to what I said above, would be cool to have some sort of short indication about what each workflow does, user ratings etc, without having to go to the website.

Yeah, I like this idea. Not the best web dev out there but good for grunt work so I'm volunteering as of now to help out (beta testing what have you)

 

Cheers,

PL

Posted

Using a git repo could be a good goal for the future, but personally I think it could be a bit of overkill in these early stages.

AlfPT (Alfred Package Tool)

I've implemented a simple system on my server. Download this workflow to test it:

http://alfredrepo.tom-hunt.co.uk/wf/th_alfpt.alfredworkflow


Go to http://alfredrepo.tom-hunt.co.uk to upload your workflows. Make sure they have bundle id assigned!

Once you've uploaded your workflow you can search for it using alfpt install. To update already installed workflows use alfpt update / alfpt update -f. Currently it is assumed that you've installed your workflows entirely using alfpt which is obviously not acceptable, but it shouldn't be too hard to test whether a workflow is available in the repo before listing it for update.

I'm sure this is completely bug-ridden at the moment (I'm rushing through this as fast as possible while I've got the time). Please upload a workflow (even just a test one at the moment) and let's see how this performs.

Next steps:

Verify if a workflow is available in the repo for update
Use the icon.png from each uploaded workflow
Search terms (it currently just lists everything)



Tom

Posted

Managed to upload a quick workflow I'm using (ported from Alfred v1). Another workflow I tried to import was met with:

 

 

 

There is an 80000b filesize limit. Your file is 593728
Posted

What does the workflow involve? Are there lots of images? My workflows top out at around 60k so I added a bit to make the 80k limit. A 0.5mb workflow seems large to me. Either way I've upped the limit to 1mb for the time being. Give it another shot :)

Posted

Another update. Super-agile development here  :P Same URL as above, or update via AlfPT.

 

Verify if a workflow is available in the repo for update [DONE]
Use the icon.png from each uploaded workflow
Search terms (it currently just lists everything) [DONE]

 

I'm not sure how to download the icon.png's of each uploaded workflow to the users machine though. OSX doesn't come with wget by default (even using wget I could not get anything sensible). Here's what I am using:

 

 

wget -r -A png "alfredrepo.tom-hunt.co.uk/icons/"

Before listing the available of workflows I was going to cache any new icons. If anyone would like to have a bash at this please have a hack around. Or if anyone has any ideas of how to go about this please let me know: Pedro Lobo maybe your App Store icon cache code could be applicable but I think you wrote that in python?

Posted

Hey Tom,

 

Two things.

 

1. The workflow I was trying to update had a DB for cache that I totally forgot about, hence the inflated size;

2. Yeah, I wrote the App Store Icon cache in python, but it easily feasible to get it to just download the app icon I think.

Posted

the upload appears to work, but something is busted with the DB.

 

Warning: require_once(/var/www/alfredrepo/Classes/Db_connect.php) [function.require-once0]: failed to open stream: No such file or directory in /var/www/alfredrepo/repo/index.php on line 4

Fatal error: require_once() [function.require0]: Failed opening required '/var/www/alfredrepo/Classes/Db_connect.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/alfredrepo/repo/index.php on line 4

 

This is a great idea.  Keep up the good work and let me know if you need a feature tested  :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...