Overview

Packages

  • Horde
    • Block
  • Klutz
  • None

Classes

  • Klutz
  • Klutz_Comic
  • Klutz_Comic_Bysize
  • Klutz_Comic_Direct
  • Klutz_Comic_Search
  • Klutz_Driver
  • Klutz_Driver_File
  • Klutz_Driver_Sql
  • Klutz_Image
  • Overview
  • Package
  • Class
  • Tree

Class Klutz_Comic_Bysize

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.

Klutz_Comic
Extended by Klutz_Comic_Bysize
Package: Klutz
Author: Marcus I. Ryan marcus@riboflavin.net
Located at Comic/Bysize.php
Methods summary
public
# 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.

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.

Parameters

$comic
Index for the comic
public string
# fetchURL( timestamp $date = null )

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.

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.

Parameters

$date
Date of the comic to retrieve (default today)

Returns

string
URL of the comic image
public mixed &
# fetchImage( timestamp $date = null )

Fetch the actual image

Fetch the actual image

Parameters

$date
<p>The date to retrieve the comic for (default today).</p>

Returns

mixed
Klutz_Image on success, false otherwise.
public array
# _stripimages( string $document )

Strip the list of images from the contents of a web page. Derived from Snoopy's striplinks function.

Strip the list of images from the contents of a web page. Derived from Snoopy's striplinks function.

Parameters

$document
The HTML document to parse.

Returns

array
List of images in the page.
public array
# _expandurls( array $urls, string $base )

Expand paths to fully-qualified URLs

Expand paths to fully-qualified URLs

Parameters

$urls
Paths to expand
$base
The base URL used for relative links

Returns

array
Fully-qualified URLs
public boolean
# _ignore( string $string )

Determine if the passed image name is on the list of images to ignore.

Determine if the passed image name is on the list of images to ignore.

Parameters

$string
The name to check

Returns

boolean
True if we should ignore it
public array
# _getsizes( array $images, boolean $filter = true, timestamp $date = null )

Get the dimensions from the list of images passed in.

Get the dimensions from the list of images passed in.

Parameters

$images
The list of images to check.
$filter
Filter by size, etc? (true).
$date
Date to use for filter prefs.

Returns

array
Dimensions for all desired images.
Methods inherited from Klutz_Comic
Klutz_Comic(), _initHTTP(), _prepareSearch(), getInstance(), getInstance_monthly(), getInstance_ref(), getInstance_weekly(), getInstance_yearly(), getOverride(), substitute()
Properties summary
public array $search

Once set, an array of preg searches to perform to find the comic image

Once set, an array of preg searches to perform to find the comic image

# null
public array $ignore

A list of images to ignore (preg matches)

A list of images to ignore (preg matches)

# array()
public integer $minheight

What is the smallest height to consider

What is the smallest height to consider

# 0
public integer $minwidth

What are the smallest width to consider

What are the smallest width to consider

# 0
public integer $maxheight

What is the largest height to consider

What is the largest height to consider

# 65536
public integer $maxwidth

What is the largest width to consider

What is the largest width to consider

# 65536
public string $choose

How should we decide which image to take? Options are "first", "biggest", and "smallest".

How should we decide which image to take? Options are "first", "biggest", and "smallest".

Param

string
# 'biggest'
Properties inherited from Klutz_Comic
$agent, $author, $comment, $cookies, $days, $headers, $homepage, $http, $icount, $idate, $iformat, $isow, $itype, $name, $nohistory, $offset, $override, $pass, $referer, $subs, $url, $user
API documentation generated by ApiGen