PHPackages                             cbarberis/twitter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cbarberis/twitter

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

cbarberis/twitter
=================

The SilverStripe CMS Twitter Module

7142[1 PRs](https://github.com/cbarberis/silverstripe-twitter/pulls)PHP

Since Dec 18Pushed 10y ago3 watchersCompare

[ Source](https://github.com/cbarberis/silverstripe-twitter)[ Packagist](https://packagist.org/packages/cbarberis/twitter)[ RSS](/packages/cbarberis-twitter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Twitter Module
==============

[](#twitter-module)

Maintainer Contact
------------------

[](#maintainer-contact)

- Carlos Barberis &lt;carlos (at) cbarberis (dot) com&gt;

Requirements
------------

[](#requirements)

- Silverstripe 3.1.x

Module Status
-------------

[](#module-status)

Still under active development.

Overview
--------

[](#overview)

This module lets you post messages to Twitter from the CMS.

You need to apply TwitterDecorator to the DataObject you want to use to generate and post statues to Twitter.You can apply this decorator to SiteTrees or DataObjects.

The decorator adds a checkbox used to confirm you want to post to Twitter (this preference is not stored in the DB), and a text field to store the last time you posted to Twitter.

There are a few ways to use the decorator. Add this in your mysite/\_config.php

- 1. Post content from one field in your DataObject:

DataObject::add\_extension('MyDO','TwitterExtension'); TwitterExtension::set\_twitter\_fields(array('MyDO' =&gt; 'Title'));

- 2. Post content from multiple fields in Pages:

DataObject::add\_extension('Page','TwitterExtension'); TwitterExtension::set\_twitter\_fields(array('Page' =&gt; array('Title','OtherField')));

- 3. You can create a method in your class to generate content to post (this will post what MyFunction returns, make sure this is an string!).

DataObject::add\_extension('MyClass','TwitterExtension'); TwitterExtension::set\_twitter\_fields(array('MyClass' =&gt; array('MyFunction')));

Installation
============

[](#installation)

1. Simply add the module to the top level of your SilverStripe installation and perform a dev/build.
2. You need a Twitter account to post to, login to Twitter and get ():

- Register an App
- Consumer Key
- Consumer Secret Key
- Access Token
- Access Secret Token (access token needs read/write permission)

3. Add this to your mysite/\_config.php OR see point 4

PostToTwitter::set\_twitter\_consumer\_secret('1234'); PostToTwitter::set\_twitter\_access\_token('1234'); PostToTwitter::set\_twitter\_consumer\_key('1234'); PostToTwitter::set\_twitter\_access\_token\_secret('1234');

4. I have added a new DO called 'TwitterAccount', you can use this to add multiple Twitter account and then choose one of them when posting a new status. To add a new Twitter account go to the 'Social media' tab

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/39b4780fe69e75cc1d5a076c340eb1ae355aabaffe78674af413036a567008ec?d=identicon)[cbarberis](/maintainers/cbarberis)

### Embed Badge

![Health badge](/badges/cbarberis-twitter/health.svg)

```
[![Health](https://phpackages.com/badges/cbarberis-twitter/health.svg)](https://phpackages.com/packages/cbarberis-twitter)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
