[cvs] [Wiki] changed: KlutzComicsConfiguration

Wiki Guest wikiguest at horde.org
Wed Jun 24 21:23:59 UTC 2009


guest [64.235.209.200]  Wed, 24 Jun 2009 17:23:59 -0400

Modified page: http://wiki.horde.org/KlutzComicsConfiguration
New Revision:  2.0
Change log:  Adding URL example and days setting explanation

@@ -20,8 +20,9 @@
          'author'    => 'Gary Trudeau',
          'homepage'  => 'http://www.doonesbury.com/',
          'method'    => 'direct',
          'url'       =>  
'http://images.ucomics.com/comics/db/{%Y}/db{%y%m%d}.gif',
+        'days'      => array('mon', 'thu'),
          'enabled'   => true
      ),
  </code>

@@ -43,8 +44,46 @@
  * {{search}} - Fetch the URL then search for the text matched by the  
regular expression.  The first capture group is assumed to be the next  
URL to fetch.  The last one should be the URL for the actual image.
  * {{bysize}} - Try to make a best guess at which image on a page is  
the comic based on the size of the image (after some filters are  
applied).

  The {{url}} setting is the first page that the library will use to  
start the fetch cycle.  For {{direct}} this is the image itself;  
otherwise it's just the start of the page and what's found mixed with  
other settings will direct things from there.
+
+The {{days}} setting is to specify the page apparition frequency.  
Available options are:
+* {{array('mon', 'thu')}} - It will make the comic entry appear only  
on the specified days.
+* {{random}} - It will make the comic only appear on the date where  
there was an fetched images file.

  Finally, for this simplified example, {{enabled}} is set to true.   
Rather than having to comment out large chunks of comics.php, we have  
a setting for each comic that will set it to disabled which will not  
fetch or display the comic.  It's also handy to allow us to keep older  
comics around without them showing up in the user interface.

++++ URL Example
+
+Here is a "date" example in witch the image name is related to the  
date it has appeared.
+
+<code type="php">
+'url'       => 'http://images.ucomics.com/comics/db/{%Y}/db{%y%m%d}.gif',
+</code>
+
+If, for example you fetch the comic on the June 24th of 2009, the  
{{{%y%m%d}}} would be replace by {{090624}} , the {{{%Y}}} would give  
{{2009}} to finally have a working url:
+<code  type="php">
+http://http://images.ucomics.com/comics/db/2009/db090624.gif
+</code>
+
+Some web comic use a incrementing number for they're file name like  
in this example:
+
+<code type="php">
+    'lfg' => array(
+        'name'      => 'Looking for Group',
+        'author'    => 'Ryan Sohmer and Lar deSouza',
+        'method'    => 'direct',
+        'url'       => 'http://archive.lfgcomic.com/lfg{i}.gif',
+        'icount'    => 263,
+        'idate'     => 'June 22, 2009',
+        'iformat'   => '%04d',
+        'itype'     => 'ref',
+        'days'      => array('mon', 'thu'),
+        'homepage'  => 'http://lfgcomic.com/',
+        'enabled'   => true
+    ),
+</code>

+The {{url}} setting is now using a variable directly manageable by  
those others settings {{icount, idate and iformat}}. It will increment  
(or decrement) at each day given in the {{days}} setting.
+* {{icount}} - Is the initial value from where it start incrementing  
or decrementing.
+* {{idate}} - Is the initial date from witch it start incrementing or  
decrementing.
+* {{iformat}} - Is the number of characters to keep in the variable,  
for this example 4, then : {{0263}} .



More information about the cvs mailing list