$name
$name : string
The title of the comics (Dilbert, The 5th Wave, etc.)
Klutz_Comic_Bysize Class.
This class uses follows the search methodology until it hits the final page in the list. On this page it gets a list of all images and tries to figure out which image is most likely to be the comic based on image sizes. This is the LEAST efficient driver and you're discouraged from using it when not absolutely necessary.
getOverride(string $setting, \timestamp $date = null, string $array_map = null) : mixed
Check for "override" settings - settings that override other settings depending on the day on which the comic appears
string | $setting | The name of the setting to override |
\timestamp | $date | The date to check for overrides |
string | $array_map | Filter to be used with array_map |
If the setting is an array, returns the setting passed through array_map if array_map was passed. Otherwise, returns the value of the setting, overridden if an override is present
substitute(string $string, \timestamp $date = null) : string
Process known substitutions in a string. Currently known options:<br /> o {dow(int day, string format)} day is numeric day of the week, format format is an strftime string (e.g. '%Y%m%d'), replaced with the formatted date for the requested day of the week o {i} replaced with the instance of this comic as determined by the various instance configuration options<br /> o {format} format is an strftime string, replaced with todays date formatted according to the format string<br /> o {lc(string)} replaces string with string lowercased<br /> o {uc(string)} replaces string with string uppercased<br /> o {t(string)} removes extra space surrounding string<br /> o {tl0(string)} removes leading zeroes from string
string | $string | String to process |
\timestamp | $date | Date to use when processing subs |
A string with all substitutions made
getInstance_ref(\timestamp $date) : integer
Get an instance number for a comic based on a date reference.
This takes the idate option as a reference date, then uses the 'days' setting to determine how often it appears. Using this information it extrapolates which instance will occur on the date requested.
\timestamp | $date | The date the comic appears |
The instance number (unformatted)
Klutz_Comic_bysize(string $comic)
Constructor - Create an object that can be used to retrieve a comic by looking at all images on a page, a list of images to ignore, and a range of dimensions, then choose which image is most likely the comic.
string | $comic | Index for the comic |
fetchURL(\timestamp $date = null) : string
Do all that is necessary to get the final URL from which the comic will be fetched. Instead of returning the comic, return the URL pointing to that comic.
\timestamp | $date | Date of the comic to retrieve (default today) |
URL of the comic image
_getsizes(array $images, boolean $filter = true, \timestamp $date = null) : array
Get the dimensions from the list of images passed in.
array | $images | The list of images to check. |
boolean | $filter | Filter by size, etc? (true). |
\timestamp | $date | Date to use for filter prefs. |
Dimensions for all desired images.