Tweetfave Software and Services

Tools

?With my Tweetfave project finally launched and starting to get a little bit of usage, I thought I’d summarize some of the key building blocks for this project.

First of all, what does Tweetfave actually do? It periodically checks your Twitter account to look for new tweets you have marked as favorite. If you have any new ones, it sends them to your email inbox. The functionality is very simple, but I’ve found it to be a handy addition to Twitter, turning favorites into a sort of “read it later” bookmarking feature.

Following are some of the software tools and services I used to build Tweetfave:

PHP – for this project I chose PHP because it’s what I’m most proficient in. I’ve got another side project going where I’m learning Ruby on Rails, but for Tweetfave I stuck with the familiar. With PHP’s popularity, everything else I needed was already available as PHP libraries, and it was really easy to set up both my dev and live environments.

Twitter API – learning this API was pretty straightforward, especially with the ease of the PHP library. The trickiest part was setting up the whole OAuth flow with my site’s signup/login flow (and PHP sessions). Originally the code required a read/write access to Twitter accounts, but I later refactored that to use read-only access to minimize the chance of any bugs causing problems for live Twitter accounts. I’ve also switched to the new API version 1.1 without any trouble, and (so far) the application is not running into any rate limit problems.

Twitter PHP Library (by Abraham Williams) – this was the first PHP library to help with Twitter’s OAuth API, and may be the most popular one. It’s very easy to add to a project, and makes calls to Twitter really simple. For example, my main call is getting favorites for an account: $favorites = $twitter->get('favorites/list');. See this discussion for a quick change to support API version 1.1.

Twitter Text PHP Library – the Twitter Text library takes the full text of a tweet and adds hyperlinks and markup for detected identifiers like “@” handles, hyperlinks, and search hashtags. For Tweetfave I use the original tweet text in plain-text emails, and the Twitter Text marked-up version for the HTML email body. The results are pretty decent, making the tweets appear almost the same as on the Twitter website. It also extracts all the links contained in the tweet, making it easy to expand those from short form to their original form.

Mustache Templates & PHP library – Mustache provides a very simple templating language that I use to create all of Tweetfave’s outbound emails. Every email sent has both plain text and rich HTML versions included, and Mustache makes it easy to manage dual templates from the same data source.

Swift Mailer PHP library – creating and sending emails always seems more complicated than it should be. The Swift Mailer library is a straightforward way to ensure your outgoing emails are formatted correctly, especially when you want full control over the email including multipart. Paying attention to the details of email creation also helps prevent the messages from being flagged as spam.

SendGrid † – a very reliable email delivery service that “just works”. Even when I was on the free plan, I made a couple of support requests and had excellent service both times. I really like SendGrid’s reports and “Email Activity” dashboard, both of which make troubleshooting and tracking a breeze. One downside is you don’t get a dedicated IP address for your delivery point unless you’re at the $79/month pricing level. So far my emails seem to avoid being flagged as spam even without the dedicated IP.

Bootstrap – the Tweetfave website consists of only a couple of pages, but I wanted to make sure they worked well on both desktop and mobile browsers, so I used Bootstrap as a starting point. It was pretty easy to learn LESS and tailor the Bootstrap template down to just what I needed. For the next go-round, I need to learn how to customize Bootstrap while still being able to merge updates and improvements.

pair Networks † – I’ve been using them for web hosting for over 10 years for this blog and a few small side projects. I ran Tweetfave here as well during the year-long development. Recently as Tweetfave usage has grown, my cron scripts are a bit too much for my shared webhost account, so I moved them to Digital Ocean. I kept the MySQL backend and website on pair.

Digital Ocean – after I outgrew my shared webhost, I signed up for a basic VPS ($5/mo) from Digital Ocean. Signing up and creating my virst VPS (a “droplet” in their terminology”) only took about 15 minutes. Installing my code and packages like PHP only took about a half hour. Very impressed so far.

† Affiliate link; I’ll earn a small referral fee if you use this link; thanks for supporting this service!

I’m happy to answer any questions about the software and services used to build Tweetfave. Just shoot me an email (brian at cantoni dot org).

If you haven’t tried Tweetfave yet, give it a shot.

Image credit: zzpza (Flickr)