Last active
December 11, 2015 02:18
-
-
Save masutaka/4529427 to your computer and use it in GitHub Desktop.
chalow plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Link to the Twitter account | |
| # usage: {{twitter('ACCOUNT')}} | |
| # Ex. {{twitter('masutaka')}} | |
| sub twitter { | |
| my ($account) = @_; | |
| return qq(<a href="https://twitter.com/${account}" target="_blank">\@${account}</a>); | |
| } | |
| ### Embedded Tweet | |
| # usage: {{tweet('URL')}} | |
| # Ex. {{tweet('masutaka', '270811664381800449')}} | |
| sub tweet { | |
| my ($account, $id) = @_; | |
| my $url = "https://twitter.com/${account}/status/${id}"; | |
| return qq(<blockquote class="twitter-tweet" lang="ja">). | |
| qq(<p>loading...</p><a href="${url}"></a>). | |
| qq(</blockquote>). | |
| qq(<script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>); | |
| } | |
| ### Embedded Speaker Deck Presentation | |
| # usage: {{speakerdeck_f('data-id', 'width')}} | |
| # Ex. {{speakerdeck_f('1dbdcc8016220130deb212313d02fc9b')}} | |
| sub speakerdeck_f { | |
| my ($data_id, $width) = @_; | |
| $width = 528 if not defined $width; | |
| return qq(<div style="width:${width}px;">). | |
| qq(<script src="//speakerdeck.com/embed/${data_id}.js">). | |
| qq(</script></div>); | |
| } | |
| ### Miil Image | |
| # usage: {{miil('data-id', 'width')}} | |
| # Ex. {{miil('m74m')}} | |
| # Refer. https://github.com/FrogAppsDev/miil-apis/tree/master/Japanese | |
| sub miil { | |
| my ($data_id, $width) = @_; | |
| $width = 240 if not defined $width; | |
| my $base_uri = "http://miil.me/p/${data_id}"; | |
| return qq(<a href="${base_uri}" target="_blank">). | |
| qq(<img src="${base_uri}.jpeg?size=${width}"></a>); | |
| } | |
| ### Instagram Image | |
| # usage: {{instagram('data-id', 'size(t,m,l)')}} | |
| # Ex. {{instagram('J9ceVKwNOZ')}} | |
| # Refer. http://instagram.com/developer/embedding/ | |
| sub instagram { | |
| my ($bug, $size) = @_; | |
| $size = 'm' if not defined $size; | |
| my $base_uri = "http://instagr.am/p/${bug}"; | |
| return qq(<a href="${base_uri}" target="_blank">). | |
| qq(<img src="${base_uri}/media/?size=${size}"></a>); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://masutaka.net/chalow/2013-01-14-2.html