A friend of mine suggested that Tumblr was lacking a decent way to visualize the posts which you’ve ‘liked’. Tumblr provides a great way to view your own posts via the archive page, and so I thought I would try using their existing layout style to visualize liked posts. The Tumblr Likes Grid is my attempt.
Now, I’m not Tumblr, and so I don’t have access to users’ information directly. The information about posts a user likes is available via a call Tumblr’s API. Tumblr is among a growing list of sites using OAuth to authenticate a user and allow querying for data.
Unfortunately, there aren’t many decent javascript OAuth libraries, and I finally settled on using PHP for the three-legged OAuth handling. Even then, it was difficult to get right, and I relied heavily on examples in lieu of better documentation about the process.
The rest of the page is pure javascript. I’m using jQuery for all of my AJAX and DOM manipulation, and mustache for template rendering. I have to say, mustache is really enjoyable! Tumblr has several different types of posts, including text, photos, audio, video, quotes, and more. Each post type corresponds to a matching partial template that mustache can retrieve dynamically when rendering a post object. The templates are cached after the first use for faster rendering.jQuery is used to insert the post objects into columns and month sections dynamically as they are received.
Repeated calls retrieve successively more posts. I tried to emulate the style of the archive page as best as I could, and most of the css and imagery is taken from Tumblr verbatim. I made some alterations, including abandoning the absolute positions of all the photos. I’d like to investigate other interesting ways of visualizing the data in the future, maybe with charts and graphs (yay math!).
Here’s what’s inside the box:
- mustache.js
- jQuery
- PHP
- OAuth, with a little help from Arvin Castro’s example
The following sources were helpful, especially in setting up the OAuth authentication process:
- Authenticating With Tumblr Using OAuth in PHP
- http://pastebin.com/g1ULp4bT
- http://pastebin.com/g1ULp4bT
- Brian Carstensen’s js-util mini project
- and of course…Tumblr! <3
Unfortunately, you’ll need a tumblr (and some liked posts) to view the page. Here’s a screen-shot for the uninitiated:
So that’s the Tumblr Likes Grid. Check it out! Feel free to leave comments and questions here or on my tumblr.
Enjoy!
I spent a few hours on Sunday customizing my JIRA instance to be a note transcription tool. I started out over a year ago trying to make my own standalone Java desktop application. I later changed it to Spring web application, then a Google App Engine application, but still never finished (I spent a long time designing it though, as an exercise). Then I decided to see what I could do about just customizing an existing tool.
I started with Evernote, which was pretty great, but didn’t allow the custom meta-data that I required. I then moved to WordPress, which is very good at this sort of thing. The idea of typing a note, setting the date, setting an arbitrary number of meta-data fields, attaching scanned images—all of these concepts it handles natively, and very well. However, it is somewhat rigid in the way it works. Making everything private is difficult. The editor is heavily focused on rendering HTML, and tends to obfuscate the text with layout markup. A wiki might be better, but they tend to be a pain to set up and maintain.
Then I thought about JIRA. Most of the concepts I could port to my new domain. Books, locations, pages, tagging people, simple wiki-style markup. I added a bunch of custom fields and altered the screens and workflows for the project, and after a bit I had tuned the settings to my needs. In fact, it’s been far better than I expected: none of the overhead or privacy concerns of a ‘private’ blog, a powerful query language for finding entries, a few hierarchical concepts to support the idea of “books containing pages containing entries”—I am quite satisfied.
This got me thinking though: how many of my software ideas could be designed to utilize existing systems? I’m not trying to avoid all development (that’s the best part!), but writing plugins on a flexible system should be far easier than writing a whole new application from scratch. While I enjoy the challenge and the level of control that the latter affords me, I am starting to feel that it is a poor use of my time. I am only one person, and if people don’t want to collaborate on my projects then I need to be more efficient about seeing them through.
I have another application in mind, similar to this one. I am definitely going to investigate the possibility of using JIRA to accomplish my goals, or at least prototype the idea.
One of the best parts of being a software developer is that I’m constantly learning. The other day that I encountered a useful application of generics that I think is worth sharing. Normally when creating a fluent interface we want the ability to chain method calls together in a variety of different orders. And often in object oriented programming we put shared functionality in a base class and extend from that. Well unfortunately, in strongly typed languages such as Java these two desires are often at odds with each other. Continue reading…
I am happy to announce that I have finally lifted myself off of my lazy posterior and released the 0.1 (‘Zedoon’) version of my collection of Java tools. UQCLib is intended to be helpful and fun. This initial release contains as its main feature a form of peuso-closures for Java. You can read more about that here.
Documentation, code examples, and downloads are all available from the GitHub project page. The code is provided under the Apache License 2.0, and all are welcome to contribute. Now that everything is set up, I expect version 0.2 to arrive much faster. If you’re on GitHub follow the repository to see the updates as they come. 0.2 (‘Coreidae’) will focus on logging and simple state machines, and should be arriving around August.
Please enjoy, and feedback is appreciated! Email me at uqclib AT unquietcode DOT com.
As I continue to sketch ideas for my dream programming language (if such a thing can even exist), I’ve begun to embrace the idea of “event oriented programming”. Almost everything can be reduced to an event. A simple event can be thought of as a single statement in a linear sequence of statements. In a system without control flow every event is of this type, and each line will be executed in order, performing its intended action.
We know from decades of language development that this is not enough for all but the simplest of programs. The introduction of a ‘jump’ command allowed basic function calls to occur. First you store your location, jump to a different place, then you jump back (which we call ‘return’). Conditional branching, the ‘if/else’ statements, gave even more control over the running of a program. Again, this is really just another flavor of jump, with a test being performed and a jump ignored or taken accordingly.
Without touching the more ‘exotic’ control flows—stately ones such as ‘yield’ and continuations—the next big development (in my view) was the loop. Behind the scenes it’s just another conditional jump, but we begin to see the development of a small lifecycle here. Consider the standard ‘for’ loop: Continue reading…
