Drost-Tenfelde.de

Personal website of Jannes Drost-Tenfelde, resident bass trombone player at Cologne Concert Brass and Brass Band Merum

User Tools

Site Tools


Sidebar

General

Upcoming Events

  • Dutch Bass Trombone Open
    05 September 2014-08 September 2014
    The only exclusive bass trombone event of the world, with an excellent setup: Ben van Dijk, Denson Paul Pollard, Matyas Veer and Erik van Lier!!
    Location: Rotterdam

  • CCB: Open Air
    14 September 2014 10:00-16:00

    Location: Bayenthsl

  • CCB: Open Air
    05 October 2014 10:00-17:00

    Location: Rondorf

Music

Media

IT

Additional

dokuwiki:plugins:autotweet

autotweet Plugin

This plugin automatically posts Tweets to your Twitter via the oAuth authentication protocol when specific pages are changed.

You can specify which page updates are sent, by including the ~~AUTOTWEET:~~ syntax in these specific pages.

The plugin uses the Abraham Williams abraham@abrah.am OAuth for Twitter PHP Library.

This is the first version of the plugin. If you have suggestions for improvements, please send an email to info@drost-tenfelde.de.

Requirements

cURL Extension

:!: Important :!:
It is mandatory that you have installed the cURL Extension for PHP.

You can check if the extension is installed using the following code:

<PHP>
if ( function_exists('curl_init') ) {
  echo 'cURL is installed';
}
else {
  echo 'cURL is NOT installed';
}
</PHP>

Twitter App

The plugin communicates with Twitter using the oAuth authentication protocol. This protocol requires authentication keys that you will get by setting up a Twitter App.

Step 1: Setup Twitter App

Head to Twitter and set up an application.

:!: Important :!: Make sure you selected “Read & Write” acces.

Step 2: Get the security parameters

Once you've created your Twitter application get the parameters for authentication.

Parameter Comments
'Consumer key' This is displayed in the section oAuth.
'Consumer secret' This is displayed in the section oAuth.
'Access token' This is displayed in the section Your access token.
'Access token secret' This is displayed in the section Your access token.


These parameters must be used in the configuration of the plugin, so that the plugin can communicate with Twitter. Optionally, you can use syntax parameters to specify alternate Twitter Apps for specific pages. This, however, is optional.

Instalation

  • Extract the archive into your lib/plugins directory. Make sure the files are put into a directory called autotweet.
  • Done! You are now ready to use autotweet.

How it works

If you wish to track changes for a specific page, add the ~~AUTOTWEET:~~ syntax to that page.

If a page containing the ~~AUTOTWEET:~~ syntax is edited, the change_log information is used to assemble a message, which is then forwarded to the configured Twitter App as a Tweet.

Examples/Usage

~~AUTOTWEET:~~

If you wish to use alternate Twitter Apps for specific pages, you can optionally add syntax parameters.

~~AUTOTWEET:consumer_key=<consumer_key>&consumer_secret=<consumer_secret>&access_token=<access_token>&access_token_secret=<access_token_secret>~~

Syntax

You can use the parameters to overwrite the configuration settings for specific pages. This is not normally necessary.

~~AUTOTWEET:key=value&..key=value~~

key the parameter key to set optional
value the parameter value to set optional

You can set more than one element at once by using an & delimiter.

Available parameters:

Key Type Comments
consumer_key string Consumer Key of the Twitter App. Overwrites configuration parameter 'consumer_key'. optional
consumer_secret string Consumer Secret of the Twitter App. Overwrites configuration parameter 'consumer_secret'. optional
access_token string Access Token of the Twitter App. Overwrites configuration parameter 'access_token'. optional
access_token_secret string Access Token Secret of the Twitter App. Overwrites configuration parameter 'access_token_secret'. optional

Note: Normally you would use the same settings for all pages, in which case the syntax ~~AUTOTWEET:~~ is sufficient.

Default usage:

~~AUTOTWEET:~~

Configuration and Settings

Key Type Comments
consumer_key string Consumer Key of the Twitter App. required
consumer_secret string Consumer Secret of the Twitter App. required
access_token string Access Token of the Twitter App. required
access_token_secret string Access Token Secret of the Twitter App. required
message_template string Message template that will be filled out and used to send a Tweet to the Twitter App. required
date_format string Date format of the {date} field used in the message template. required


Message Template

For convenience you can change the formatting of the tweet sent to Twitter via the 'message_template' configuration parameter. The fields in the message will be replaced by the plugin.

Default:

{type} {page} - {summary} {user}

Example (including link to the page):

{date} {type} http://www.dokuwiki.org/{page} - {summary} @{user}

Template fields

Tag Comments
{type} Type of edit (Create, Edit, Minor Edit, Delete or Revert)
{date} Date of the last change. The format can be setup via Configuration and Settings
{page} ID of the page
{summary} Summary of the editor.
{user} User name of the user editing.
{extra} Extra data, used for storing the revision (timestamp) in the case of a revert.

Development

Change Log

Known Bugs and Issues

ToDo/Wish List

  • I am considering adding a configuration parameter 'track_all_changes'. If the parameter is set, all pages will be regarded by the plugin and tweets will be sent for all page changes, regardless of an ~~AUTOTWEET:~~ syntax being present or not.

FAQ

Discussion

dokuwiki/plugins/autotweet.txt · Last modified: 2013/01/22 22:40 (external edit)

Page Tools