Skip to content

Instantly share code, notes, and snippets.

@intents
intents / render_intents.html
Created March 30, 2011 14:58
A simple example
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<p><a href="http://twitter.com/intent/tweet?in_reply_to=51113028241989632">Reply</a></p>
<p><a href="http://twitter.com/intent/retweet?tweet_id=51113028241989632">Retweet</a></p>
<p><a href="http://twitter.com/intent/favorite?tweet_id=51113028241989632">Favorite</a></p>
@intents
intents / intents.html
Created March 30, 2011 14:50
Invoke Intents
<script type="text/javascript">
(function() {
if (window.__twitterIntentHandler) return;
var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
width = 550,
height = 420,
winHeight = screen.height,
winWidth = screen.width;