Skip to content

Instantly share code, notes, and snippets.

@SecureCloud-biz
Forked from niraj-shah/tweet_tracking.html
Created July 13, 2014 00:19
Show Gist options
  • Save SecureCloud-biz/8125879ee908f4bf1615 to your computer and use it in GitHub Desktop.
Save SecureCloud-biz/8125879ee908f4bf1615 to your computer and use it in GitHub Desktop.
<!-- Include the twitter JS library -->
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<!-- Tweet button with just text -->
<p><a href="https://twitter.com/intent/tweet?text=My first tweet using Web Intents">Tweet</a></p>
<!-- Tweet button with link and text -->
<p><a href="https://twitter.com/intent/tweet?url=http://www.webniraj.com/2013/08/08/twitter-api-tracking-tweets-using-web-intents/&text=Tracking tweets using Web Intents:"><img src="https://dev.twitter.com/sites/default/files/images_documentation/bird_blue_48.png" /></a></p>
<script type="text/javascript">
twttr.ready(function (twttr) {
// bind to the tweet event
twttr.events.bind('tweet', function( event ) {
// add ajax call here to store the tweet details
// i.e. increment a counter in your database
console.log( event );
} );
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment