Perspective View

grasshopper + twitter + firefly = architecture

Perspective View

This was an old post that I made some time ago and got lost when I migrated my website to WordPress. I will try and dig out some of them if I deem them interesting enough. This tutorial will illustrate how to create an online data stream that will be able to receive Direct Messages from Twitter in order to stream data into Grasshopper and eventually set some parameters. It’s called an Internet of Things and it will eventually allow you to use your Twitter to control a small mock-up via Arduino Microcontroller.

First things first. In order to complete this tutorial you will need a few things:

1. Grasshopper for Rhino (download).
2. Firefly for Grasshopper (download).
3. Set up a Cosm account. Visit: (I am not sure if this is still a valid service. Try Xively if Cosm no longer exists
4. Set up a Twitter account. Visit:
5. Optionally instead of Firefly you can use an XML Read Component from gHowl plug in for Grasshopper (download).

Part one of the tutorial explains how to create the necessary geometry to create the pavilion.

Part two of the tutorial explains how to set up the Cosm server and subsequent feeds that we will need to control the Pavilion.

Below is a step by step on how to create a connection between your Twitter and Cosm so you can stream data to Grasshopper by Tweeting it.

Twitter/Cosm instructions:

1. Create a new account on Twitter or use your existing.

2. Create a new account on Cosm or use your existing.

3. Create a new Manual Feed in your account. Take note of your feed ID as you will need it later. Make sure that it is set to “public” and that you checked the option that “you will push data to Cosm”.

4. From your account, tweet the following message:

follow pachtweet

Just type it in your “Compose new Tweet” box. That will make you follow @pachtweet on Twitter. This is called sending a public tweet. The user pachtweet will now act as a courier delivering messages between you and your Cosm account.

5. Tweet this message:

@pachtweet connect
Use the same tweet entry box as before. the “@pachtweet” designates a recipient of the message and “connect” is the message itself. Wait for the user pachtweet to send you a Direct Message. Direct Messages can be found under the “Me” tab and then below your description there is an envelope icon. Click on that to see Direct Messages.

5. Reply to pachtweet’s DM (Direct Message) with this text:


YOUR_COSM_KEY can be found if you click on the “Keys” tab on the right hand side of your main account window. Tutorial part two explains which API Key to use. This is a one time authentication process , allowing only your Twitter account to access the feed.

You are now ready to send commands to your Cosm feeds by using Direct Messages in

6. To begin controlling your Grasshopper Kinetic Pavilion, send a DM to pachtweet that follows this format:

“set” is a prefix that tells pachtweet you want to enter new data into a feed. “FEED_ID” designates the feed id where you want to send the data. It’s the number that I asked you to remember from step 3. “STREAM” designates the data to be sent. Stream are ordered sequentially by commas with no spaces. You may have multiple Streams in a single feed (I explained how to create those in the part two of the video tutorial). Streams will be listed on your feed in the same order you enter them here. An example of this command can be written like this:

set 132222 255,666

This sets feed id: 132222 to values 255 and 666. This means there is two data streams.

7. There is also to send direct messages to Cosm via your cell phone. From your Twitter account click on “Settings” and then click “Devices”, and follow the on screen instructions to set up your cellphone. Note that updates should be sent to 40404 while in the United States. See the Twitter Phone FAQ for dialing Twitter from other countries:

Cell phone DMs follow a similar format when updating a Cosm feed:

d pachtweet set FEED_ID STREAM0,STREAM1,STREAM2…
“d” is a prefix that tells Twitter that you want this to be a Direct Message. “pachtweet” designates a recipient of the DM. The rest is the same as step 6.

All right, looks like you know how to model the geometry using Grasshopper, update Cosm feeds using Twitter, so you are ready to start using the real Internet of Things. I hope you enjoyed it.




You can watch a two part series on this workflow via my YouTube channel:

Part 1:

Part 2:


  1. Luke says:

    Wow, this post is certainly ‘out there’! Good job.

  2. Nicholas Tai says:

    Wow! Such an inspiring post! Guess I’ll be learning a lot from your site during summer. I’m currently a year 2 architecture student and starting to have great interest in learning grasshopper. I’m glad that I’ve stumbled across this site while googling for grasshopper tutorials. Thank you :)

Leave a Comment