Skip to content

Instantly share code, notes, and snippets.

@brenthall
Created June 22, 2012 01:05
Show Gist options
  • Save brenthall/2969631 to your computer and use it in GitHub Desktop.
Save brenthall/2969631 to your computer and use it in GitHub Desktop.
Show User Tweets: Renders specified number of latest tweets for specified user
<#macro tweets username, count = 5, include_rts=true>
<#local callbackFn = "twitterCallback_" + username + "_" + count?c/>
<#local layout>
<#nested/>
</#local>
<script type="text/javascript">
function ${
callbackFn}
(json) {
var template = "${layout?replace('"', '\\"')?replace("\n", "")?replace("\r", "")}";
twitterCallback(json, template);
}
</script>
<script type="text/javascript" src="http://api.twitter.com/1/statuses/user_timeline.json?screen_name=${username}&amp;callback=${callbackFn}&amp;count=${count}&amp;include_rts=${include_rts?string}">
</script>
</#macro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment