Mailing List Archive

Bricolage without its template system
Hi!

Let's say I don't want to use bricolage for template rendering but just for content management.

I need a way to post/put to another server like a dancer app when a story is published.

Does anyone here has something to say about it?

Cheers,

JPN
Re: Bricolage without its template system [ In reply to ]
On Dec 26, 2012, at 9:50 AM, Jose Pinheiro Neta <jose-p-neta@telecom.pt> wrote:

> Let's say I don't want to use bricolage for template rendering but just for content management.
>
> I need a way to post/put to another server like a dancer app when a story is published.
>
> Does anyone here has something to say about it?

I would implement the templates as usual, but at the end of the root category template, I would take the data and post it. With Mason templates, that would be something like this:

<%filter>;
HTTP::Tiny->new->request(POST => $url, { content => $_ });
$_ = undef;
</%filter>

Best,

David
Re: Bricolage without its template system [ In reply to ]
On 2012-12-26, at 1:48 PM, David E. Wheeler <david@justatheory.com> wrote:

> On Dec 26, 2012, at 9:50 AM, Jose Pinheiro Neta <jose-p-neta@telecom.pt> wrote:
>
>> Let's say I don't want to use bricolage for template rendering but just for content management.
>>
>> I need a way to post/put to another server like a dancer app when a story is published.
>>
>> Does anyone here has something to say about it?
>
> I would implement the templates as usual, but at the end of the root category template, I would take the data and post it. With Mason templates, that would be something like this:

This is exactly what I'm doing to power an API for a site. At the end of the usual template, there's a post to ElasticSearch. Then there's a Mojolicious Lite app that provides the API's interface. Other apps can interact with that via GET requests that return JSON.

Phillip.