1XML::Atom::Client(3pm)User Contributed Perl DocumentationXML::Atom::Client(3pm)
2
3
4
6 XML::Atom::Client - A client for the Atom API
7
9 use XML::Atom::Client;
10 use XML::Atom::Entry;
11 my $api = XML::Atom::Client->new;
12 $api->username('Melody');
13 $api->password('Nelson');
14
15 my $entry = XML::Atom::Entry->new;
16 $entry->title('New Post');
17 $entry->content('Content of my post.');
18 my $EditURI = $api->createEntry($PostURI, $entry);
19
20 my $feed = $api->getFeed($FeedURI);
21 my @entries = $feed->entries;
22
23 my $entry = $api->getEntry($EditURI);
24
26 XML::Atom::Client implements a client for the Atom API described at
27 http://bitworking.org/projects/atom/draft-gregorio-09.html, with the
28 authentication scheme described at
29 http://www.intertwingly.net/wiki/pie/DifferentlyAbledClients.
30
31 NOTE: the API, and particularly the authentication scheme, are still in
32 flux.
33
35 XML::Atom::Client->new(%param)
36 $api->use_soap([ 0 | 1 ])
37 XML::Atom::Client supports both the REST and SOAP-wrapper versions of
38 the Atom API. By default, the REST version of the API will be used, but
39 you can turn on the SOAP wrapper--for example, if you need to connect
40 to a server that supports only the SOAP wrapper--by calling use_soap
41 with a value of 1:
42
43 $api->use_soap(1);
44
45 If called without arguments, returns the current value of the flag.
46
47 $api->username([ $username ])
48 If called with an argument, sets the username for login to $username.
49
50 Returns the current username that will be used when logging in to the
51 Atom server.
52
53 $api->password([ $password ])
54 If called with an argument, sets the password for login to $password.
55
56 Returns the current password that will be used when logging in to the
57 Atom server.
58
59 $api->createEntry($PostURI, $entry)
60 Creates a new entry.
61
62 $entry must be an XML::Atom::Entry object.
63
64 $api->getEntry($EditURI)
65 Retrieves the entry with the given URL $EditURI.
66
67 Returns an XML::Atom::Entry object.
68
69 $api->updateEntry($EditURI, $entry)
70 Updates the entry at URL $EditURI with the entry $entry, which must be
71 an XML::Atom::Entry object.
72
73 Returns true on success, false otherwise.
74
75 $api->deleteEntry($EditURI)
76 Deletes the entry at URL $EditURI.
77
78 $api->getFeed($FeedURI)
79 Retrieves the feed at $FeedURI.
80
81 Returns an XML::Atom::Feed object representing the feed returned from
82 the server.
83
84 ERROR HANDLING
85 Methods return "undef" on error, and the error message can be retrieved
86 using the errstr method.
87
89 Please see the XML::Atom manpage for author, copyright, and license
90 information.
91
92
93
94perl v5.36.0 2022-07-22 XML::Atom::Client(3pm)