Mike Taulty's Blog
Bits and Bytes from Microsoft UK
WPF and "Twistori": Part 1
Mike Taulty's Blog

Mike's Badges

Follow on Twitter
View mike's profile on slideshare
Add to Technorati Favorites
CW Blog Awards

I don't really use Twitter but I'm surrounded by folks that do and I'm more and more aware of its impact as if you turn up to any kind of event or gathering these days then you'll know that someone will come along and say whether it's being reported well/badly in the various tweets that it's generating.

Because of this, I wasn't aware of "Twistori" but Marc pointed it out to me the other week and said that it'd be cool if we had an internal application that did something similar that we could maybe use to display on a plasma TV somewhere or perhaps on a projector.

So, I set about building something simple with WPF that uses the Twitter (RESTful) API ( I stress that word "simple" as I didn't really want to go off into days and days of effort :-) and so I thought I'd share that here.

Ultimately, the application ended up looking like this;

image

and it has an application configuration file that looks like this;

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="searchTermsConfiguration"
             type="SearchTermsConfig.SearchTermsConfiguration,TwitterAtomFeedLibrary"/>
  </configSections>
  
  <!-- Set language to "en", "fr", etc. -->
  
  <searchTermsConfiguration language="en">
    <searchTerms>
      <!-- isIncluded is a bool (true/false) which can be changed in the UI anyway -->      
      <!-- filter is an enum which can be;
            Positive
            Negative
            PositiveAndNegative (not the same as "All" below)
            All
      -->
      <searchTerm term="Microsoft"
                  isIncluded="true"
                  filter="All"/>

      <searchTerm term="Windows"
                  isIncluded="true"
                  filter="All"/>

    </searchTerms>
  </searchTermsConfiguration>
</configuration>

which drives what it does which is, essentially;

  1. Wake up every N seconds
  2. Visit the next search term in the list up on the left (Microsoft, Windows, etc) that has flagged itself as being active
  3. Check to see if we have some stored ATOM items for that search term. If not, go grab up some of those things from Twitter and move to the next term whilst they download asynchronously
  4. Once we find an ATOM item, display it in the area on the right of the screen and highlight which search term it relates to in the listbox on the left hand side of the screen.

so, it's pretty simple and the UI largely involves a ListBox, some CheckBoxes, some TextBlocks, an Image and a few layout panels and animations.

Note that the background image is taken from www.hdwallpapers.net so I'm not sure whether I should really be distributing it like this and I'll take it out if someone asks me to.

Here's the app for download. All bugs mine (of course) and I know there's one or two in there. The next post will start to look at putting something very similar to this together.


Posted Wed, Nov 19 2008 3:10 AM by mtaulty
Filed under:

Comments

Mike Taulty's Blog wrote WPF and &amp;quot;Twistori&amp;quot;: Part 2
on Wed, Nov 19 2008 3:14 AM
Following on from the previous post, to get this work started I wanted to build a little library that...
Marc: My Words wrote WPF Twitter Search Kiosk Thing
on Wed, Nov 19 2008 4:45 AM
WPF Twitter Search Kiosk Thing
Marc: My Words wrote WPF Twitter Search Kiosk Thing
on Wed, Nov 19 2008 4:45 AM
Talking of great examples, MikeT had a crack at the Twistori thing that MikeO looked at but took a slightly
Dew Drop - November 19, 2008 | Alvin Ashcraft's Morning Dew wrote Dew Drop - November 19, 2008 | Alvin Ashcraft's Morning Dew
on Wed, Nov 19 2008 5:39 AM
Mike Taulty's Blog wrote WPF: Experiment with Text Animation
on Thu, Nov 20 2008 10:09 AM
I wanted to experiment with text animation. Specifically, I wanted a control that would display some...
Reflective Perspective - Chris Alcock » The Morning Brew #228 wrote Reflective Perspective - Chris Alcock &raquo; The Morning Brew #228
on Fri, Nov 21 2008 12:29 AM
2008 November 21 - Links for today « My (almost) Daily Links wrote 2008 November 21 - Links for today &laquo; My (almost) Daily Links
on Fri, Nov 21 2008 12:32 AM
techroom wrote Mike Taulty o programowaniu w WPF
on Mon, Dec 8 2008 11:56 AM
Mike Taulty o programowaniu w WPF
(C) Mike Taulty, 2009. All rights reserved. The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems