Class Klutz_Comic_bysize

Description

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.

$Horde: klutz/lib/Comic/bysize.php,v 1.29 2005/11/19 02:50:15 chuck Exp $

Located in /lib/Comic/bysize.php (line 16)

Klutz_Comic
   |
   --Klutz_Comic_bysize
Variable Summary
 mixed $choose
 array $ignore
 integer $maxheight
 integer $maxwidth
 integer $minheight
 integer $minwidth
 array $search
Method Summary
 Klutz_Comic_bysize Klutz_Comic_bysize (string $comic)
 mixed &fetchImage ([timestamp $date = null])
 string fetchURL ([timestamp $date = null])
 array _expandurls (array $urls, string $base)
 array _getsizes (array $images, [boolean $filter = true], [timestamp $date = null])
 boolean _ignore (string $string)
 array _stripimages (string $document)
Variables
mixed $choose = 'biggest' (line 66)

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

array $ignore = array() (line 30)

A list of images to ignore (preg matches)

integer $maxheight = 65536 (line 51)

What is the largest height to consider

integer $maxwidth = 65536 (line 58)

What is the largest width to consider

integer $minheight = 0 (line 37)

What is the smallest height to consider

integer $minwidth = 0 (line 44)

What are the smallest width to consider

array $search = null (line 23)

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

Inherited Variables

Inherited from Klutz_Comic

Klutz_Comic::$agent
Klutz_Comic::$author
Klutz_Comic::$comment
Klutz_Comic::$cookies
Klutz_Comic::$days
Klutz_Comic::$headers
Klutz_Comic::$homepage
Klutz_Comic::$http
Klutz_Comic::$icount
Klutz_Comic::$idate
Klutz_Comic::$iformat
Klutz_Comic::$isow
Klutz_Comic::$itype
Klutz_Comic::$name
Klutz_Comic::$nohistory
Klutz_Comic::$offset
Klutz_Comic::$override
Klutz_Comic::$pass
Klutz_Comic::$referer
Klutz_Comic::$subs
Klutz_Comic::$url
Klutz_Comic::$user
Methods
Constructor Klutz_Comic_bysize (line 76)

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.

Klutz_Comic_bysize Klutz_Comic_bysize (string $comic)
  • string $comic: Index for the comic
fetchImage (line 250)

Fetch the actual image

  • return: Klutz_Image on success, false otherwise.
mixed &fetchImage ([timestamp $date = null])
  • timestamp $date: The date to retrieve the comic for (default today).
fetchURL (line 135)

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.

  • return: URL of the comic image
string fetchURL ([timestamp $date = null])
  • timestamp $date: Date of the comic to retrieve (default today)
_expandurls (line 320)

Expand paths to fully-qualified URLs

  • return: Fully-qualified URLs
array _expandurls (array $urls, string $base)
  • array $urls: Paths to expand
  • string $base: The base URL used for relative links
_getsizes (line 365)

Get the dimensions from the list of images passed in.

  • return: Dimensions for all desired images.
array _getsizes (array $images, [boolean $filter = true], [timestamp $date = null])
  • array $images: The list of images to check.
  • boolean $filter: Filter by size, etc? (true).
  • timestamp $date: Date to use for filter prefs.
_ignore (line 346)

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

  • return: True if we should ignore it
boolean _ignore (string $string)
  • string $string: The name to check
_stripimages (line 286)

Strip the list of images from the contents of a web page.

Derived from Snoopy's striplinks function.

  • return: List of images in the page.
array _stripimages (string $document)
  • string $document: The HTML document to parse.

Inherited Methods

Inherited From Klutz_Comic

 Klutz_Comic::Klutz_Comic()
 Klutz_Comic::getInstance()
 Klutz_Comic::getInstance_monthly()
 Klutz_Comic::getInstance_ref()
 Klutz_Comic::getInstance_weekly()
 Klutz_Comic::getInstance_yearly()
 Klutz_Comic::getOverride()
 Klutz_Comic::substitute()
 Klutz_Comic::_initHTTP()

Documentation generated on Sun, 30 Jan 2011 05:30:34 +0000 by phpDocumentor 1.4.3