Tag Archives: twitter

Side Project: Audubon

The Idea

A few weeks ago, I noticed a tweet from John Sheehan asking if there was an automated tweet -> screenshot tool:

Anyone know of a browser extension or something else that can turn a tweet into a single image for presentations, etc?I thought it was a pretty interesting concept that would be fairly easy to implement and had a small enough scope that I could use it to learn some more Javascript. After playing around with Ghost Inspector, I knew it would be possible to render a screen capture of a webpage. I just needed to implement the logic for figuring out what area of a page to render, rather than the whole page.

The Solution

I played around with CasperJS before finding a StackOverflow post that described that I could do all that I wanted in PhantomJS, which CasperJS is built on. I wrote a script that would take a url as an input and spit a png out to stdout. Then I wrote a node web app in Express that could take the url as a parameter and run the script through the child_process.spawn command. I had the express app write the stdout of the child process to a buffer and send it once the script was finished. Done!

Heroku

I ran into a problem when I wanted to host my app on Heroku. Heroku apparently does not support writing to /dev/stdout, and I only found out about this when my images were being sent as empty files. I looked at some solutions that involved writing to an Amazon S3 bucket, but I didn’t want to incur that much of an operations overhead for something so lightweight.

As a workaround, I found that Heroku does allow writing to /tmp, though any files you throw in there are not guaranteed to remain there after the request is over. For me that’s perfect, since the file only needs to exist as long as the request lasts.

Finally, I threw together an index view with a form and a button that takes a Twitter URL and loads the image into the same view when you click on “OK.” I got a nice theme from here and hardly customized it.

Screenshot in a screenshot inception.
Screenshot in a screenshot inception.

I also figured out how to use the “Deploy to Heroku” feature by adding an app.json file to my git project.

There were a couple of other issues I ran into that I didn’t describe yet, mostly getting PhantomJS 2.0 to run on Heroku (because previous versions don’t render webfonts correctly) and setting up the multiple buildpacks on Heroku. You can see what I ended up using by inspecting the Github project here.

I called the project Audubon after the Audubon Society which is really into birds (get it? birds, tweets?). You can deploy it yourself with this button:

Deploy

TODO

There’s a couple of things I need to wrap up in this project. If anyone wants to they could also fork the project and throw a pull request at me, but I’m planning on doing these eventually:

  • Make the command line tool better for generating images (right now it just writes to /tmp so I should make that configurable).
  • Make a bookmarklet so it’s easy to create images from the Twitter website.
  • Make the web index page look a little nicer
  • Maybe provide image format and quality options

Overall I think this was a really good side project in terms of scope and complete-ability. I learned a lot about Node.js, ExpressJS and PhantomJS. I’ve been meaning to level up my Javascript web game, and this project has been a useful exercise.

Threadless Shirt – Tweet

I saw this new shirt on Threadless and was surprised it hadn’t already done! Birds have probably known about Twitter for much longer than we have (early bird adopters). I like the fact that the Twitter interface has been recreated in a bird speech bubble, but I have a feeling the shirt will be outdated pretty soon (like when Twitter decides to come out with New New Twitter).

Get Tweet before it’s outdated!

Twitter? I Hardly Know Her!

twitter_fail_whale

Sometimes it’s fun to go look at what I wrote, say, two years ago and compare it to how I feel now. Case in point: Twitter. Almost two years ago, I wrote that:

Now, I actually use the Facebook updates now and then, but it seems like people who use Twitter do this to the max. Like they update multiple times a day. Are these people so self-centered that they think everyone needs to know what they’re doing?

In Twitter, the ability to update is the entire application itself. To me, Twitter is simply a subset of what Facebook already provides. Why would you ever need both?

This historical post is both illuminating and funny for a number of reasons. Apparently in the past I hardly updated my Facebook status at all. These days I probably do so at least once a day, and usually multiple times a day. I guess that’s just an indicator of how social norms have changed in regards to sharing personal information online: what was thought of as “oversharing” in the past is basically normal now. It’s also funny that I recognized that Twitter was a subset of Facebook. Recently I’ve come to believe that being a subset is actually a feature.

I think Twitter hit critical mass for me somewhere in the last few months. So really, my previous opinions of it being pointless weren’t necessarily incorrect. It just didn’t hold any value for me. Now that the value of Twitter (in my own usage) is improving due to network effects, I use it more often.

I think the appeal of Twitter comes down to this: There is a much better signal-to-noise ratio at this point using Twitter versus Facebook. On Facebook I get updates about everything that everyone I have ever known (and befriended) has ever done! I don’t care about pictures of drunk cheerleaders who I was friends with in undergrad. But Facebook feeds them to me. I really should remove them at some point, but oh well, such is social networking.

For now, Twitter has a much more relevant set of messages. I’ve also noticed that people are much more likely to respond to me via Twitter, versus commenting on a Facebook status. Probably due to the noise/signal thing again. It’s easy for me to simply “unfollow” someone who is not providing me with relevant or funny information. Sadly, the relevance factor of Twitter is probably a temporary quality. Facebook used to have a low S/N ratio until everyone joined it. Twitter may face the same problem if it can grow like Facebook did (lol at scaling).

It’s interesting to look at all of this in the context of history. I used ujournal before I used Xanga before I used livejournal before I used MySpace (ick) before I used Facebook before I used Twitter before I used (fill in the blank)…

Seriously, What Is The Deal With Twitter!?

twitter.jpg

So I’ve been reading about this thing called Twitter on some web 2.0 sites and whatnot. Call me pessimistic but it sounds like a completely useless idea. Now, before I had heard about twitter, I had used this thing called “status updates” on Facebook. I guess they’re pretty similar.

On Twitter and Facebook, you can write updates on what you’re doing, either from your phone or your computer. I think the difference is that Twitter sends updates to your friends on what you’re doing by SMS or whatever. Facebook just sorta posts your status on the site.

Now, I actually use the Facebook updates now and then, but it seems like people who use Twitter do this to the max. Like they update multiple times a day. Are these people so self-centered that they think everyone needs to know what they’re doing?

I think the difference between this functionality in Facebook and in Twitter is this: In Facebook, it’s just that. A functionality. In Twitter, the ability to update is the entire application itself. To me, Twitter is simply a subset of what Facebook already provides. Why would you ever need both?

The only thing I can see that Twitter does better is leaving out the required “is” that facebook stick in the updates. So I can write “Hung Truong likes cheese” rather than “Hung Truong is liking cheese.” Screw gerunds!

Regardless, Twitter seems to be insanely popular. At least with web 2.0 blogs. For now I’ll stick to updating with Facebook, like every few days or so…