A Speakerrate comments badge or another reason to love Twitter

Another reason to love Twitter: You ask for APIs and you get them. As requested in my Tweet, speaker rate acted very quickly and build an API
for latest comments – and here is my thank you. Using a bit of YQL magic and some JavaScript I put together a badge to show off the latest speakerrate comments on your page:

Speakerrate Badge Test by  you.

Check out the demo page of the badge and get the source and read the docs on GitHub.

Usage:

Simply add a DIV with a link to your speaker page on speakerrate:

<div id="speakerratebadge">
  <a href="http://speakerrate.com/speakers/3543-christian-heilmann" id="speakerratelink">Rate me on Speakerrate</a>
</div>

Then add the script and call the init() method:

<script type="text/javascript" 
src="http://github.com/codepo8/speakerrate-badge/raw/master/speakerratebadge.js"></script>
<script type="text/javascript">
speakerratebadge.init();
</script>

You can also provide a few options to the init() method to change the look and features of the badge:

<script type="text/javascript" 
src="http://github.com/codepo8/speakerrate-badge/raw/master/speakerratebadge.js"></script>
<script type="text/javascript">
speakerratebadge.init(
  {
    amount:3, /* amount of comments */
    styled:true, /* Boolean if the style here should be pulled and applied */
    headerText:'Comments:' /* Text of the header above the comments */
  }
);
</script>

If you need different styles, just use styled:false or override the ones applied.

Tags: , , , ,

Leave a Reply

Wait till I come! is the blog of Christian Heilmann , a developer evangelist living and working in London, England. Download vcard.

Feed me, Seymour: Entries (RSS) and Comments (RSS).