20. January 2010 21:43
UPDATE: The feed changed a little bit from the first time I published the format
I made changes to the twitter feed format to match the game for the FIRST FRC 2010 Season. You can follow the tweets for this season at http://twitter.com/Frcfms
The new format is as follows:
#FRCABC - where ABC is the Event Code. Each event has a unique code.
TY X - where x is P for Practice Q for qualification E for Elimination
MC X - where X is the match number
RF XXX - where XXX is the Red Final Score
BF XXX - where XXX is the Blue Final Score
RE XXXX YYYY ZZZZ - where XXXX is red team 1 number, YYYY is red team 2 number, ZZZZ is red team 3 number
BL XXXX YYYY ZZZZ - where XXXX is blue team 1 number, YYYY is blue team 2 number, ZZZZ is blue team 3 number
RB X - where X is the Bonus the Referee gave to Red
BB X - where X is the Bonus the Referee gave to Blue
RP X - where X are the Penalties the Referee gave to Red
BP X - where X are the Penalties the Referee gave to Blue
RG X - where X is the Goals scored by Red
BG X - where X is the Goals scored by Blue
RGP X - where X is the Goal Penalties by Red
BGP X - where X is the Goal Penalties by Blue
Example tweet in text:
#FRCTEST TY Q MC 2 RF 5 BF 3 RE 3224 2119 547 BL 587 2420 342 RB 1 BB 1 RP 0 BP 0 RG 0 BG 5 RGP 2 BGP 1
I sure would like to know if anyone builds anything that parses these tweets.
10. March 2009 21:01
I added twitter posts to the FIRST FRC Field Management System, so that interested parties could get the results of a match in near real time. Since twitter is focused around sending small messages I thought it would be a great mechanism to notify team members when the status of the build changes. Most build solutions have a way already to do this, but they come in the form of an email or a custom program that sits in your tray waiting to notify you. Twitter messages on the other hand can be consumed many different ways (web, twitter client, cell phone etc). This gives great flexibility on how each team member decides on how he/she want to monitor the build process. In this blog post I will show you how you can add twitter build notifications to a build process.
First you should get a twitter account so you can tell your team members what account they should follow to get the notifications. You might want to set up your twitter account as private so you can manage who is allowed to follow. Also this brings up a good point as you should not send any sensitive data in your build message tweet because the messages are sent across the wire and anyone can intercept them.
Next go get the Yedda Twitter C# Library. This is a C# wrapper around the Twitter API. It is very easy to use. You can use the binary from the project or use the Twitter class that is part of the project.
All build processes that I have used (TFS, NANT, CCNET, and MSBUILD) allow for command line applications to be called from the build script. So we will use the Twitter.cs class found in the Yedda C# Library in a console application to expose it's capabilities of sending twitter updates. Go ahead and create the Console application and add the Twitter.cs class to it. Then in the Program.cs Main method write some code to parse a few command line options to pass along to the Twitter,Update method.
Example command line call to the executable:
tc -user twitterUserName -password twitterPassword -message "Build 126.96.36.199 Failed to compile"
Example tweet generated from the above command line:
Now all you have to do is put the new console executable in a place on your build box that is accessible by the automated build and change your build script to call it with the right message. You can make the tweet a little more informative as to why the build failed, or you can have the build tweet at certain key points of the process so you know exactly what step the build is on. Be creative but don't send too many messages or the team members will soon ignore all build tweets as they end up being annoying.
Possibilities for improvement
- You could make a twitter client that monitors the build tweets and it parses the message from the build and reacts differently based on if the build failed on a compiler error or a unit test. Maybe some static analysis failed but it isn't severe enough to grant immediate attention. The client might attempt to grab the team members attention more if the severity of the message is high enough.
- What about a twitter client that parses the messages and controls a traffic red light. Green is build passed. Red is build failed. Yellow is unit tests failed.
TwitterBuildNotification.zip (6.46 kb)