Page 1 of 2

Catch-Up Support

Posted: Wed Feb 02, 2011 8:05 pm
by Roamer
Is there any easy way to differentiate those comics that support Catch-Up from those that do not? Having to select each comic in the list, click on the Comics menu, and then the Catch-Up menu item is quite cumbersome. I tried looking at the comic definitions in the Comics.xml file, but did not see a attribute/property that indicated Catch-Up was supported.

-Jeff

Re: Catch-Up Support

Posted: Sat Feb 05, 2011 6:02 pm
by BootBlock
Hi Jeff,
not currently, unfortunately.

Although those that do have archive support have the PreviousRedirectUrl and NextRedirectUrl attributes which you can search for.

I'm currently deciding on what I'm going to do with the Archive support (as it's a bit broken at the moment) before I add further features such as an Archive indicator.

Re: Catch-Up Support

Posted: Sat Feb 05, 2011 7:45 pm
by Roamer
Okay. Thanks for the tip regarding the previous/next redirect URL; it gives me something to go on! :)

Re: Catch-Up Support

Posted: Sun Feb 06, 2011 4:05 am
by ogma
I'm currently trying to add Catch-up to some of the comics in my ComicsUser.xml. I am using the entry already provided from Penny-Arcade ==>

Code: Select all

<Definition Name="Penny Arcade" PublisherUrl="http://penny-arcade.com/" LatestComicUrl="http://penny-arcade.com/comic" Rating="Everyone" PreviousRedirectUrl="/comic/\d{4}/\d+/\d+/$" PreviousRedirectUrlIndex="1" NextRedirectUrl="/comic/\d{4}/\d+/\d+/$" NextRedirectUrlIndex="2" ComicImage="(/(photos|images/\d{4})/.+\.(gif|jpg|png|bmp)$|http://cdn.shopify.com/.*)" Data="*" />
The attribute of PreviousRedirectUrlIndex is labeled as 1. Does the parser with regex start at index of 1 or 0? I'm not that familiar with the regex system but I have added a few of my comics that I read that are not currently built in. I'm just trying to understand how the Catch-up works so I can implement it on the rest of my comics.

Any help is much appreciated.

Re: Catch-Up Support

Posted: Sun Feb 06, 2011 11:16 am
by BootBlock
The attributes that end with Index aren't really related to the Regex engine, per sé.

When you specify a regex for, for example, NextRedirectUrl, Comica will parse out a list of all of the links on a page and place each one in an array. So if there are multiple links on a page, Comica will internally store them as:
The NextRedirectUrlIndex attribute (which is the *Index counterpart of NextRedirectUrl) tells Comica which of those URLs you actually want from within the array. So specifying 2 will choose the http://www.comicsite.com/comic.php?id=293 item, which in this example is the URL of the latest comic page.

All attributes that end in Index work in this way.

Re: Catch-Up Support

Posted: Mon Mar 14, 2011 7:08 am
by Shadewing
Hi BootBlock.

3 questions.

1. Are the Previous/NextRedirectUrl attributes related to the PublisherUrl attribute? i.e. RedirectUrl gets stuck on the end of the PublisherUrl.

2. Is there an easy way to figure out what the index number of a given link is?

3. Can you recomend a guide to the regular expresions used by Comica? I have a passing knoledge of regex but not enough to code Comica definitions.

Thanks,

Shadewing

Re: Catch-Up Support

Posted: Mon Mar 14, 2011 9:43 am
by BootBlock
Hey Shadewing,
1. Are the Previous/NextRedirectUrl attributes related to the PublisherUrl attribute? i.e. RedirectUrl gets stuck on the end of the PublisherUrl.
Comica looks at the page/site specified by the LatestComicUrl attribute and then performs a search using Previous/NextRedirectUrl within that returned page.
2. Is there an easy way to figure out what the index number of a given link is?
While it needs re-designing, you can use the Developer's Log within Comica for this. Press Ctrl+L to open the log and then click on the Developers tab at the top of the newly-opened window.

If you then try downloading a comic, you'll get a dump of information on the process. Each entry on the top-right of the window will have a number in square brackets prefixing it to show you its index.

In your specific case, you're interested in looking at the RedirectUrls item that's in list on the left of the window.
3. Can you recomend a guide to the regular expresions used by Comica? I have a passing knoledge of regex but not enough to code Comica definitions.
I used these two sites to help at the beginning:

Regular Expressions Guide: Regular-Expressions.info
Regular Expressions Testing: RegExPal.com

Recently though I've been using the Comica Editor (as yet unfinished/unreleased) as it makes the process much easier/quicker. It should be released with Comica v1.12.

There is something I should mention here...

Yesterday I greatly simplified the regex for almost all the comics in the database. While they're still regex as normal, they now are simple "contains" expressions. For example, most entries used to test for a file extension or a specific path, similar to this:

Code: Select all

/comics/\d{4}\-\d{2}\-\d{2}/thecomic.+\.(jpg|png|gif)$
But now I've changed them to be like this:

Code: Select all

/comics/
The reason being, most sites only place actual comic images within the comics/ directory, so it seemed pointless using a more complex expression (that tests for a date, etc) when just a simple directory match would work. This has the added bonus of being more flexible; comic authors can rename comics, etc, and it should work as they'll most likely keep the comic within its comics/ directory.

I've simplified almost all comic definitions down to this style. No regex unless required (to reduce multiple/false matches). They're essentially "does this Url contain this string; if so, matched".

* Of course not all comics use "/comics/" - this is just an example of a site that does. Others might use "/uploads/strips/", etc.

Re: Catch-Up Support

Posted: Mon Mar 14, 2011 11:39 am
by Shadewing
Thanks BootBlock.

This should be real helpful, I might wait for the editor to come out but free time at work needs filling somehow.

Oh, in regards to changing regex to

Code: Select all

/comics/
I've found one site that this doesn't work on, Applegeeks. It returns

Code: Select all

comics/issue575thumb.gif
instead of

Code: Select all

comics/issue576.jpg
I havent looked at why yet but I think the thumb image comes before the issue image in the page.

Shadewing

Re: Catch-Up Support

Posted: Tue Mar 15, 2011 8:35 pm
by BootBlock
I havent looked at why yet but I think the thumb image comes before the issue image in the page.
Yep, that was the problem. It can be solved using regex to ignore anything with thumb in it. Except I've forgotten how to do that; I thought it was (!?thumb) but it didn't appear to work.

Instead, I put thumb in the IgnoreImages attribute for the time being.

Re: Catch-Up Support

Posted: Mon Jul 18, 2011 1:25 pm
by noober
I was playing around with the "Previous/NextRedirectUrl" to see if I could get it working on Gocomics...

Code: Select all

<Definition Name="Agnes" LatestComicUrl="http://www.gocomics.com/agnes/" ComicImage="cdn.svcs.+width" PreviousRedirectUrl="/\d{4}/\d{2}/\d{2}$" PreviousRedirectUrlIndex="1" NextRedirectUrl="/\d{4}/\d{2}/\d{2}$" NextRedirectUrlIndex="2"/>
This seems to work. Only problem is, with the current comic, there's no link for "Next".
I guess this construct would do OK with the other Gocomics offerings.

Looking at the html, I thought maybe you could also check for other things than the URL.

Code: Select all

<li><a href="/agnes/2011/07/16" class="prev">Previous feature</a></li>
<li><a href="/agnes/2011/07/18" class="next">Next feature</a></li>
<li><a href="/agnes/2011/07/18" class="newest">Current</a></li>
It might be easier to look for a link with a "class" of "prev", or just for a link with the words "Previous feature"...