yahoo.search.dom.audio (version 1.4, Tue Feb 27 14:19:41 MST 2007) | index /home/leif/hack/pysearch/yahoo/search/dom/audio.py

`DOM parser for Audio search results
Implement a simple DOM parser for the Yahoo Search Web Services
audio search APIs.`

Modules

``

yahoo.search.dom | yahoo.search.parser |  |

Classes

``

yahoo.search.dom.DOMResultParser(yahoo.search.parser.ResultParser)
  PodcastSearch
  SongDownloadLocation
_AudioParser(yahoo.search.dom.DOMResultParser)
  AlbumSearch
  ArtistSearch
  SongSearch

class AlbumSearch(_AudioParser)

``

`AlbumSearch - DOM parser for Album 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 album.
Artist - The performer of the album, and the unique ID
Publisher - The publisher of the album.
ReleaseDate - The date of the album's release.
Id - Internal ID of the album, unique identifier.
The following attributes are optional, and might not be set:
Tracks - Number of tracks on the album.
Thumbnail - The URL of a thumbnail picture of the album cover.
RelatedAlbums - Contains a list of related (similar) albums (IDs).
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).
The two attributes Artist and RelatedAlbums are both lists of
dictionaries, with the following two keys:
Name - Textual "name" value.
Id - Unique identifier (internal yahoo ID).
Example:
results = ws.parse_results()
for res in results:
print "%s - %s bytes" % (res.Artist.Name, res.Artist.Id)
`

Method resolution order:
  AlbumSearch
  _AudioParser
  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`

class ArtistSearch(_AudioParser)

``

`ArtistSearch - DOM parser for Artist Search
Each result is a dictionary populated with the extracted data from the
XML results. The following keys are always available:
Name - The name of the artist.
Id - Internal ID of the artist, unique identifier.
The following attributes are optional, and might not be set:
Thumbnail - The URL of the thumbnail file.
RelatedArtists - Contains a list of related artists that fans of
the artist in this Result might like.
PopularSongs - Contains a list of popular songs by this artist.
YahooMusicPage - The URL to link to the artist's page on the
Yahoo Music site. This can be empty!
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).
Both RelatedArtist and PopularSongs are lists of IDs, which can be
used as an identifier into subsequent Yahoo Audio search calls.
Example:
results = ws.parse_results()
for res in results:
print "%s - %s bytes" % (res.Name, res.YahooMusicPage)
`

Method resolution order:
  ArtistSearch
  _AudioParser
  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`

class PodcastSearch(yahoo.search.dom.DOMResultParser)

``

`PodcastSearch - DOM parser for Podcast 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 audio file.
Summary - Summary text associated with the audio file.
Url - The URL for the audio file or stream.
ClickUrl - The URL for linking to the audio file.
RefererUrl - The URL of the web page hosting the content.
FileSize - The size of the file, in bytes.
FileFormat - One of aiff, midi, mp3, msmedia, quicktime,
realmedia, wav or other.
Duration - The duration of the audio file in seconds.
Streaming - Whether the audio file is streaming or not.
The following attributes are optional, and might not be set:
SampleSize - The number of bits used in sampling the sound.
Channels - The number of channels in the audio. Usually
1 (mono) or 2 (stereo).
Publisher - The creator of the video file.
Restrictions - Provides any restrictions for this media
object. Restrictions include noframe and
noinline. See developer site for more info.
Copyright - The copyright owner.
If present, the Thumbnail value is in turn another dictionary, which will
have these 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:
  PodcastSearch
  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`

class SongDownloadLocation(yahoo.search.dom.DOMResultParser)

``

`SongDownloadLocation - DOM parser for Song Download Location
Each result is a dictionary populated with the extracted data from the
XML results. The following keys are always available:
Source - The source provider for the file.
Url - The url for accessing the file.
Format - The format the file has been encoded in.
The following attributes are optional, and might not be set:
Price - The price, in dollars, of the song.
Length - The length of the song in seconds.
Channels - The number of channels. Usually 1 (mono) or
2 (stereo).
Restrictions - A space-separated list of restrictions:
* drm denotes files with some form of digital
rights management.
* subrequired means a subscription to the
appropriate service is required.
* subnotrequired means a subscription to the
appropriate service is not required.
* win denotes files that will play on Windows.
* mac denotes files that will play on Macintosh.
* copyokay means this file may be copied.
* copynotokay means this file may not be copied.
* cdokay means this file may be burned to CD.
Quality - A quality metric for files found on the web. Values
range from 1 (worst) to 5 (best).
Example:
results = ws.parse_results()
for res in results:
print "%s - %s bytes" % (res.Name, res.YahooMusicPage)
`

Method resolution order:
  SongDownloadLocation
  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`

class SongSearch(_AudioParser)

``

`SongSearch - DOM parser for Song 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 song.
Id - Internal ID of the song, unique identifier.
Album - The album from which the song was taken, and ID.
Artist - The performer of the album, and the unique ID.
Publisher - The publisher of the album.
Length - The length of the song in seconds.
ReleaseDate - The date of the album's release.
Track - The track number on the album.
ClickUrl - The URL for linking to the audio file.
The following attributes are optional, and might not be set:
Thumbnail - The URL of a thumbnail picture of the album cover.
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).
The two attributes Artist and RelatedAlbums are both lists of dicts,
with the keys:
Name - Textual "name" value.
Id - Unique identifier (internal yahoo ID).
Example:
results = ws.parse_results()
for res in results:
print "%s - %s bytes" % (res.Artist.Name, res.Title)
`

Method resolution order:
  SongSearch
  _AudioParser
  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__ = 'Tue Feb 27 14:19:41 MST 2007' __revision__ = '$Id: audio.py,v 1.4 2007/02/28 05:20:11 zwoop Exp $' __version__ = '$Revision: 1.4 $'

Author
`` |  | Leif Hedstrom <leif@ogre.com>