Share via


Federated Search - Twitter

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

https://search.twitter.com

It also has a atom feed for results:

https://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: 

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

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

image

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.