yahoo.search.dom.image (version 1.5, Thu Oct 27 10:47:11 PDT 2005)
index
/home/leif/hack/pysearch/yahoo/search/dom/image.py

DOM parser for Image search results
 
Implement a simple DOM parser for the Yahoo Search Web Services
image search APIs.

 
Modules
       
yahoo.search.dom
yahoo.search.parser

 
Classes
       
yahoo.search.dom.DOMResultParser(yahoo.search.parser.ResultParser)
ImageSearch

 
class ImageSearch(yahoo.search.dom.DOMResultParser)
    ImageSearch - DOM parser for Image Search
 
Each result is a dictionary populated with the extracted data from the
XML results. The following keys are always available:
 
    Title            - The title of the image file.
    Summary          - Summary text associated with the image file.
    Url              - The URL for the image file or stream.
    ClickUrl         - The URL for linking to the image file.
    RefererUrl       - The URL of the web page hosting the content.
    FileSize         - The size of the file, in bytes.
    FileFormat       - One of bmp, gif, jpg or png.
    Thumbnail        - The URL of the thumbnail file.
 
The following attributes are optional, and might not be set:
 
    Height           - The height of the image in pixels.
    Width            - The width of the image in pixels.
    Publisher        - The creator of the image file.
    Restrictions     - Provides any restrictions for this media
                       object. Restrictions include noframe and
                       noinline.
    Copyright        - The copyright owner.
 
The Thumbnail is in turn another dictionary, which will have the
following keys:
 
    Url             - URL of the thumbnail.
    Height          - Height of the thumbnail, in pixels (optional).
    Width           - Width of the thumbnail, in pixels (optional).
 
 
Example:
    results = ws.parse_results(dom)
    for res in results:
        print "%s - %s bytes" % (res.Title, res.FileSize)
 
 
Method resolution order:
ImageSearch
yahoo.search.dom.DOMResultParser
yahoo.search.parser.ResultParser
__builtin__.object

Methods inherited from yahoo.search.dom.DOMResultParser:
parse_results(self, dom_object)
This is a simple DOM parser for all Yahoo Search services. It
expects to find a top-level node named ResultSet. This is the main
entry point for the DOM parser, and it requires a properly con-
structed DOM object (e.g. using minidom).

Methods inherited from yahoo.search.parser.ResultParser:
__init__(self, service, res_dict=<class 'yahoo.search.parser.ResultDict'>)
__iter__(self)

Data descriptors inherited from yahoo.search.parser.ResultParser:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
firstResultPosition
The first result position
first_result_position
The first result position
results
The list of all results
service
The Search Web Service object for this results parser
totalResultsAvailable
Total number of results for the query
totalResultsReturned
The number of results returned
total_results_available
Total number of results for the query
total_results_returned
The number of results returned

 
Data
        __author__ = 'Leif Hedstrom <leif@ogre.com>'
__date__ = 'Thu Oct 27 10:47:11 PDT 2005'
__revision__ = '$Id: image.py,v 1.5 2005/10/27 18:07:59 zwoop Exp $'
__version__ = '$Revision: 1.5 $'

 
Author
        Leif Hedstrom <leif@ogre.com>