Tag Archives: API

Some random reflections on 2014

As time has moved on, I’ve lavished less attention on my blog, which is a shame… “back in the day” I enjoyed writing for it, and gained a lot of value from doing so. It’s of no particular surprise to me that I’ve spent less time writing here in 2014 than in any of the previous years; but it is a regret. I blame my schedule, a general change in the way I interact online, and a lack of inspiration. Actually, that last one isn’t quite true: I’ve often been inspired, or felt the need to blog, but have found myself mentally blocked. I need to get over that!

Anyway… 2014, looking back… a little bit of a year in review.

LEGO AndyThe major life change this year was my move to Twitter, which has been very exciting and energising. I’m thrilled to have been invited to work with a team of exceptional people under Jeff Sandquist. In particular, this year I’ve had the short-lived opportunity to work with three brilliant and talented guys I want to say “thank you” to, for making my transition to my new role such a pleasure: Taylor Singletary, Sylvain Carle and Isaac Hepworth. A special shout-out too to my close friend and colleague based in London, Romain Huet, without whom I would have found the past nine months much less fun or easy-to-navigate! The whole team has been just amazing to work with, as have all my wonderful colleagues at the Twitter office in London #gratefulpipes

The work we’re doing on the Developer and Platform Relations team at Twitter is something I’m incredibly passionate about. Connecting with the third-party community and acting as the face and voice of Twitter with those developers, listening to them and responding to their concerns, is the reason I joined the company.

I’ve been involved in the launch of a couple of APIs (most notably the Mute API), and I’m getting to work on much of the external API surface, which plays well with my background and developer experience. We’ve completely relaunched our developer-facing website and forums in the past few months, which the whole team has worked hard on. I’m happy to see the focus of discussion on the developer forums substantially improved now that we’ve moved to the Discourse platform – the user experience is far better than we had with the previous solution.

Most importantly, this past quarter we launched Fabric, our new free mobile SDK and platform for iOS and Android, and delivered a swathe of improvements to the developer experience for mobile enthusiasts. We also ran our first mobile developer conference, Flight – I was excited to be there, and I’m looking forward to seeing that experience continue in 2015.

My background in the Internet of Things and MQTT space has partly carried over into my new life at Twitter, and I’ve had the opportunity to speak at a couple of events (including Flight) about how Twitter’s platform plays into that space. However, I’ve substantially stepped back from playing a major role in the MQTT community this year; a decision in part driven by the need to refocus on my new role, partly due to some personal hostility and “burnout” with a couple of specific issues, but mostly because – I’m no longer “needed”! It has been incredibly satisfying to see the MQTT community grow over the past few years. The standardisation of the protocol at OASIS, the large number of implementations, and the ability of many other much smarter people to pick up the kinds of speaking engagements I was previously doing as a matter of course – all of these things make me immensely proud to have helped to lay the foundations for the success of that community over the past six years or so.

I’ve also been very happy to see the success of the Cloud Foundry platform and the people involved – having devoted the previous two years of my career to that nascent Open Source community, it is just fantastic to see it take off and the Foundation get started. Nice work to everyone involved.

I’ve again thoroughly enjoyed my speaking opportunities this year, and the chance to broaden my range. Obviously that has included a lot about the Twitter API and developer platform, and lots again about IoT; but I’ve also spoken on wearables, developer advocacy, and API management. I’m very happy that I got to be a part of the first Twitter Flight conference – one of my speaking career highlights.

Personally, I’ve tried to stay healthy this year (no heart scares, no falls…!); although my travel schedule has been demanding again (TripIt tells me I covered 66613 miles in the air). That did at least include a couple of trips for fun, rather than being all about business :-)

The next year looks to be busy with more events to speak at (and organise!), and much more to do around the Twitter platform. As an historian, a sociologist and someone with a keen interest in the intersection of technology and people, I’m very excited to be a part of this wave of change.

Happy New Year – here’s to 2015!

TwtrCtr – Tracking Twitter followers with an iPhone

twtrctr logo I’ve already mentioned this on Twitter, but so far I haven’t had a chance to write about the culmination of my first “proper” efforts to create a mashup: TwtrCtr.

For those not obsessed with Twitter or their follower numbers, there’s an application you probably haven’t heard of called TwitterCounter. The site provides tools, graphs and APIs for charting the growth of a user’s Twitter followers. It’s interesting, and if you’re slightly obsessive about figures and have a belief that such things “matter”, then you might already spend time checking it and looking at the pretty graphs. It also provides an element of “prediction” based on historical growth trends, and does cool things like allowing users to compare themselves to others and watch the graphs intersect or overlap.

