GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XML::ATOM::STREAM (3)

.ds Aq ’

NAME

XML::Atom::Stream - A client interface for AtomStream

CONTENTS

SYNOPSIS



  use XML::Atom::Stream;

  my $url = "http://updates.sixapart.com/atom-stream.xml";

  my $client = XML::Atom::Stream->new(
      callback  => \&callback,
      reconnect => 1,
      debug     => 1,
      timeout   => 30,
  );
  $client->connect($url);

  sub callback {
      my($atom) = @_;
      # $atom is a XML::Atom::Feed object
  }



DESCRIPTION

XML::Atom::Stream is a consumer of AtomStream. It connects to Atom stream, the never ending Atom feed and parses the feed by SAX pull parser. Whenever it retrieves a new feed, your callback function will be invoked.

METHODS

new


  my $client = XML::Atom::Stream->new(
      callback  => \&callback,
      reconnect => 1,
      debug     => 1,
  );



Creates a new XML::Atom::Stream instance.
callback Callback reference to handle new Atom feed. Callback function will receive only one parameter, XML::Atom::Feed object. You can abort the connection by throwing an exception (die) inside the callback.
reconnect Whether to do automatic reconnection when the SAX parser fails to parse the stream data, or the connection gets disconnected. Note that if you abort the connection by dying inside the callback, it won’t reconnect. Defaults to 0.
timeout timeout variable which is passed to LWP::UserAgent. Defaults to 15.
ua an object of LWP::UserAgent or its subclass to use to connect to the Atom stream. Optional and by default it tries to create its own LWP::UserAgent object.
debug Whether to display debug messages. Defaults to 0.

connect


  $client->connect($url);



Connects to the Atom stream URL and waits for the incoming feeds.

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net> with tips from Benjamin Trott and Brad Fitzpatrick.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

XML::Atom, XML::Atom::Filter, http://www.livejournal.com/users/brad/2143713.html
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 XML::ATOM::STREAM (3) 2008-01-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.