Net-Google-Calendar

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.93 2008-04-08
    - Much better attendee support
    - Fix typo (James Wright)
    - Added start of comment support

0.92 2007-12-19
    - Fix creation duplicate tags when editing an existing record
      (James Wright)
    - Fix fetching of a single entry using entryID (James Wright)
    - Allow Google Gadgets and prefs in WebContent

0.91 2007-12-16
    - Fix bad release

0.9 2007-12-15
    - Fix location in Entry (Julian Bilcke)
    - Add ability to create, update and delete calendars
    - Add ability to get attendees (Scott Gifford)
    - Fix bug with getting objects instead of scalars (Mark Allen)
    - Use Net::Google::AuthSub

bin/google-calendar  view on Meta::CPAN

#print $e->as_xml;

my $content = Net::Google::Calendar::WebContent->new(
	title      => 'DateTime Gadget (a classic!)',
    href       => 'http://www.google.com/favicon.ico',
	webContent => {
		url    => 'http://google.com/ig/modules/datetime.xml',
		width  => 300,
		height => 136,
        type   => 'application/x-google-gadgets+xml',
		prefs  => { color => 'green' },
	}
);
#print $content->as_xml;
#$e->add_link($content);
#print $e->as_xml;

#my $cal = Net::Google::Calendar->new( url => $url );
my $cal = Net::Google::Calendar->new();

my $u = shift;

lib/Net/Google/Calendar/WebContent.pm  view on Meta::CPAN

or
    my $content = Net::Google::Calendar::WebContent->new(
        title      => 'Word of the Day',
        href       => 'http://www.thefreedictionary.com/favicon.ico',
    );
    $content->web_content(
            url    => 'http://www.thefreedictionary.com/_/WoD/wod-module.xml',
            width  => 300,
            height => 136,
            type   => 'application/x-google-gadgets+xml',
            prefs  => { Days => 1, Format => 0 },
    );

(note the ability to set webContentGadgetPrefs using the special prefs attribute).

=head1 METHODS

=head2 new  [opt[s]]

Options can be 

=over 4

=item title

lib/Net/Google/Calendar/WebContent.pm  view on Meta::CPAN

The width of the content.

=item height

The height of the content.

=item type

The mime-type (see above)

=item prefs

This takes a hash ref and all pairs are turned into C<webContentGadgetPref> entries.

=back

=cut

sub web_content {
    my $self = shift;
    my $name    = 'gCal:webContent';
    if (@_) {
        my %params = @_;
        # h-h-hack
        %params    = () if $params{empty};
        if (my $type = delete $params{type}) {
            $self->_set_type($type);
        }  
        # egregious hack
        $params{'xmlns:gd'}   = 'http://schemas.google.com/g/2005';
        $params{'xmlns:gCal'} = 'http://schemas.google.com/gCal/2005';
        my $prefs   = delete $params{prefs};    
        XML::Atom::Base::set($self, '', $name, '', \%params);
        my $content = $self->_my_get('', $name); 
        foreach my $key (keys %{$prefs}) {
            # TODO: this feels icky
            my $node;
            if (LIBXML) {
                $node = XML::LibXML::Element->new($name.'GadgetPref');
                $node->setAttribute( name  => $key );
                $node->setAttribute( value => $prefs->{$key} );
            } else {
                $node = XML::XPath::Node::Element->new($name.'GadgetPref');
                $node->addAttribute(XML::XPath::Node::Attribute->new(name  => $key));
                $node->addAttribute(XML::XPath::Node::Attribute->new(value => $prefs->{key}));
            }
            $content->appendChild($node);
        }
    }
    return $self->_my_get('', $name);
}

1;




( run in 0.730 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )