tinorusch / tweeter
AddOn for SallyCMS, providing capability of tweeting formatted events.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: >=5.2.0
- dg/twitter-php: 3.*
- sallycms/composer-installer: *
- sallycms/sallycms: >=0.8,<0.9
This package is auto-updated.
Last update: 2020-08-08 16:46:12 UTC
README
Tweets events from SallyCMS.
To create consumerKey etc. go to https://dev.twitter.com/apps/new and create your credentials with read/write access.
An example config is given below:
tweeterConfig: consumerKey: consumerSecret: accessToken: accessTokenSecret: events:
- eventName: 'SLY_ART_ADDED'
pattern: 'New Article added to testsite.de: %s'
keys:
- ['name']
It registers a Tweeter-Listener to the 'SLY_ART_ADDED' event. If this event occurs, we format the text given by 'pattern' with the $params given by the event. 'keys' contains a ordered list of key-lists. The key ['name'] refers to $params['name']. The key ['user','name'] would refer to $params['user']['name']. 'pattern' is in standard sprintf syntax.
Additionally, SallyCMSTweeter provides te public function tweetText() for arbitary use.