Added TweetExtension

This commit is contained in:
Oliver Davies 2016-03-29 10:11:37 +01:00
parent ad6a00b003
commit 1ed53d7357
8 changed files with 59 additions and 14 deletions

View file

@ -26,11 +26,8 @@ tweets: yes
{% endblock %}
{% block feedback %}
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a></p>&mdash; CURVE (@CurveAgency) <a href="https://twitter.com/CurveAgency/status/440095250775035904">March 2, 2014</a></blockquote>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Great presentation by <a href="https://twitter.com/opdavies">@opdavies</a> on git flow at <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> very well prepared and presented. <a href="http://t.co/tDINp2Nsbn">pic.twitter.com/tDINp2Nsbn</a></p>&mdash; Greg Franklin (@gfranklin) <a href="https://twitter.com/gfranklin/status/440104311276969984">March 2, 2014</a></blockquote>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> Thanks for the talk today on git flow. Looking forward to use it. <a href="https://twitter.com/hashtag/drupalcampldn?src=hash">#drupalcampldn</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> <a href="https://twitter.com/hashtag/git?src=hash">#git</a></p>&mdash; Drupal Cafe UK (@drupal_cafe) <a href="https://twitter.com/drupal_cafe/status/440119608939278338">March 2, 2014</a></blockquote>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/DrupalCampLDN">@DrupalCampLDN</a> always had trouble with git. Your talk + Git flow has made it all very easy.</p>&mdash; James Tombs (@jtombs) <a href="https://twitter.com/jtombs/status/440108072078696449">March 2, 2014</a></blockquote>
{{ tweet('Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a></p>&mdash; CURVE (@CurveAgency) <a href="https://twitter.com/CurveAgency/status/440095250775035904">March 2, 2014</a>')|raw }}
{{ tweet('Great presentation by <a href="https://twitter.com/opdavies">@opdavies</a> on git flow at <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> very well prepared and presented. <a href="http://t.co/tDINp2Nsbn">pic.twitter.com/tDINp2Nsbn</a></p>&mdash; Greg Franklin (@gfranklin) <a href="https://twitter.com/gfranklin/status/440104311276969984">March 2, 2014</a>')|raw }}
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> Thanks for the talk today on git flow. Looking forward to use it. <a href="https://twitter.com/hashtag/drupalcampldn?src=hash">#drupalcampldn</a> <a href="https://twitter.com/hashtag/dclondon?src=hash">#dclondon</a> <a href="https://twitter.com/hashtag/git?src=hash">#git</a></p>&mdash; Drupal Cafe UK (@drupal_cafe) <a href="https://twitter.com/drupal_cafe/status/440119608939278338">March 2, 2014</a>')|raw }}
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/DrupalCampLDN">@DrupalCampLDN</a> always had trouble with git. Your talk + Git flow has made it all very easy.</p>&mdash; James Tombs (@jtombs) <a href="https://twitter.com/jtombs/status/440108072078696449">March 2, 2014</a>')|raw }}
{% endblock %}

View file

@ -31,5 +31,5 @@ I categorised the technical changes into groups for site builders, developers an
{% endblock %}
{% block feedback %}
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Cool to hear how much new stuff is in <a href="https://twitter.com/drupal">@drupal</a> 8. Integrating with more third party code rather than rolling their own. <a href="https://twitter.com/hashtag/phpsw?src=hash">#phpsw</a></p>&mdash; Tom Robertshaw (@bobbyshaw) <a href="https://twitter.com/bobbyshaw/status/585882859631706114">April 8, 2015</a></blockquote>
{{ tweet('Cool to hear how much new stuff is in <a href="https://twitter.com/drupal">@drupal</a> 8. Integrating with more third party code rather than rolling their own. <a href="https://twitter.com/hashtag/phpsw?src=hash">#phpsw</a></p>&mdash; Tom Robertshaw (@bobbyshaw) <a href="https://twitter.com/bobbyshaw/status/585882859631706114">April 8, 2015</a>')|raw }}
{% endblock %}

View file

@ -27,5 +27,5 @@ This session covered how to install Sculpin itself, as well as how to use it to
{% endblock %}
{% block feedback %}
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Twig said &#39;foo&#39;, then Sculpin said &#39;bar&#39;. They agreed to go spaceless ;-)&#10;&#10;Interesting talk by <a href="https://twitter.com/opdavies">@opdavies</a> &#10;<a href="https://twitter.com/hashtag/dcnorth15?src=hash">#dcnorth15</a> <a href="http://t.co/26GmhiCdfJ">http://t.co/26GmhiCdfJ</a></p>&mdash; Stefan van Hooft (@hooftio) <a href="https://twitter.com/hooftio/status/624898550158200832">July 25, 2015</a></blockquote>
{{ tweet('Twig said &#39;foo&#39;, then Sculpin said &#39;bar&#39;. They agreed to go spaceless ;-)&#10;&#10;Interesting talk by <a href="https://twitter.com/opdavies">@opdavies</a> &#10;<a href="https://twitter.com/hashtag/dcnorth15?src=hash">#dcnorth15</a> <a href="http://t.co/26GmhiCdfJ">http://t.co/26GmhiCdfJ</a></p>&mdash; Stefan van Hooft (@hooftio) <a href="https://twitter.com/hooftio/status/624898550158200832">July 25, 2015</a>')|raw }}
{% endblock %}

