My First Twitter App: Last Month

Posted: ; Go to comments
Posted in: DQ Projects; Tagged: app, Development, I made a thing, Twitter

I made a thing. Following on from the buzz I got writing my first WordPress plugin and sharing the code, I wanted to give myself more creative projects to work on throughout the year. I’ve had a few ideas for apps on various platforms and decided that based on their size, I could add to the list and have a project to complete each month of the year. I’ve just reached an end point on one of those apps, so here is an accompanying blog post with obligatory discussion on the development process.

My first project was meant to be a Facebook canvas app – I had already looked into making one soon after Bandcamplib, but found the documentation too confusing, and tutorials very thin on the ground so I abandoned it before it ever got anywhere. Before Christmas, I started fiddling around with Twitter, and my first impression was that it was so much easier to get a project off the ground with their API than for Facebook, so I took my idea and started working on it but for a different network.

The more I developed the app, the more I realised I hadn’t planned suitably. I find I get too bogged down in reading about methods that I just get frustrated, so I did what I always do: jumped in to writing code. I ended up with two code bases, and before I made a decision to stop development, I was contemplating a third. I was introduced to Bootstrap, and used that as an excuse to re-factor my code, but to do so again would be a vanity exercise mostly. The final product lacks some features I wanted to include, and isn’t the “neatest” code, having too many files and not enough commenting to be distributable for others to make use of. The project is interesting enough to warrant spending more time on it, but I want to stick to my one-a-month goal, and I reached a suitable point to call it quits.

I haven’t even said what it is yet. It’s called Last Month – because I lack the creativity to give it a catchy name – and it was borne out of frustration with Facebook’s timeline AJAX loading. I go through phases of clarity where I realise I’m posting nothing but inconsequential rubbish to my social network timelines, and try deleting everything; when going through my Facebook timeline, I could delete a week of updates only to discover that several updates (activities, anything on Timeline) from that week had been selectively hidden by the AJAX space profiler (I assume). I wanted an option that would let me see all of my posts, from a selected month, on one page, with no surprises. So I made something similar.

Last Month (for Twitter) lets you login via Twitter and shows you all of the tweets you posted (including replies, but not retweets) in the previous calendar month. It has three core functions:

In addition, I have it display the number of retweets each tweet received, but I didn’t get to implement displaying the number of replies a tweet received. Both are a translation of an idea I had for the Facebook version where I didn’t want “valuable” content to be deleted, and value is quantifiable on Facebook through number of Likes, comments and shares.  The Twitter API doesn’t make it easy to find the reply count; I would have to write a function to scrape the static page of each loaded tweet to find the number artificially.

The last feature I added was a log of user IDs and the time they accessed the app. I’ve hashed the ID so @twitter will become 9d7a7725c7627a041a7827916ccccbe1c0bd4b42. I added the tracking because I want to see how often the app gets used and by how many unique users. Stats are fun!

I’ve merged a few ‘new’ ideas into this project. First, using Bootstrap and rapidly developing layouts using well established styles and other functionality. I’ve also used a bit of Javascript for counting the number of selected tweets, and for deleting single tweets via an onclick call on an image (as opposed to the batch which is handled by a regular form submit). There’s the obvious use of the Twitter API too, though most of that is handled with a pair of OAuth and Twitter libraries written by someone else.

I need to write a proper app page for it (not just a blog post), explaining how to use it. Its straight forward enough: go to the Last Month app, click the login with twitter link and allow the page to load. The more you tweet, the longer it will take to load! Clicking a trash can deletes a single tweet. Clicking the tick boxes will batch the tweets – you need to scroll to the very bottom of the page to see the number of tweets you have batched, and to see the button that will delete them. Deleting tweets is permanent, do not play with the delete buttons unless you definitely don’t want the tweets!

As I’ve said there’s a lot left to do, but it’ll do for a starter project. I’m moving on to do the same project but for Facebook during February; if I finish the next project sooner than the end of the month, I’ll try to come back to this one and spruce it up a bit.