Download the PHP package weboftalent/twitter-tools without Composer
On this page you can find all versions of the php package weboftalent/twitter-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download weboftalent/twitter-tools
More information about weboftalent/twitter-tools
Files in weboftalent/twitter-tools
Package twitter-tools
Short Description Embed tweets using shortcodes. Optionally add Twitter cards to pages.
License BSD-3-Clause
Informations about the package twitter-tools
Twitter Utilities
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
<% require javascript("weboftalent/twitter_tools: javascript/render-twitter-embeds.js") %>
THIS NEEDS RETESTED
class PageWithImage extends Page implements RenderableAsTwitterCard { private static $db = array( 'ImageAttribution' => 'Varchar(255)', 'BriefIntroduction' => 'Text' );
static $has_one = array( 'MainImage' => 'Image' );
// implement the twitter card interface public function getTwitterTitle() { return $this->Title; }
public function getTwitterImage() { return $this->MainImage(); }
public function getTwitterDescription() { return $this->BriefIntroduction; }
} txt <% include TwitterSummaryCardLargeImage %>
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 out your twitter card using the Card Validator, https://cards-dev.twitter.com/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
* ShortCode for follow button allowing content editors to add them inline.
* Allow different types of TwitterCard and make this configurable.