Jump to content

Comic strip viewer workflow


Recommended Posts

An experimental workflow in Python. Displays a list of comics that you can read straight off of Alfred.

comics_view.png

Download: from here  (always the latest version)

Developer side note: The experimental part comes in the form of - it is very easy to extend this workflow if you know a little bit of Python / intermediate programming skills and have a solid RSS feed of a comic you like. Add the code for the new comic in the plugins folder, and as long as it follows the method signature the sample code provided has, you have a new feedback item and comic to read.

Source Code Repo: GitHub

 

Version History

v0.1 - Initial version

v0.2 - Added search support for the list of comics. So typing "comics dilb" will just list Dilbert strip option. Searches are performed against the title and subtitle of each strip. Added a couple more comics to the list based on requests, and two courtesy Jefferson).

 

 

Have fun.

Edited by Benzi
Link to comment

This is an awesome workflow. Genius ;) 

Though, it'd be cool to make use of the quicklook functionality of Alfred. If the argument of an <item> is a url, then shift will display the quicklook of that URL. That would enable the user to see all comics without re-popping alfred everytime. What do you think?

Link to comment

This is an awesome workflow. Genius ;)

Though, it'd be cool to make use of the quicklook functionality of Alfred. If the argument of an <item> is a url, then shift will display the quicklook of that URL. That would enable the user to see all comics without re-popping alfred everytime. What do you think?

 

First of all - I love it. Great idea.

 

But I agree with Florian regarding the usage of the shift-key. When I first tried the workflow in action it seemed intuitively to me to use shift.

Link to comment

Though, it'd be cool to make use of the quicklook functionality of Alfred. If the argument of an <item> is a url, then shift will display the quicklook of that URL. That would enable the user to see all comics without re-popping alfred everytime. What do you think?

 

 

But I agree with Florian regarding the usage of the shift-key. When I first tried the workflow in action it seemed intuitively to me to use shift.

 

First off, yes, the Shift key idea is good.

Now:

Hmmm.... that is going to be a bit tricky. If I need to get the arg to be the URL of the strip, for every strip I would need to access the feeds first (before even showing the list of comics), strip out URL and populate it in the feedback items. I suppose such a naive approach would slow things down. Unless some sort of caching mechanism is introduced, so that it has to fetch the latest URLS for all comics just once per day. Bottomline, its going to take some time if I go down that route + might be slow if the internet speed is not that great, which in this day and age, happens to be true for some folks [me :-(]

 

Second, XKCD (one of my usuals) has this little thing that the real punch line of the comic is in the alt text of the image. So, if you were hovering your mouse over the comic in the website, you can read it. Can't achieve that with quick look, afaik. (For  XKCD here, I am generating an HTML on the fly and then using quick look to show that page, so...)

 

Shift idea was cool though. Will think about it more :)

Link to comment

even though I don't understand all you said (I am not that tech-savvy) – it makes sense to me, to keep it as it is. and as I said before this is a great workflow, which I will integrate in my morning routine ;)

 

thank you for creating it.

Link to comment

Great idea.  This can replace all my normal comic workflows.  Two questions:

 

1) Any chance of moving the source to github?

2) I wrote plugins for Penny Arcade and CTRL + ALT + DEL comics (here).  Any chance of getting them added?

 

Thanks!

 

Edit - Any clue why the alphabetical sorting is wrong for the Dilbert comic (here)?

Edited by Jefferson
Link to comment

Great idea.  This can replace all my normal comic workflows.  Two questions:

 

1) Any chance of moving the source to github?

2) I wrote plugins for Penny Arcade and CTRL + ALT + DEL comics (here).  Any chance of getting them added?

 

Thanks!

 

Edit - Any clue why the alphabetical sorting is wrong for the Dilbert comic (here)?

 

Just added the code to GitHub : https://github.com/BenziAhamed/comics-alfred

 

re: the Dilbert order, I think Alfred is doing a sort of the feedback items based on most used.

Link to comment

Just added the code to GitHub : https://github.com/BenziAhamed/comics-alfred

 

