Social world is emerging and Twitter is one of the famous components. It is quite easy to integrate twitter tweets to the XPages.

What are the advantages of Integrating Twitter into the XPages?

  • You don’t want to look into other browser pages to look for feeds
  • Social Collaboration and day to day activities can be update easily in your intranet environment

How to integrate?

Step 1: You need to include twitter,js file in resources

<xp:this.resources>
<xp:script src=”/twitter.js” clientSide= “true”></xp:script >
</xp:this.resources>

Step 2: Include the twitter api script from the twitter side to XPages

<script src=”http://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js”; ></script>
<script type=”text/javascript” charset=”utf-8″>
getTwitters(‘tweet’, {
id: ‘xpages’,
count: 10,
enableLinks: true,
ignoreReplies: true,
clearContents: true,
template: ‘”%text%” <a href=”http://twitter.com/%user_screen_name%/statuses/%id%/”; >%time%</ a>’
});
</script>

Step 3: To tweet to a specific account – for this you need to login to your twitter account

<a href=”https://twitter.com/share?text=@maargasystems”;
data-lang=”en”
data-related=”anywhere:The Javascript API,sitestreams,twitter:The official account”>
Tweet
</a>

I will update you with the details of retweeting, follow buttons in the next post.

*Note: The API of the twitter may change look at the twitter site for the update API