OpenInteract2::Observer::UsePerlPost - Observer to post the contents of an object to a use.perl.org journal
# In your action.ini we need data to configure the journal post; this
# can also be set programmatically if for instance you need to use
# this for multiple users on your system
# ... normal action parameters ...
# observer parameters
# field with subject of post
use_perl_subject = title
# field with content of post
use_perl_content = news_item
# your use.perl userid
use_perl_user_id = 55
# your password
use_perl_password = foobar
# In conf/observer.ini:
# declare the observer
useperl = OpenInteract2::Observer::UsePerlPost
# hook it into the 'news' action so that 'post add' events fired will
# add an entry into the journal
useperl = news
This class is an OpenInteract2::Action observer that takes the object just added and fires off a posting to a use.perl.org journal with the contents. Thus keeping you in touch with your Perl peeps while still using your favorite application server to hold all your data.
What is an observer? See Class::Observer for general information and OpenInteract2::Observer for specifics related to OpenInteract.
If this parameter set in the action or in the OpenInteract2::Request to 'yes' or 'true', this observer won't kick off the journal addition. This allows you to stick a checkbox on the form that adds your object to skip the use.perl part if you want. (For instance, folks there might not dig your weekly cat photo post...)
Field/method to pull the subject of the use.perl post from.
Field/method to pull the content of the use.perl post from.
Text to use as the footer of the message posted. Any instance of '$LINK' will be replaced by my best guess for the URL to display this object, and '$ID' will be replaced by the object ID.
ID of the user to use for authentication.
Password for the given user ID.
Specify the 'Proxy' used in the Net::Blogger call to create a connection to the use.perl server. By default this is set to 'http://use.perl.org/journal.pl' and you should not need to change it.
Specify the 'Uri' used in the Net::Blogger call to create a connection to the use.perl server. By default this is set to 'http://use.perl.org/Slash/Journal/SOAP' and should not need to change it.
If you need to change either 'use_perl_proxy' or 'use_perl_uri' please contact the author since it probably means the API has changed and the default behavior of this module should be updated.
We modify the content extracted from your object in the following ways:
All '<pre>' tags are replaced with '<ecode>' tags.
All '<img>' tags are removed and replaced with a link to the image and text from that image's 'alt' attribute. If you don't specify an 'alt' attribute we generate some lame text for you.
Copyright (c) 2004-5 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Chris Winters <firstname.lastname@example.org>
To install OpenInteract2::Observer::UsePerlPost, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.