.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "OPML 3pm" .TH OPML 3pm "2022-12-04" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::OPML \- creates and updates OPML (Outline Processor Markup Language) files .SH "SYNOPSIS" .IX Header "SYNOPSIS" # Create an \s-1OPML\s0 file .PP .Vb 1 \& use XML::OPML; \& \& my $opml = new XML::OPML(version => "1.1"); \& \& $opml\->head( \& title => \*(AqmySubscription\*(Aq, \& dateCreated => \*(AqMon, 16 Feb 2004 11:35:00 GMT\*(Aq, \& dateModified => \*(AqSat, 05 Mar 2004 09:02:00 GMT\*(Aq, \& ownerName => \*(Aqmichael szul\*(Aq, \& ownerEmail => \*(Aqopml\-dev@blogenstein.com\*(Aq, \& expansionState => \*(Aq\*(Aq, \& vertScrollState => \*(Aq\*(Aq, \& windowTop => \*(Aq\*(Aq, \& windowLeft => \*(Aq\*(Aq, \& windowBottom => \*(Aq\*(Aq, \& windowRight => \*(Aq\*(Aq, \& ); \& \& $opml\->add_outline( \& text => \*(AqWarren Ellis Speaks Clever\*(Aq, \& description => \*(AqWarren Ellis\e\*(Aq Personal Weblog\*(Aq, \& title => \*(AqWarren Ellis Speaks Clever\*(Aq, \& type => \*(Aqrss\*(Aq, \& version => \*(AqRSS\*(Aq, \& htmlUrl => \*(Aqhttp://www.diepunyhumans.com \*(Aq, \& xmlUrl => \*(Aqhttp://www.diepunyhumans.com/index.rdf \*(Aq, \& ); \& \& $opml\->add_outline( \& text => \*(Aqraelity bytes\*(Aq, \& descriptions => \*(AqThe raelity bytes weblog.\*(Aq, \& title => \*(Aqraelity bytes\*(Aq, \& type => \*(Aqrss\*(Aq, \& version => \*(AqRSS\*(Aq, \& htmlUrl => \*(Aqhttp://www.raelity.org \*(Aq, \& xmlUrl => \*(Aqhttp://www.raelity.org/index.rss10 \*(Aq, \& ); .Ve .PP # Create embedded outlines .PP .Vb 10 \& $opml\->add_outline( \& opmlvalue => \*(Aqembed\*(Aq, \& outline_one => { \& text => \*(AqThe first embedded outline\*(Aq, \& description => \*(AqThe description for the first embedded outline\*(Aq, \& }, \& outline_two => { \& text => \*(AqThe second embedded outline\*(Aq, \& description => \*(AqThe description for the second embedded outline\*(Aq, \& }, \& outline_three => { \& opmlvalue => \*(Aqembed\*(Aq, \& em_outline_one => { \& text => \*(AqI\*(Aqm too lazy to come up with real examples\*(Aq, \& }, \& em_outline_two => { \& text => \*(Aqso you get generic text\*(Aq, \& }, \& }, \& ); .Ve .PP # Create an embedded outline with attributes in the encasing tag .PP .Vb 9 \& $opml\->add_outline( \& opmlvalue => \*(Aqembed\*(Aq, \& description => \*(Aqnow we can have attributes in this tag\*(Aq, \& title => \*(Aqattributes\*(Aq, \& outline_with_atts => { \& text => \*(AqEat Your Wheaties\*(Aq, \& description => \*(AqCereal is the breakfast of champion programmers\*(Aq, \& }, \& ); .Ve .PP # Save it as a string. .PP .Vb 1 \& $opml\->as_string(); .Ve .PP # Save it to a file. .PP .Vb 1 \& $opml\->save(\*(AqmySubscriptions.opml\*(Aq); .Ve .PP # Update your \s-1OPML\s0 file. .PP .Vb 1 \& use XML::OPML; \& \& my $opml = new XML::OPML; .Ve .PP # Parse the file. .PP .Vb 1 \& $opml\->parse(\*(AqmySubscriptions.opml\*(Aq); .Ve .PP # Or optionally from a variable. .PP .Vb 2 \& my $content = $opml\->as_string(); \& $opml\->parse($content); .Ve .PP # Update it appending to the end of the outline .PP .Vb 9 \& $opml\->add_outline( \& text => \*(AqNeil Gaiman\e\*(Aqs Journal\*(Aq, \& description =>\*(AqNeil Gaiman\e\*(Aqs Journal\*(Aq, \& title => \*(AqNeil Gaiman\e\*(Aqs Journal\*(Aq, \& type => \*(Aqrss\*(Aq, \& version => \*(AqRSS\*(Aq, \& htmlUrl => \*(Aqhttp://www.neilgaiman.com/journal/journal.asp \*(Aq, \& xmlUrl => \*(Aqhttp://www.neilgaiman.com/journal/blogger_rss.xml \*(Aq, \& ); .Ve .PP # Update it inserting the outline into a specific group (note the group parameter) .PP .Vb 10 \& $opml\->insert_outline( \& group => \*(Aqoccult\*(Aq, \& text => \*(Aqmadghoul.com\*(Aq, \& description => \*(Aqthe dark night of the soul\*(Aq, \& title => \*(Aqmadghoul.com\*(Aq, \& type => \*(Aqrss\*(Aq, \& version => \*(AqRSS\*(Aq, \& htmlUrl => \*(Aqhttp://www.madghoul.com \*(Aq, \& xmlUrl => \*(Aqhttp://www.madghoul.com/cgi\-bin/fearsome/fallout/index.rss10 \*(Aq, \& ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This experimental module is designed to allow for easy creation and manipulation of \s-1OPML\s0 files. \s-1OPML\s0 files are most commonly used for the sharing of blogrolls or subscriptions \- an outlined list of what other blogs an Internet blogger reads. \s-1RSS\s0 Feed Readers such as AmphetaDesk ( http://www.disobey.com/amphetadesk ) use *.opml files to store your subscription information for easy access. .PP This is purely experimental at this point and has a few limitations. This module may now support attributes in the element of an embedded hierarchy, but these are limited to the following attributes: date_added, date_downloaded, description, email, filename, htmlurl, keywords, text, title, type, version, and xmlurl. Additionally, the following alternate spellings are also supported: dateAdded, dateDownloaded, htmlUrl, and xmlUrl. .PP Rather than reinvent the wheel, this module was modified from the \s-1XML::RSS\s0 module, so functionality works in a similar way. .SH "METHODS" .IX Header "METHODS" .IP "new \s-1XML::OPML\s0(version => '1.1')" 4 .IX Item "new XML::OPML(version => '1.1')" This is the constructor. It returns a reference to an \s-1XML::OPML\s0 object. This will always be version 1.1 for now, so don't worry about it. .IP "head(title => '$title', dateCreated => '$cdate', dateModified => '$mdate',ownerName => '$name', ownerEmail => '$email', expansionState => '$es', vertScrollState => '$vs', windowTop => '$wt', windowLeft => '$wl', windowBottom => '$wb',windowRight => '$wr',)" 4 .IX Item "head(title => '$title', dateCreated => '$cdate', dateModified => '$mdate',ownerName => '$name', ownerEmail => '$email', expansionState => '$es', vertScrollState => '$vs', windowTop => '$wt', windowLeft => '$wl', windowBottom => '$wb',windowRight => '$wr',)" This method will create all the \s-1OPML\s0 tags for the subset. For more information on these tags, please see the \s-1OPML\s0 documentation at http://www.opml.org . .ie n .IP "add_outline(opmlvalue => '$value', %attributes)" 4 .el .IP "add_outline(opmlvalue => '$value', \f(CW%attributes\fR)" 4 .IX Item "add_outline(opmlvalue => '$value', %attributes)" This method adds the elements to the \s-1OPML\s0 document(see the example above). There are no statement requirements for the attributes in this tag. The ones shown in the example are the ones most commonly used by \s-1RSS\s0 Feed Readers, blogrolls, and subscriptions. The opmlvalue element is optional. Only use this with the value 'embed' if you wish to embed another outline within the current outline. You can now use attributes in tags that are used for embedded outlines, however, you cannot use any attribute you want. The embedded tag only supports the following: date_added, date_downloaded, description, email, filename, htmlurl, keywords, text, title, type, version, and xmlurl, as well as the alternate spellings: dateAdded, dateDownloaded, htmlUrl, and xmlUrl. .ie n .IP "insert_outline(group => '$group', %attributes)" 4 .el .IP "insert_outline(group => '$group', \f(CW%attributes\fR)" 4 .IX Item "insert_outline(group => '$group', %attributes)" This method works in the same exact manner as \fBadd_outline()\fR except that this will insert the outline element into the specified group. The \f(CW$group\fR variable must be the text presented in the \*(L"text\*(R" attribute of the outline that you wish to insert this one into. For example, if you have an outline element with the text attribute of \*(L"occult\*(R" that contains four outline subelements of occult web sites, your group parameter would be \*(L"occult.\*(R" .IP "\fBas_string()\fR" 4 .IX Item "as_string()" Returns a string containing the \s-1OPML\s0 document. .IP "save($file)" 4 .IX Item "save($file)" Saves the \s-1OPML\s0 document to \f(CW$file\fR .IP "parse($content)" 4 .IX Item "parse($content)" Uses XML::Parser and XML::SimpleObject to parse the value of the string or file that is passed to it. This method prepares your \s-1OPML\s0 file for a possible update. Embedded outlines are supported. .SH "SOURCE AVAILABILITY" .IX Header "SOURCE AVAILABILITY" Source code is available at the development site at http://opml.blogenstein.com . Any contributions or improvements are greatly appreciated. You may also want to visit http://www.madghoul.com to see a whole lot of perl coding at work. .SH "AUTHOR" .IX Header "AUTHOR" .Vb 1 \& michael szul .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" copyright (c) 2004 michael szul .PP \&\s-1XML::OPML\s0 is free software. It may be redistributed and/or modified under the same terms as Perl. .SH "CREDITS" .IX Header "CREDITS" .Vb 4 \& michael szul \& matt cashner \& ricardo signes \& gergely nagy .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1), \fBXML::Parser\fR\|(3), \fBXML::SimpleObject\fR\|(3), \s-1\fBXML::RSS\s0\fR\|(3).