AndroidApps

Create a webcomic fetcher in Tasker

comics - for some reason we don't have an alt tag here

I like the webcomics, but in later years it’s become more of a thing I do once in a while than something I follow daily. That often results in massive backlogs of comics when I do decide to read up, and I’ve yet to see a good mobile solution for viewing webcomics. Some have their own apps, but most of the time you’re left navigation a made-for-desktop site on you phone.

That is why I decided to create a comic fetcher in Tasker a little over a month back. I’ve almost forgotten about it since I first created it, and the only evidence of its existence is the Comics folder inside the Pictures folder in my Dropbox, which is now suddenly a lot less empty than it used to be. The creation has been fetching various comics for me for over a month, resulting in folders full of image files I can easily read on whatever device I choose. 

Creating such a setup is really simple, and uses the same principles as are explained in part 4 of my beginner’s guide to Tasker. You need find a way to grab the most recent image from the webcomic you want to fetch, and that can be done in various ways, depending on the webcomic. Often, the latest comic is always on the launch page. In that case, you can use the launch page as the source for your HTTP Get, and load the entire source into a variable. You then start splitting to isolate the URL to the image itself. The image is normally inside some piece of code that doesn’t change, which you can use to Variable Split your way to victory.

Once you have a variable with a direct URL to the image, do another HTTP get with that URL. You want to specify a dynamic file path, for instance one that uses %DATE. That saves the image with a file name that makes it unique and easily identifiable. For instance, I save all Pondus strips as pondus-%date.jpg.

You should save each comic to a a separate folder for that series, nested inside a master comic folder. You can then set up syncing to Dropbox using Dropsync or a similar app, and get all your comics automatically fetched, sorted, named, and synced.

tasker comic fetcher - for some reason we don't have an alt tag here

In my case, I collect a few different Norwegian web comics. They’re all available on the same page, here. Each comic is nested inside the code in the same way, just with identifiers based on the name. I therefore just keep a text file with the identifiers as a comma separated list, and use that to control a For loop which splits out each comic using the same series of splits. A single For loop then handles all the comics, rather than having to copy/past everything multiple times. Other than that little tweak, it’s essentially just Variable Split, Variable Split, Variable Split, HTTP Get. 11 actions is all that’s needed to fetch all my comics, and four of those are just there to turn the DD-MM-YYYY-formatted %DATE into a YYYY-MM-DD-formatted %date, and in doing so, make the comics sortable alphabetically by name.

Naturally you need to tie the task to a profile to make it run regularly. Mine runs on its own schedule once a day, but you can tie it to something else, like coming home or a wake up profile. It’s easy to set up (if you know Tasker), and makes sure that when you want to read up on webcomics, you can. Just remember that these comics make their money off advertising, so support them in another way if you do this. For me though, I either do it this way, or not at all.

Pocketables does not accept targeted advertising, phony guest posts, paid reviews, etc. Help us keep this way with support on Patreon!
Become a patron at Patreon!

Andreas Ødegård

Andreas Ødegård is more interested in aftermarket (and user created) software and hardware than chasing the latest gadgets. His day job as a teacher keeps him interested in education tech and takes up most of his time.

Avatar of Andreas Ødegård

6 thoughts on “Create a webcomic fetcher in Tasker

  • First a thank you, I stumbled across this pages yesterday and found a few interesting things for me :)

    Some questions(not all are topic related, sry):
    a) have you considered using (f.e.) Python for Android? All this variable splitting seems to be overkill for me, espacially in your video example with the Liverpool news fetching.

    b) I like your synching approach for status.txt etc, but I personally don’t like using Clouds for that. I’d much rather use my own server for this, so I’d need a tool to sync a file via (s)ftp from tasker without popping up the app, can you recommend any?

    c) I could try that my self for sure, but maybe you know the answer and can spare me some time digging:
    I’m practically blind without my glasses and my phone (Xperia S/CM10) is in a charging cradle at night. Is it possible to activate the proximity sensor in the darkness while the display is off and have it notice motion? So I could just wave my hand in front of the device and it would light up so I can find it more easily?

    d) I tried replicating the “turn lockscreen off while at home”, but it doesn’t work reliably. I let it scan for ~20m, walking around and leaving it for a few minutes in the places I sit in most often. It found ~10 towers. But most times it fails to work, both using Tasker’s internal method and using Secure Settings – nothing wrong with the task setup itself, binding it to WiFi connection works, but I don’t want WiFi to be on constantly.

    e) Regarding AutoRemote, as I see it, there’s only a client for Windows, but I’m a Linux-guy. Now I could write to a machine using SSH and inotify, but are there better ways?

    f) Any way to use Google’s offline voice dictation?

    On a side note, I built on your Nelly idea, making my wife an interactive cookbook. Recipes are stored in markdown markup, sections are splitted by title which contains a number of minutes. So the voice reads out the steps to do, waits the number of minutes and then asks if all is done, before it continues. If the answer by voice is yes, it continues, else it waits a minute.

    Thanks for the inspiration and sorry if that’s too much here.

    Reply
    • Avatar of Andreas Ødegård

      a) I don’t know any real programming languages, and would rather stick to what I know. It might look like overkill to set up, but speed wise I have no complaints.

      b) There’s some rudimentary system for sending files to a server in Tasker, assuming you can login using user and pw in the name.

      c) I’m practically blind without contacts too (-7.5 and -8). The location of my cradle has become muscle memory to me, so I haven’t looked much into this. Not sure if it’s possible to override the proximity sensor power saving feature like that. Another solution is to buy a tritium vial – a kind of radioactive (but harmless) material used in watch dials etc. It’s self luminescent, so it always glows. There are people on candlepowerforums that sell them for flashlight use. You essentially glue a decent size vial to your stand and it will always glow faintly

      d) I never turn off wifi. I charge my phone every night, and always have half the charge left no matter what I do, so this isn’t something I’ve ever looked into.

      e) The autoremote developer has a subforum in our forum. If you just hit the forum link at the top you can go there and ask him :) he’s always extremely willing to help

      f) not that I know of. Had this question a lot, but since I’m always connected, I’ve never looked into it.

      Side note:
      I really, really like that idea! If you want I could feature it as a user creation in an article, drop me en email at andreas (at) pocketables.com if you’re interested

      Reply
      • a) given that Python has really a lot of modules, I think much of the stuff could be way easier, espacially RegEx-matching/filtering could be a reuable one-liner instead of that tedious variable splitting. Haven’t tried it myself, yet, but I’ll surely look into that.

        b) thanks, will look for/into that.

        c) problem is, I can’t sleep if there’s any visible light in my eyes’ path and I sleep very light, so the simplest sounds are waking me up and so does f.e. the charging light. On the other hand, I could set up a listener recording all night, since it’s charging anyway and react to something like “turn on”, but for that, I’d prefer the local voice recognition to be working.

        e) I’ll think about that, thanks, though I try to avoid adding more and more forums to my watchlist since that takes a looot of time for me.

        f) there is this thread, but I didn’t try it, yet:
        https://groups.google.com/forum/?fromgroups=#!topic/tasker/fuJmnIpUfDE

        As for the recipe-idea, depends on what you’re wanting to do?! You’re free to replicate it in an article, but I can’t currently help you out writing it or showing the code since it’s currently a bloddy mess(working, though).

        It works something like this:
        – a “db”-file holds the recipes as in:
        “recipe title => path+filename”, each entry on a single line
        – recipes are marked up in markdown, having a title and then a few sections headed by “## section title (X)” where X is the number of minutes

        The “db” gets read, splitted for title at “=>” and presents it in a menu. On selection, the recipe is read based on the filename.

        Then the single sections are split out, as are the minutes.

        The section gets read, pausing for a few seconds after each entry (f.e. Ingredients: pepper, pause, salt, pause, …)

        The task waits for the X minutes, then asks “are you done”. It reacts like this:
        on “yes” -> next section
        on “no” -> wait 1 minute, then start the asking again.
        on “repeat” -> the whole section gets repeated

        What I’m trying to figure out how to do:
        “wait” -> pause the process complety, show a box with a button to return where you left of(f.e. when there’s somebody on the door).

        Add some formatting to the recipe which when encountered offer to start a timer, f.e. “now that stuff needs to go in the oven for 60 minutes, should I set a timer?” and react on it.


        That should be enough to replicate it for yourself/the site.

        I’ll try to setup some tasker related posts in the next few days, if you’d like to reach me, use “avx // phorcix // org” (// meaning @ and . of course).

        Reply
        • Avatar of Andreas Ødegård

          Thanks!

          For pausing the system, hmm, off the top of my head, you could have the task save its “position” (simply setting a global variable that contains the number of the current action) every now and then. Start off the entire task with a Goto action for that variable, but make it IF condition dependent, so you can externally control it. This particular trick may or may not depending on how the task is set up.

          Reply
        • Avatar of Hussain

          For using AutoRemote on Linux, you could use ‘curl’?

          Reply
  • Do you have a step by step, or download of this I could use as a start for my own comic fetcher?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *