PHPackages                             weboftalent/twitter-tools - 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. weboftalent/twitter-tools

ActiveSilverstripe-vendormodule

weboftalent/twitter-tools
=========================

Embed tweets using shortcodes. Optionally add Twitter cards to pages.

3.0.0(6y ago)32451[4 issues](https://github.com/gordonbanderson/weboftalent-twitter-tools/issues)[1 PRs](https://github.com/gordonbanderson/weboftalent-twitter-tools/pulls)1BSD-3-ClausePHP

Since Apr 17Pushed 6y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (10)Used By (1)

\#Twitter Utilities [![Build Status](https://camo.githubusercontent.com/091b83f2cb09c78099ed261e66844d15ff43fce38e859a7c580e622ec8e7f230/68747470733a2f2f7472617669732d63692e6f72672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gordonbanderson/weboftalent-twitter-tools)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b6d1b99ce78b809c408abdd23ac025292f676434e451252d82dd318f651865e2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gordonbanderson/weboftalent-twitter-tools/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c17ede4b3250e7509a2cff844d69bba6d1b01230bd34c542c16a640732a4f5b3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gordonbanderson/weboftalent-twitter-tools/?branch=master)[![Build Status](https://camo.githubusercontent.com/ad87afb14bcc7b0130e3f8b1fbcbc37ba077c916a4188e178e5b6d939554524c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gordonbanderson/weboftalent-twitter-tools/build-status/master)[![codecov.io](https://camo.githubusercontent.com/1ecfed1af25ee25ec87ace3ecb8997ecfad8c1e79f0cd7b8fb8e727828d2c51f/68747470733a2f2f636f6465636f762e696f2f6769746875622f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/gordonbanderson/weboftalent-twitter-tools?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/2c86755e578d85c2395fbe65e845c0764e2baa4a8ffd223c9dbf10243b3c3b7a/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f747769747465722d746f6f6c732f76657273696f6e)](https://packagist.org/packages/weboftalent/twitter-tools)[![Latest Unstable Version](https://camo.githubusercontent.com/775fed0aab2287ea96d11820bf1d23d8b12dbff826d54d8e009d1075c0d42282/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f747769747465722d746f6f6c732f762f756e737461626c65)](//packagist.org/packages/weboftalent/twitter-tools)[![Total Downloads](https://camo.githubusercontent.com/59dc65837f8da9e5d3592217e9b3fcfc88576a20890dec88291289c0ea0c9ce8/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f747769747465722d746f6f6c732f646f776e6c6f616473)](https://packagist.org/packages/weboftalent/twitter-tools)[![License](https://camo.githubusercontent.com/c5fc0924fe3f5e55adcf672ff5b59ce9ecaf58674c3b3994bd6a904cb93cfbfb/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f747769747465722d746f6f6c732f6c6963656e7365)](https://packagist.org/packages/weboftalent/twitter-tools)[![Monthly Downloads](https://camo.githubusercontent.com/3f57782b25e30c64a730537ab4b3e5a6e7ec6672b7fb36dadab4f4cc75f37cf7/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f747769747465722d746f6f6c732f642f6d6f6e74686c79)](https://packagist.org/packages/weboftalent/twitter-tools)[![Daily Downloads](https://camo.githubusercontent.com/1da9e56870b2386600d21f2525869c37ca5828b31da3028df0ee08467dd7bec7/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6674616c656e742f747769747465722d746f6f6c732f642f6461696c79)](https://packagist.org/packages/weboftalent/twitter-tools)

[![Dependency Status](https://camo.githubusercontent.com/9a7cf5c2cdada5a50c7a438d262e614a4428b923e4602f4818b0815ed942ce75/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7765626f6674616c656e743a747769747465722d746f6f6c732f62616467652e737667)](https://www.versioneye.com/php/weboftalent:twitter-tools)[![Reference Status](https://camo.githubusercontent.com/f9909d1327b30cccb93e22825f53c11b06151a436371d0c2e4183d52ba2c3c7f/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7765626f6674616c656e743a747769747465722d746f6f6c732f7265666572656e63655f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/php/weboftalent:twitter-tools/references)

[![codecov.io](https://camo.githubusercontent.com/32090ec9a06d533f32d3d591a2eefd8c60b2eb159387a73e7e974a70336d6ea7/68747470733a2f2f636f6465636f762e696f2f6769746875622f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732f6272616e63682e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/32090ec9a06d533f32d3d591a2eefd8c60b2eb159387a73e7e974a70336d6ea7/68747470733a2f2f636f6465636f762e696f2f6769746875622f676f72646f6e62616e646572736f6e2f7765626f6674616c656e742d747769747465722d746f6f6c732f6272616e63682e7376673f6272616e63683d6d6173746572)

\##Introduction This module provides the following functionality

- Embed tweets using a shortcode
- Optionally include a script to enlarge images in embedded tweets so that you can have them larger than Twitter's normal minimum width
- Twitter cards can be any type extending Page, provided an interface is implemented.

Incorporate Twitter
-------------------

[](#incorporate-twitter)

&lt;% require javascript("weboftalent/twitter\_tools: javascript/render-twitter-embeds.js") %&gt;

```
##Embedding Tweets
Tweets can be embedded into content using a shortcode like the following - the id parameter is the id of the tweet.

    [tweet id='537136515445710848']

## Enlarging Embedded Images

```

\*\*\*\* THIS NEEDS RETESTED \*\*\*\*

```
A script is included that you can include in your theme (either using require_javascript or a direct
 script include in the template) called twitteruril.js - include this and larger (at source size,
 perhaps not theme size) embedded images will render on your site.

## Twitter Cards
In order for a page to render an title, description and image when included as a link in a tweet, it needs provide metadata known as a Twitter Card.  There are two steps to take in order to achieve this:

### Implement RenderableAsTwitterCard Interface
A  minimal example of a class implementing a Twitter card is shown below.

```

class PageWithImage extends Page implements RenderableAsTwitterCard { private static $db = array( 'ImageAttribution' =&gt; 'Varchar(255)', 'BriefIntroduction' =&gt; 'Text' );

static $has\_one = array( 'MainImage' =&gt; 'Image' );

// implement the twitter card interface public function getTwitterTitle() { return $this-&gt;Title; }

public function getTwitterImage() { return $this-&gt;MainImage(); }

public function getTwitterDescription() { return $this-&gt;BriefIntroduction; }

}

```

### Template Changes
In your page template, add the following to inside  section of your page:

```txt

```

This will check if the current page implements the RenderableAsTwitterCard interface. If so it will produce the relevant metadata for Twitter to render a Twitter Card.

### Test With Card Validator

[](#test-with-card-validator)

Test out your twitter card using the Card Validator,  on a publicly accessible version of your site - this will highlight any issues. It should also be noted that your site will probably need whitelisted.

TODO
----

[](#todo)

- ShortCode for follow button allowing content editors to add them inline.
- Allow different types of TwitterCard and make this configurable.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~301 days

Recently: every ~307 days

Total

6

Last Release

2537d ago

Major Versions

1.0.0 → 2.0.02018-03-15

2.0.2 → 3.0.02019-05-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/9af58f7ff675f65dbd2f20d39d8b80ed671eb0fe376eb978e497934c175196fe?d=identicon)[weboftalent](/maintainers/weboftalent)

---

Top Contributors

[![gordonbanderson](https://avatars.githubusercontent.com/u/7060?v=4)](https://github.com/gordonbanderson "gordonbanderson (33 commits)")

---

Tags

silverstripetwittershortcodetwitter cards

### Embed Badge

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

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

###  Alternatives

[silverstripe/admin

SilverStripe admin interface

262.6M325](/packages/silverstripe-admin)[unclecheese/bootstrap-forms

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

5539.4k](/packages/unclecheese-bootstrap-forms)[sheadawson/silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views

5018.1k5](/packages/sheadawson-silverstripe-shortcodable)

PHPackages © 2026

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