Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-20 20:12:20

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

auto create a post when something happens? (resolved)

is there a plugin which can post an article to report what’s going on in the site? i created a microblogging widget which is basically a little blog to offer more timely updates(learning from twitter).

it would be nice though if it could also report if i made a new blog post, or uploaded a certain file too(like facebook’s feed).

the only thing i could think of that is trained to do something like this is simplepie, but using it on your own site seemed a little strange to me.

Last edited by mrtunes (2009-07-23 18:49:15)

Offline

#2 2009-07-21 03:55:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: auto create a post when something happens? (resolved)

Hi Elliott

You could use rah_external_output


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2009-07-21 19:55:10

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: auto create a post when something happens? (resolved)

thanks Yiannis. i’m not really sure how it’s supposed to be used though. do i have to write a php script or something?

i did get as far as seeing that you have to go to Extensions —> External Output

Offline

#4 2009-07-22 05:20:18

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: auto create a post when something happens? (resolved)

Hi Elliott,

It actually supports all txp tags so all you need is txp code there. have the parsed content show you can use something like
<txp:php>include($DOCUMENT_ROOT . "http://www.yoursite.com/?rah_external_output=title_of_your_rah_entry");</txp:php>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2009-07-22 19:58:44

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: auto create a post when something happens? (resolved)

yeah this is still a little nebulous to me.

“title of your rah entry” makes me wonder if it would post a specific blog post or something?
my idea would have to have something like “Mr. Tunes just posted a blog called <txp:title /> “

Offline

#6 2009-07-22 20:33:20

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,732
Website

Re: auto create a post when something happens? (resolved)

I was a little confused from your description which way round you want to broadcast.

Broadcasting from txp to another service: mem_twitter will ping twitter whenever you publish an article. This will only notify twitter when in site is in live mode. The tweet message is configurable and can include both a tinyurl permalink to the article and the article title. If you’re using something other than twitter, you could probably adapt the plugin.

Broadcasts from another service included on txp: using one of the SimplePie plugins sounds to me like a valid way of presenting the feed details from your microblogging service into your txp-site.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2009-07-22 20:38:09

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: auto create a post when something happens? (resolved)

hi jakob. sorry i have been unclear because if i direct people to my website my analytics spike. but it’s my homepage on the forum here. i created a widget on the frontpage which is basically article_custom calling a section called “micro”. but whenever i post something in my section called “blog” i would like it to somehow ping the micro feed and make an announcement(which typically comes in the form of making a new article).

from what i understand though, rah external output is made to get around this process of clogging up your backend with tons of articles and other things.

Offline

#8 2009-07-22 21:36:14

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,732
Website

Re: auto create a post when something happens? (resolved)

Does it really have to create a new article under the micro section? If I understand you correctly, you’d like the “x-days ago, Mr Tunes said”- cycler to also include notifications of new blog articles? To do that, you just need to add to add the blog section to your article_custom tag and it will draw in articles from there too…


TXP Builders – finely-crafted code, design and txp

Offline

#9 2009-07-22 21:40:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,732
Website

Re: auto create a post when something happens? (resolved)

BTW: I think colak’s example is for publishing content from your txp site on another site. You use the rah_external_output to generate the code you want to output from txp and use the include code he provided on another page to incorporate txp-output elsewhere (for example, to include the menu structure from txp in a third-party gallery script or to output information from txp in xml-format to drive a third-party flash script).


TXP Builders – finely-crafted code, design and txp

Offline

#10 2009-07-22 23:17:30

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: auto create a post when something happens? (resolved)

ok gotcha, i think i am getting closer. this script doesn’t do what it should. does everything look right? it ends up trying to pull entire blog posts into my widget.

<txp:article_custom form="micro" limit="5" pgonly="0" section="micro, blog" />

micro form:

<txp:if_section name="blog">
<h2><txp:posted format="since" />, Mr. Tunes:</h2>
<txp:article_image />
<p>made a blog post entitled: "<txp:title />"</p>
<txp:else />
<h2><txp:posted format="since" />, Mr. Tunes said:</h2>
<txp:article_image />
<p><txp:body /></p>
</txp:if_section>

Last edited by mrtunes (2009-07-22 23:17:56)

Offline

#11 2009-07-23 07:55:00

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,732
Website

Re: auto create a post when something happens? (resolved)

It’s because you have <txp:body /> in your form. You have a number of different options:

1) If you write a mini summary in the excerpt field of each blog article of the length you want, you can use:

<txp:if_excerpt>
   <txp:excerpt />
<txp:else />
   <txp:body />
</txp:if_excerpt>

in place of <p><txp:body /></p> (you don’t need the p tags around body as txp:body creates them by default). With this variant you have to remember to write an excerpt for each blog post.

2) Use a plugin such as rss_auto_excerpt or rvm_substr to cut off your blog articles after so and so many characters/words. You have less control over the text as with variant 1. If I remember rightly with rss_auto_excerpt, you can set it to use the excerpt if available or else shorten the body.

3) You could write all your micro articles in the excerpt section and write an excerpt for each blog article. Then you need only use <txp:excerpt /> in place of <p><txp:body /></p> in your form.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2009-07-23 08:25:39

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: auto create a post when something happens? (resolved)

well i use excerpt already for the actual blog section.

i’m a little confused because in the form i made i read it as = “if the section is blog, you’re just going to be outputting the title, if it’s anything else, you will get the body”.

maybe i didn’t understand the use of if_section well enough?

Offline

Board footer

Powered by FluxBB