View file

@ -34,5 +34,5 @@ In each point, tried to cover the differences between Drupal core and developing
{% endblock %}
{% block feedback %}
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/Horls">@Horls</a> <a href="https://twitter.com/mhwelander">@mhwelander</a> <a href="https://twitter.com/ThisisZone">@ThisisZone</a> <a href="https://twitter.com/mozzy16">@mozzy16</a> Thanks for a top night of knowledge sharing! <a href="https://twitter.com/hashtag/drupal?src=hash">#drupal</a> <a href="https://twitter.com/hashtag/episerver?src=hash">#episerver</a> <a href="https://twitter.com/hashtag/sitecore?src=hash">#sitecore</a> <a href="https://twitter.com/hashtag/umbraco?src=hash">#umbraco</a> <a href="https://twitter.com/hashtag/h5yr?src=hash">#h5yr</a></p>&mdash; umBristol (@umBristol) <a href="https://twitter.com/umBristol/status/636290498362216449">August 25, 2015</a></blockquote>
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/Horls">@Horls</a> <a href="https://twitter.com/mhwelander">@mhwelander</a> <a href="https://twitter.com/ThisisZone">@ThisisZone</a> <a href="https://twitter.com/mozzy16">@mozzy16</a> Thanks for a top night of knowledge sharing! <a href="https://twitter.com/hashtag/drupal?src=hash">#drupal</a> <a href="https://twitter.com/hashtag/episerver?src=hash">#episerver</a> <a href="https://twitter.com/hashtag/sitecore?src=hash">#sitecore</a> <a href="https://twitter.com/hashtag/umbraco?src=hash">#umbraco</a> <a href="https://twitter.com/hashtag/h5yr?src=hash">#h5yr</a></p>&mdash; umBristol (@umBristol) <a href="https://twitter.com/umBristol/status/636290498362216449">August 25, 2015</a>')|raw }}
{% endblock %}

View file

@ -32,5 +32,5 @@ You can [view the full slides](/slides/phpsw/building-static-websites-with-sculp
{% endblock %}
{% block feedback %}
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Simple and very cool use of video in <a href="https://twitter.com/opdavies">@opdavies</a> lightning talk <a href="https://twitter.com/phpsw">@phpsw</a> to show how to do things</p>&mdash; Stuart Herbert (@stuherbert) <a href="https://twitter.com/stuherbert/status/654367259339661312">October 14, 2015</a></blockquote>
{{ tweet('Simple and very cool use of video in <a href="https://twitter.com/opdavies">@opdavies</a> lightning talk <a href="https://twitter.com/phpsw">@phpsw</a> to show how to do things</p>&mdash; Stuart Herbert (@stuherbert) <a href="https://twitter.com/stuherbert/status/654367259339661312">October 14, 2015</a>')|raw }}
{% endblock %}

View file

@ -47,7 +47,7 @@ What we wont be covering:
{% endblock %}
{% block feedback %}
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> good talk on Getting started with Drupal 8 module development! 😀</p>&mdash; Michael trestianu (@Tresti88) <a href="https://twitter.com/Tresti88/status/706129843134570496">March 5, 2016</a></blockquote>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> Great talk. Thanks.</p>&mdash; John Bloomfield (@jbloomfield) <a href="https://twitter.com/jbloomfield/status/706131469148811264">March 5, 2016</a></blockquote>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/opdavies">@opdavies</a> definitely went well , I learnt from it , as did a others .</p>&mdash; tim marsh (@timmarsh) <a href="https://twitter.com/timmarsh/status/706214342027567104">March 5, 2016</a></blockquote>
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> good talk on Getting started with Drupal 8 module development! 😀</p>&mdash; Michael trestianu (@Tresti88) <a href="https://twitter.com/Tresti88/status/706129843134570496">March 5, 2016</a>')|raw }}
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> Great talk. Thanks.</p>&mdash; John Bloomfield (@jbloomfield) <a href="https://twitter.com/jbloomfield/status/706131469148811264">March 5, 2016</a>')|raw }}
{{ tweet('<a href="https://twitter.com/opdavies">@opdavies</a> definitely went well , I learnt from it , as did a others .</p>&mdash; tim marsh (@timmarsh) <a href="https://twitter.com/timmarsh/status/706214342027567104">March 5, 2016</a>')|raw }}
{% endblock %}

View file

@ -0,0 +1,44 @@
<?php
namespace AppBundle\Twig;
use Twig_Extension;
use Twig_SimpleFunction;
class TweetExtension extends Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getFunctions()
{
return [
new Twig_SimpleFunction('tweet', [$this, 'render']),
];
}
/**
* Render a tweet.
*
* @param string $tweet
* The content of the tweet.
*
* @return string
*/
public function render($tweet)
{
return sprintf(
'<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">%s</blockquote>',
$tweet
);
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'tweet';
}
}

View file

@ -3,6 +3,10 @@ services:
class: AppBundle\Twig\SpeakerDeckExtension
tags:
- { name: twig.extension }
app.twig.tweet:
class: AppBundle\Twig\TweetExtension
tags:
- { name: twig.extension }
app.twig.vimeo:
class: AppBundle\Twig\VimeoExtension
tags: