Class: OpenWFE::Extras::BlogParticipant

Inherits:
AtomPubParticipant show all
Includes:
TemplateMixin
Defined in:
lib/openwfe/extras/participants/atompub_participants.rb

Overview

A participant that blogs.

require 'openwfe/extras/participants/atompub_participants'
include OpenWFE::Extras

target_uri = "https://openwferu.wordpress.com/wp-app.php/posts"

params = {}
params[:username] = 'jeff'
params[:password] = 'whatever'

params[:categories] = 'openwferu, test'

#params[:title_field] = "title"
    #
    # which workitem field will hold the post title ?
    # by default, it's "title"

engine.register_participant "blogger", BlogParticipant.new(target_uri, params) do
    """
        paragraph 0

        paragraph 1 : ${f:message}

        paragraph 2
    """
end

This participant takes its template and the workitem it receives to publish a blog entry.

The template can be specified as a block (as in the previous example) or via the :template parameter.

Instance Attribute Summary

Attributes inherited from AtomPubParticipant

#author_name, #author_uri, #target_uri

Instance Method Summary collapse

Methods inherited from AtomPubParticipant

#consume

Constructor Details

#initialize(target_uri, params, &block) ⇒ BlogParticipant

Returns a new instance of BlogParticipant.



263
264
265
266
267
268
269
270
271
272
273
# File 'lib/openwfe/extras/participants/atompub_participants.rb', line 263

def initialize (target_uri, params, &block)

    super

    @template = params[:template]
    @block_template = block

    @content_type = params[:content_type] || "html"

    @title_field = params[:title_field] || "title"
end