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
XML::Atom::Stream(3) User Contributed Perl Documentation XML::Atom::Stream(3)

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

  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
  }

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.

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.

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.

XML::Atom, XML::Atom::Filter, http://www.livejournal.com/users/brad/2143713.html
2008-01-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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