- Create a new app at dev.twitter.com/anywhere/apps/new
a) Application Name = Name of your website
b) Application Website = Your website URL
c) Callback URL = Your website URL - Insert the following code into your html:
1
2
3
4
5
6
7
8
9
10<script src="http://platform.twitter.com/anywhere.js?id=YOUR_APP_ID&v=1"></script>
<script type="text/javascript">
twttr.anywhere(onAnywhereLoad);
function onAnywhereLoad(twitter) {
twitter.hovercards();
twitter('.follow-me').followButton("yourtwittername");
};
</script> - Job done. Grab a coffee and read more on the API docs
Demo:
* hover card – @markrocky || @markrocky
* follow button – #