twittercounter website There’s just one issue – although it looks great on the desktop, the site isn’t laid out very well for mobile browsers like Mobile Safari on the iPhone. It also uses a Flash component to display the graph, and since there’s currently no Flash on the iPhone, you get a big blank box in the middle of the screen.

The nice part is that TwitterCounter has a simple REST API which enables a developer to get the raw data about a user’s follower numbers. If you use Twitter clients like Tweetdeck, then you’ll see this in action.

Based on my previous experience of using the iWebkit framework to build an iPhone-optimised web wrapper for the data from my Current Cost meter, I thought it might be interesting to play around with using iWebkit to display the TwitterCounter stats.

iWebkit is a simple HTML framework which provides a set of CSS classes to make your web pages look like native iPhone apps. There are other frameworks out there like iUI and webapp.net, but they depend a lot more on knowledge of AJAX and some more advanced / dynamic coding, whereas iWebkit is all about simplicity – if you know your HTML basics, it is pretty straightforward. As it happens, you can extend it very easily as well – in my case, I combined it with some PHP functions which call out to TwitterCounter and echo the numbers into a table on a web page.

Although I worked with PHP a lot a few years ago, I hadn’t really done much with the language recently. The first thing I did was to create a simple piece of code to call the TwitterCounter API and get back the data for a specific user; and then I displayed it in a web page. Once I’d done that, it was pretty easy to get the whole thing wrapped into two pages of iWebkit template code, and style it all appropriately.

twtrctr mark 1

Revision one of the interface and app ran off my home server, and didn’t look fantastic. My initial thought for a name was “TwitterCounter nano”, but I changed it after realising that it didn’t fit so well as a name on the iPhone home screen :-)

In the screenshot on the left, you’ll also see that the first form I came up with was far from “iPhone native-looking”… the current version of iWebkit didn’t have form CSS classes, so I had to tweak things a little. I also found it was worth digging into the Apple Web Development Guidelines for the iPhone, which gave some hints about how to make some iPhone-specific tweaks like turning off auto-capitalisation for the text entry box (since most usernames are all in lowercase), and how to add a text hint, for example.

twtrctr mark 2 So, the second iteration of the UI looks a lot nicer. It’s also possible to hit the bookmark button in Safari and add the app as a shortcut on the iPhone home screen… (see the icon at the top of the post)… if you do that, and launch TwtrCtr from there, it will act as a full-screen iPhone app with no Safari controls, giving a much more native experience. The user can then navigate by using the controls in the header bar rather than the forward and back buttons provided by the browser.

I added an FAQ page, too, so if you want to know more about the app you can check that out directly on the site. In these days of heightened concern about Twitter security I also thought it would be a good idea to add a note on the front screen to point out that it doesn’t ask for anything more than a username, and it doesn’t log that anywhere, it just passes it on to the TwitterCounter API.

twtrctr display OK, that was a rather long explanation of the evolution of the first page! The important part is actually how the data is displayed. Once you’ve entered a valid Twitter username and hit “Get User Stats”, you get a single-page representation  of the TwitterCounter data for the given user.

The top 2 or three rows are links which will open the user’s profile page, homepage/URL (if one is set… otherwise that row doesn’t display), or display a simple graph / chart which is generated by the Google Chart API. The latter is something high on my list of enhancements, because it looks a little dull at the moment; also, I’m generating the Google Charts URL myself rather than using one of the PHP wrappers to the API, which would probably be a lot simpler.

Don’t look too closely for the rough edges… right now, it doesn’t actually make any effort deal with cases where a user doesn’t exist, or TwitterCounter or Twitter is down…. I know about those small issues :-)

In a nutshell, then – that’s all it is. A mashup which allowed me to explore a bit more iPhone-specific web development, some PHP / REST / XML coding, and a bit of Google Charts stuff as well. I have to say that the TwitterCounter folks (Boris and Arjen in particular) have been brilliant and very helpful and supportive, despite their app having an issue with the Twitter API while I was in the middle of developing this mashup on top of their API! iWebkit is a lot of fun to play with, and very simple as well – I know the developers are working hard to add new features into that framework whilst keeping it simple and aiming it at “non-techies”.

Oh, and incidentally, although the stylesheets make it look like an iPhone app, it should work perfectly well in any desktop or mobile browser – it’s plain old HTML.

I’m not making any claims about how this might develop in the future, but I’ve got a couple of ideas for tweaks that I might make. In the meantime, if you’re an iPhone (or other mobile device) Twitter user, do take a look at http://andypiper.tv/twtrctr and see how it works for you. Let me know what you think, or any ideas for additions you might find useful! Feel free to follow me on Twitter and @ your suggestions and comments to me, too.

Update: TwtrCtr is now linked directly from the TwitterCounter home page! Follow the iPhone link in the page footer! :-)