NAME
OpenInteract2::Observer::UsePerlPost - Observer to post the contents of an object to a use.perl.org journal
SYNOPSIS
# 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
[someaction]
# ... 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
[observer]
useperl = OpenInteract2::Observer::UsePerlPost
# hook it into the 'news' action so that 'post add' events fired will
# add an entry into the journal
[map]
useperl = news
DESCRIPTION
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.
Configuration
use_perl_skip (optional)
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...)
use_perl_subject (required)
Field/method to pull the subject of the use.perl post from.
use_perl_content (required)
Field/method to pull the content of the use.perl post from.
use_perl_footer (optional)
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.
use_perl_user_id (required)
ID of the user to use for authentication.
use_perl_password (required)
Password for the given user ID.
use_perl_proxy (optional)
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.
use_perl_uri (optional)
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.
Modifying your content
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.
SEE ALSO
COPYRIGHT
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.
AUTHORS
Chris Winters <chris@cwinters.com>