re: the Dilbert order, I think Alfred is doing a sort of the feedback items based on most used.

 

Thanks!

 

Ya, I think you're right about Alfred doing the sort order based on most used.

 

Edit - Also, any chance of getting Penny Arcade and CTRL + ALT+ DEL added by default?  :P

Edited by Jefferson
Link to comment

Edit - Also, any chance of getting Penny Arcade and CTRL + ALT+ DEL added by default?  :P

 

Sure added them. Also check out the latest version from the download link - v0.2 has filtering support. And if you really want it, you can assign a hotkey to a particular strip too.

 

PS: I think I had to slightly modify the CTRL one because the version you gave me wasn't working for me straight off for some reason.

Edited by Benzi
Link to comment

Hi Benzi,

 

Just discovered this workflow and I love it! 

 

BUT... (there's always a "but"...) would it be possible to add a setting for display size or resolution?  I'm on a 15" Retina MacBook Pro and the comics display too small to comfortably read without sticking my nose on the screen :)

 

I don't know a thing about coding, but perhaps a sticky "x2" "x4" display size setting would be something you'd consider?

 

Anyway, love you work :)

 

Cheers,

 

Anthony.

Link to comment
  • 2 weeks later...

Hello Benzi,

 

Having trouble with seeing these as well as Anthony. I've been playing around with your Dilbert workflow and have managed to modify this to display in Preview using AppleScript to resize and position the window. I would like to do this with Comics workflow as well, but need the full path name of the comic strip file as an output from your /bin/bash Run Script to feed into my osascript. As a complete newcomer to Alfred, Python, et al, I'm a bit stuck on how to do this. Could you give me any pointers?

 

Thanks for all your work on this and your other workflows.

Link to comment

Hello Benzi,

 

Having trouble with seeing these as well as Anthony. I've been playing around with your Dilbert workflow and have managed to modify this to display in Preview using AppleScript to resize and position the window. I would like to do this with Comics workflow as well, but need the full path name of the comic strip file as an output from your /bin/bash Run Script to feed into my osascript. As a complete newcomer to Alfred, Python, et al, I'm a bit stuck on how to do this. Could you give me any pointers?

 

Thanks for all your work on this and your other workflows.

 

Hello, if you are comfortable navigating around the workflow's folder, here goes:

 

In the main workflow folder, there is a plugins folder which hosts all the comics extension. Each comic extension is responsible for displaying its strip - so the path of the strip can be easily got. Example, this workflow also has a Dilbert plugin, and if you have had a chance to look at that, if would behave very similar to my other Dilbert extension, except that the code is inside the plugins folder.

 

The run() method in main.py (inside each plugin folder) is where you would be able to get the full path name of the comic strip. The strip is downloaded locally to the workflow folder, and is usually called strip.png / strip.gif. In Python you need to call methods like os.path.join and os.path.basename etc to get the full path, and then you need to run a AppleScript script from within Python. (I am fairly new to Python as a language myself, so I find the StackOverflow site very helpful to get code snippets and hints on how to get some simple stuff done)   

 

If all this is a bit too much to follow already, if you can share your AppleScript code for opening files in Preview, I could have look and give you something more concrete...

Link to comment

Hello Benzi,

 

I've been looking there and playing around with adding "return", but nothing seemed to work. Here is  a link to my take on your Dilbert workflow which contains the code:-

 

https://dl.dropbox.com/u/100324951/Dilbert.alfredworkflow

 

Preview has to have AppleScript enabled as shown in the link in the readme. Make sure you have a backup of Preview first as I managed to screw mine up at the first attempt when I followed some older instructions, but the instructions on the link work, at least for Mountain Lion.

 

I'm having some other problems when I try to split the Run script into 2 separate scripts for bash and osascript, but I'm going to ask about that in the help forum.

 

If you're fairly new to Python I'm very impressed. Have to spend more tome looking at StackOverflow. Thanks for the tip.

Link to comment

Hello Benzi,

 

I've been looking there and playing around with adding "return", but nothing seemed to work. Here is  a link to my take on your Dilbert workflow which contains the code:-

 

https://dl.dropbox.com/u/100324951/Dilbert.alfredworkflow

 

Preview has to have AppleScript enabled as shown in the link in the readme. Make sure you have a backup of Preview first as I managed to screw mine up at the first attempt when I followed some older instructions, but the instructions on the link work, at least for Mountain Lion.

 

I'm having some other problems when I try to split the Run script into 2 separate scripts for bash and osascript, but I'm going to ask about that in the help forum.

 

If you're fairly new to Python I'm very impressed. Have to spend more tome looking at StackOverflow. Thanks for the tip.

 

Managed to get it working for Dilbert now with the comics workflow - here is a modified version (only contains Dilbert comic for testing) that opens the strip in Preview. This is more of an example of what changes needs to be done to other comics plugins if you want to use Preview throughout. The code change is to download the strip and then print the path of the strip. In the applescript section, I changed the shell script command. Should be straightforward to follow once you open up main.py.

 

Keyword is comics2 and should only list Dilbert as an option.

 

To get all comics to work like this, we need to update the plugins to print out the path to the downloaded strip. (One heck of a hurdle to get Preview apple scriptable - too bad, else this approach could have made for a nice workflow update :))

 

EDIT - just read the post after this, just realized if you double tap on the image from the original workflow, it will open up in Preview....

Edited by Benzi
Link to comment

Hi Benzi,

 

Just discovered this workflow and I love it! 

 

BUT... (there's always a "but"...) would it be possible to add a setting for display size or resolution?  I'm on a 15" Retina MacBook Pro and the comics display too small to comfortably read without sticking my nose on the screen :)

 

I don't know a thing about coding, but perhaps a sticky "x2" "x4" display size setting would be something you'd consider?

 

Anyway, love you work :)

 

Cheers,

 

Anthony.

 

It is a bit of a hurdle to get this done easily (previous couple of posts in the thread, I have been helping out someone who wants to get this to open up in Preview).

 

I can't control the quality of the strips image, but one option you could try is as follows: when comics displays the strip of a comic, double tap on the image, and it should open up automatically in Preview - from there, you can zoom in and read the strip. A bit of a hassle, but the only workable approach at the moment I'm afraid... Will keep looking for a better solution though.

 

Hope this helps...

Link to comment

Hello Benzi,

 

That was very quick. I spent a few hours getting nowhere. I've tried them all now and all work, except for xkcd which Preview doesn't want to display so I've left it as is.

 

Keep learning new things by doing this; didn't know that double-clicking on the qlmanage image opened up in preview as well. I started out by changing the qlmanage -p option to -t to display a thumbnail with the -s and -f switches, which changed the size but wasn't happy. Don't know if using the -t switch has any side effects yet, couldn't find much about it.

 

Thanks again

Link to comment
  • 2 weeks later...
  • 2 weeks later...

Hello, when I saw this workflow, I thought of an article in The Economist a few months ago:

Cartoons: Triumph of the nerds

http://www.economist.com/news/christmas-specials/21568586-internet-has-unleashed-burst-cartooning-creativity-triumph-nerds

 

It mentions several of the "modern, nerdy" comic strips already referenced in your workflow.

I thought I would suggest a few more from the article. Here are the names and RSS from their sites:

 

Bear Nuts
http://www.bearnutscomic.com/
http://www.bearnutscomic.com/feed/

Garfield Minus Garfield
http://garfieldminusgarfield.net/
http://garfieldminusgarfield.net/rss

Dinosaur Comics
http://www.qwantz.com/index.php
http://www.rsspect.com/rss/qwantz.xml

Hark a Vagrant
http://harkavagrant.com
http://www.rsspect.com/rss/vagrant.xml

Megatokyo
http://www.megatokyo.com/
http://megatokyo.com/rss/megatokyo.xml

The Oatmeal
http://theoatmeal.com/comics
http://feeds.feedburner.com/oatmealfeed?format=xml

 

 

P.S. I like your Rotten Tomatoes flow too.

Link to comment

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...