Thursday, June 25, 2009

What color is Twitter?

En route to another thing I'm working on, I built a little color scraper that scans the Twitter public timeline for words describing colors. Any word that is a CSS3 web color name (which some of you graybeards may remember as similar to, but not exactly, the X11 colors), is detected and the corresponding R, G, B triple is saved. For example, consider the following tweet:

Finally found the WoW Mt. Dew Game few...the red one is good, but the blue one tastes like ass...

Because I only grabbed the first color in a tweet, the above results in red (255,0,0). Getting a few hundred of these took a day (6/24/2009), as the Twitter API limits how often you can query it. Consequently, most color tweets were missed. However I got enough to make the picture above, where every pixel corresponds to a tweet mentioning that color.

Some things to note:

  • ☞ There's a lot of green in there, no doubt due to #iranelection
  • ☞ Many color names were metonyms not used to actually describe colors (e.g. White House, "green energy industry")
  • ☞ Other occurrences were names from popular culture: e.g. Chris Brown, Black Eyed Peas, Pink.
  • White and black seem to be especially popular descriptions of pets
  • ☞ Though not statistically significant, no occurrences of the colors described as "PapayaWhip" or "LavenderBlush" were observed.
  • ☞ Though rarely tweeted, I treated hex color codes as valid colors (e.g. "#00FF00"). This caught a few hashtags, (e.g "#ace") for a little random spice.

Though an obvious next step would be to hook this up to some kind of color-changing LED display, I have a slightly more interesting idea. Stay tuned...

For your amusement, here is a text file with 300 color triples and the tweets that generated them.

Right, credit due! This was totally easy thanks to Python Twitter Tools and the webcolors library.

Tagged: projects



RSSicon.png  RSS feed