Federated Search – Twitter

By | 2011-11-29

Wanted to share this little sample federated search location with you. Twitter has a search site where you can search for tweets:

http://search.twitter.com

It also has a atom feed for results:
http://search.twitter.com/search.atom?q={searchTerms}
SharePoint supports OpenSearch and with this Atom feed by Twitter we can create a OpenSearch reference as a Federated Search Location in SharePoint. With this and a piece of xsl (more xsl is in the osdx below) we can format the tweets ( search results) fairly easy:

<div style="float:left;width:50px;" xmlns="">
  <a id="{concat($CurrentId, '_Title')}p" href="{ddwrt:EnsureAllowedProtocol(string($authorlink))}" title="{$author}" class="externallink" xmlns="">
    <img src="{$authorimage}" alt="{$author}" border="0" title="{$author}" xmlns=""/>
  </a>
</div>
<div style="margin-left:53px" class="tweet" xmlns="">
  <a id="{concat($CurrentId, '_Title')}" href="{ddwrt:EnsureAllowedProtocol(string($link))}" class="externallink" xmlns="">
    tweeted
  </a>:
  <xsl:value-of select="$content" disable-output-escaping="yes" />
</div>

You can create a twitter federated search location for SharePoint 2010:
twitter-fed-search-01

Download the sample twitter.osdx.

Instructions on how to add a Federated Search Location can be found here.

And others have similar posts available too.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.