Tweetsheets – Twitter Directly From Within Google Docs

We love being social. Fortunately, our boss does, too, which means that we are encouraged to use social networks like Facebook and Twitter at work. It has come to our attention that there are other companies where being social is not appreciated quite as much. Imagine sitting in a boring cubicle office with lots of boring colleagues. You can’t use Twitter, Tweetdeck or any other mechanism to be social online because your colleagues or your boss would get really upset with you. Imagine that you then, all of a sudden, find this incredibly funny memes you want to share! What should you do?

Well, we have the solution for you and it is called Tweetsheets aka “Use Twitter directly in your Google Doc, so no one will ever blame you for being social again”!

You remember our annual summercamp, where we built lots of crazy stuff? 4 weeks ago I wrote about a mechanism to automatically share your e-mails in your facebook stream. That was not our only spreadsheet-based project: One nightly coding session, Tweetsheets was born. We we’re really impressed how fast the client was finished. Everything you need is provided by Google Apps Script, even the OAuth-part! Lovely!

You are now probably wondering: “How do I get Tweetsheets?”. The good news is: You don’t have to install anything. Just copy/paste our code directly into your Google Spreadsheet. The bad news: There is no bad news!

Here’s what you have do do:

How to install Tweetsheets

Create a Twitter App at https://dev.twitter.com/apps/new (all settings up to; you need read/write access; callback url has to be https://spreadsheets.google.com/macros) *

Write down your Consumer key and Consumer Secret

Go to your Google Drive (formerly known as Google Docs) and create a new Spreadsheet

From now on, feel free to update your timeline, based on your stress-level at work. For the really busy ones: You can fetch your timeline on a time-based level. Go to Script Editor > “Resources” > “Current script trigger’s” and add a time-based trigger for the “refreshTimeline” action. My copy of Tweetsheets, for example, has been running for almonst 4 weeks with automatic updates every minute!

Is that all? I can only read my Twitter home timeline in a spreadsheet?

Nooooooo! Tweetsheets is not read-only. You can, of course, tweet as well! Just click on “Tweetsheet” in the menu bar and choose “Tweet”.

Enter your tweet text (e.g. “Wow, just stumbled upon this nice blog post from @jollife: He realised a twitter client directly in google docs”, or “the lulz. look what funny facebook memes @diesocialisten made!”). Hit the “Send tweet” button and there you go: Boom! You just published your first tweet from a spreadsheet.

But wait, there’s more!

Retweet, Reply, Fave. It’s all there! You only need to know how:

Head over to the column right after the tweet you’re interested.

Choose your action:

Enter “<3” for fave.

Enter “RT” for Retweet.

Enter “reply” for reply.

Watch the magic happens!

But be quick: If the timeline refreshes while you are typing, you might just fave the wrong tweet. Let me get this straight: I am not responsible for any future girl- or boyfriend trouble you might get for faving other girls’ (or boys’) tweets!

Here’s your task for today: Get yourself this perfect, boring-looking, but super awesomely coded Twitter client in 11 easy steps (see above)! Now you can be social again!

As I have already told you, we at Die Socialisten love being social (it’s even in our name!). So we wanted to share with you the raw emotions that erupted when the first tweet published via Tweetsheets (the noisy and funny part starts at 00:40).

Caveat:

We’re not sure why, but retweeting and faving doesn’t work reliably all the time. We haven’t figured out why, but maybe YOU know the answer? Feel free to fork the code, or to use it in your own projects. We would love to hear feedback from you. Have fun with it: https://gist.github.com/3303060 (yeah, a complete twitter client with read, write, fave, retweet, reply in only 240 lines of code! yiiiha!)

Do you know other fun uses for a Google Docs or Excel environment? Tell us in the comments!

Spread the ♥:

About Author

Johannes is CTO here at Die Socialisten and always looking for ways to optimize his code. He thinks that the best moment to start something is always now. Follow him on Twitter, Facebook or on Google+!

Comments

It seems this script could easily be extended to schedule tweets. Entering one at a time is no better than what you can do in other apps. But scheduling tweets from a spreadsheet in which the content of the tweet is dynamic… that’d be something!

How would I be able to alter the code to read the the cells in column 1 and tweet the message in these cells. i.e. If Cell(1,1) = “hi”, “hi” would be sent as a tweet, Cell(1,2) = “go”, “go” would be sent as a tweet.

hi dev! absolutely, but you have to completely rewrite the code :) checkout the facebook developer center for all relevant documentation to the apis (https://developers.facebook.com/) and please let me know, if you manage to rewrite the code!