Nonsense White October Hutchhouse

24HOUR-STARTUP.COM

26 Nov – 27 Nov 2009

Nifty Twitter thing

Posted on | November 27, 2009 | No Comments

UPDATE: This is now working… try following @Dr_Hue on Twitter and he’ll get back to you with some product recommendations based on the colours in your profile pic!

Mid morning (approximately 5am) Matt wrote a nice little routine that we will be using once the main Dr Hue site is up and running. In layman’s terms if you follow Dr Hue on twitter then we’ll look at your profile pic, take the average picture and send your link to the site which will display products to you based on your colour.

Nifty Twitter message

It’s pretty nifty… or as the developer put it:

  • Gathered a bunch of little snips of code to talk to Bit.ly (From JWards), Twitter (some guy called Tijs Verkoyen)
  • Wrote a little widgit based on stuff in the PHP documentation to work out image average colour
  • Wrote a little widgit to log already-seen friends so we don’t bother people with multiple direct messages
  • Glued it all together so that:
    • Requests a list of Followers from Twitter
    • Checks for new Followers in that list
    • For each of the new Followers, we grab their Twitter profile pic…
    • …average its colour…
    • …then fire off a DM using the same Twitter module with a friendly message and a (hopefully) relevant link!

Comments

Leave a Reply