The autotweet plugin automatically posts tweets to your Twitter App when specific pages are changed.
The autotweet plugin automatically posts tweets to your Twitter App when specific pages are changed.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to autotweet2
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 [at] abrah [dot] am OAuth for Twitter PHP Library.
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:
if ( function_exists('curl_init') ) { echo 'cURL is installed'; } else { echo 'cURL is NOT installed'; }
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.
Head to Twitter and set up an application.
Important Make sure you selected “Read & Write” acces.
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.
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
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.
~~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>~~
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:~~
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 |
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}
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. |
public $host = "https://api.twitter.com/1.1/";
public $host = "https://api.twitter.com/1.1/";
Hello… ¿how can I launch a tweet each time a new page is created? (I'm configuring a blog, and I need to comunicate new entries in the blog) (www.laterriblecorduradelidiota.es)