Twitter Search Web Part

The following will guide you through including Twitter searches and streams inside SharePoint pages. With Twitter API and RSS feeds, the process is simplified. Also, by using a different RSS or Atom Feed to start from, you may change from showing searches, mentions, direct messages, or other Twitter streams.

  • Step 1: Ensure the RSSBus Web Part is installed.
  • Step 2: Find the RSS or Atom Feed URL for the Twitter stream you want to display. For this example, Twitter search results are shown for the keywords "SharePoint" , "PowerShell", and �RSSBus� (this step can be skipped if you only want to see it work). When you are ready to try it with your own search or another Twitter stream, simply provide your URL. If you are unsure how to get this RSS feed, see the instructions are below:
    • Twitter Search: Visit search.twitter.com, perform your search, and look for the "Feed for this query" icon on the top right of the page.
    • Public Timeline: Visit your profile and look for the �RSS feed of user name's tweets� icon on the right side of the page.
    • Twitter Friends Timeline: Visit your profile and look for the "RSS feed" icon on the bottom right of the page.
    • Twitter Favorites: Visit your favorites page on Twitter and look for the "RSS feed for favorites" icon on the bottom right of the page.
    • Friends Timelines: Visit your friend�s page and look for the "RSS feed of friend's name tweets" icon on the right side of the page.

    Advanced Tip: Custom Twitter feeds can be made out of @replies, direct messages, or combined feeds by using the TwitterOps Connector. With the TwitterOps Connector, you have complete control enabling you to send direct messages, send replies, get following and follower lists, or combine two or more of the previous options into one feed. The easiest way to test TwitterOps before importing it into an actual Web Part is by using the RSSBus Server Admin Console.

  • Step 3: Add the RSSBus WebPart to your page and paste the following template into its source editor. Next, click "Apply". The Web Part will be rendered with the results of the Twitter search results for SharePoint, PowerShell, and RSSBus.
<rsb:info title="Twitter Search" >
  <input name="SearchPhrase" description="The search phrase to use." def="SharePoint OR PowerShell OR RSSBus"/>
</rsb:info>

<div style="height:60em;width:100%;overflow:auto;padding:10px">
  <rsb:call op="http://search.twitter.com/search.rss?q=[SearchPhrase]" pagesize="10">
    <div style="float:left;background-color:whiteSmoke;margin-bottom:20px">
      <div style="float:left;width:40px;margin-bottom:5px">
        <a href="[rss:link]"><img align="left" src="[google:image_link]" border="0" width="33px"/></a>
      </div>
      <div><a href="[rss:link]">[rss:author]</a></div>
      <div style="color:gray">[rss:pubDate]</div>
      <div style="float:left;width:100%">[rss:description]</div>
    </div>
  </rsb:call>
 </div>
  • Step 4: Customize the template for your specific needs. If you clicked "Apply" in the source editor of the Web Part, a new property appeared in the properties editor of the Web Part in your browser. Under "Web Part Inputs", you will find a new "SearchPhrase" input. Put your own search criteria here. Optionally, if you want to only show a stream such as your friend's timeline, replace the following line:
  • <rsb:call op="http://search.twitter.com/search.rss?q=[SearchPhrase]" pagesize="10">

    with this:

    <rsb:call op="ENTER_YOUR_URL_HERE" pagesize="10">

Note the pagesize="10". This tells the Web Part to only show 10 of the items in the feed. This option is customizable and can be removed to list all feeds.