Make the arduino react to a tweet

Hi peeps!

I'm a fashion student in Amsterdam. My group is trying to make this interactive coat. We are not very experienced with the codes and programming and we have very little time left before our exhibition (1 week left). Can anyone help us with the code?

Basically what we want is when people tweet 'I love you' at our twitter page, the air tube inside the coat pumps up and then deflates.

I have an arduino atmega 328 and a wishield 2.0

I know how to make the arduino tweet by using SimpleTweet sketch but we need the reverse process.

Here is exactly the steps we want: 1. Arduino receives 'I love you' from twitter 2. Air compressor pumps the air tube for a few seconds 3. Deflates the tube

*We also need to program the arduino to recognize the time of each tweet so it only reacts to the latest tweet out of all the tweets.

Please if you know anything about the codes let me know!

Due to the complexity of using the twitter API you want a PC (webserver, probably) to handle scannign twitter to find a new and relevant tweet, then open a socket to the arduino and send the command to puff up. You'll have to google about the twitter API, but it requires the use of oauth these days so older code won't work.

Have a look at the chat server example - that'll give you a good start on setting the arduino as a server. Have it wait for a machine to connect and send a particular command.

edit: It might be easier to have the arduino ask the server if there are any new tweets. So your arduino would visit http://YourServer.com/something.php and would be returned a Y or N for whether it should puff up or not.

We are not very experienced with the codes and programming and we have very little time left before our exhibition (1 week left).

If you want to have a snowball’s chance in hell of making that deadline, you better have some money (lots of money) to throw at the hardware/programming portion of this project.

:o

Using Twitter4J on a host PC and a little webserver magic the code for this could be accomplished in less than an hour.

However you need to be aware that you can't query Twitter more than twice a minute, so if you get a lot of activity the pump will simply activate once every 30 seconds like clockwork. More cunning programmers would process the times of multiple tweets received and spread out the events over a 30 or 60 second window for a realtime effect, though delayed slightly.

Using Twitter4J on a host PC and a little webserver magic the code for this could be accomplished in less than an hour.

macegr, I'm not going to say doing this is impossible, but given the following:

I'm a fashion student in Amsterdam. My group is trying to make this interactive coat. We are not very experienced with the codes and programming and we have very little time left before our exhibition (1 week left).

...unless they can find somebody who is experienced in the short amount of time they have (which isn't impossible; I've seen far larger projects come about in a shorter amounts of time) - they're going to find it difficult if not impossible for them to implement it.

What I find curious is how long have they had this project to do, and how much of their time budget was spent on the important part of the hardware/software interface? Why was this left to "last minute"; why wasn't it developed concurrent with the development of the garment itself?

It appears that this was a project that requires a bit of planning and coordination in order for it to be successfully implemented, and someone somewhere dropped the ball.

Good luck on the implementation - you'll need all you can get!

:)

Yeah, it may not be possible for them.

But if they do pull it off, Twitter clothes are SO last season anyway. Didn't Imogen Heap have a Twitter dress at the Grammys? :)

I think it would be more fun to use a couple of servos and make a web controlled "flasher" coat. :)

Interesting point about the amount of traffic.

Perhaps the original poster could have the arduino query the web server every 30 seconds, and the web server return an integer representing how many relevant tweets were received in the last 30 seconds. The arduino could then inflate the whatsit accordingly.