NAME
Babble::Transport - Transport abstraction layer for Babble
DESCRIPTION
This module implements a layer that is transport agnostic. That is, one can pass a file, an HTTP URL or the like to this module, and it will delegate the job to an appropriate sub-module. Very useful for fetching feeds, as with Babble::Transport, the feed can be either remote or local, and can be fetched from anywhere Babble::Transport supports, and when one writes new DataSources, the code is reusable.
However, this should not be used outside of Babble::DataSource classes.
METHODS
- get
-
Return the contents of a given location, either fetched afresh, or from the cach (if any).
This method takes the following parameters:
- -location
-
The location to fetch the document from.
- -preprocessors
-
When specified as an array reference, the freshly fetched document will be filtered through each function referenced herein. These functions should take only one argument: a scalar reference. And they should operate on that, in-place.
- -cache_only
-
When this flag is set, only the cache will be used as a source, and the original location will not be checked.
- -babble
-
In order to use caching, this method needs access to a Babble::Cache object. This is done via a Babble object, which should be passed in this parameter, as a reference.
When one does not want caching, it can be omitted.
AUTHOR
Gergely Nagy, algernon@bonehunter.rulez.org
Bugs should be reported at http://bugs.bonehunter.rulez.org/babble.
SEE ALSO
Babble::Transport::LWP, Babble::Cache