Ruby on Rails Logo

I spent about a week developing TwitterNotes, including the time spent implementing the design, and I would like to share some technical details about creation. It was built using the Ruby on Rails framework running on the Mongrel web server locally, on the development stage, and on Apache, in a shared hosting plan, on the live version. Here’s the list of external plugins and libraries I used followed by some considerations.


Plugins and libraries

I already made an article about it and I implemented it on the Rails application following Susan Potter’s example on the discussion group. All went well and it’s a very nice library to work with.

This plugin was a bit modded to create a non-registration account creation. Basically you just enter the Twitter account username and password, it checks with Twitter4R if the login is valid on Twitter if you don’t have already an account on TwitterNotes, and then creates your account on it. Besides that, the plugin has all things needed.

Since every note can be tagged, I just had to make a small parser for each Twitter message to capture the tags, insert them on a array and send them to @note.tag_list.add. You can also insert them directly in a string containing them comma separated: @note.tag_list = "ruby,rails,twitter". It even gives you the tag counts for a tag cloud @user.notes.tag_counts. A very useful plugin indeed.

I wanted HTTP Basic Authentication for the API and the administration zone, and since I’m wasn’t using Edge Rails, I installed the plugin version. It’s very simple to use, but on the live version on the shared host it wasn’t working. Fortunately this issue had already been addressed and I only needed to substitute a line in public/.htaccess for:

RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]


I don’t remember any more interesting information about TwitterNotes development. If you would like any more information on the application or its development feel free to ask.

If you enjoyed this post, consider subscribing to my RSS Feed RSS feed icon

9 Comments

So basically you just glued together the pieces. well done. Listen, is there any way that my notes aren't made public? I don't want the world to see what's going on in my head... they could use it against me! ;) Thanks.
Well, there's no way of filtering posts from going into Twitter. The only possibility would be checking each second for new messages, but that would trigger excessive use of the API, and probably wouldn't be fast enough to avoid the notifications.

There's the possibility, although it would create a different set of problems, to make our own Twitter client. But or we make something available on several platforms or it wouldn't have many reach.

But I guess I will start a discussion over at the community over that matter, since you're not the first one asking for a method to send private notes.

Nevertheless, there's also a large range of use for TwitterNotes, with notes being public, since most Twitter users enjoy more the sharing and community aspect of the service.
Just a few questions: 1) Why do you need to save Twitter's username/password of TwitterNotes users? 2) Since you do it, what (and where) is your Privacy Policy? 3) Why Mongrel? 4) What usage expectations do you have for this app? 5) What are your future plans for TwitterNotes?
So many questions, but I asking for them.

I need to save Twitter's username/password due to the limitation of the Twitter API that only allows you to take the last 20 messages for a user's timeline. Therefore, we need to run a script in the background making sure notes aren't missed between login and refresh times. About the privacy policy, some terms can be found inside the FAQ, but probably a more detailed description will be written and posted on the website.

I use mongrel locally since it's a faster web server than WEBbrick, the one which comes bundled with Rails.

Trying not to make a long speech, the expectation are that we gather a lot of curious who only try it once or so, but specially more power user who would use TwitterNotes more actively and frequently. For the future, we are now working on a method to allow private notes, and we may already have came up with a solution for it. There's also more room for more improvement in the interface, but we'll be careful tweaking it.
How do you deal with Twitter password changes? Why don't you fetch 20 by 20 (using the 'id' and 'since' parameters)? Notice that I'm asking questions just because you told us to do it O:-)
We just run the login information on TwitterNotes against Twitter's, on the first login. If you change Twitter's password, you need to change it too on TwitterNotes, or else we won't be retrieving any messages.

I have already did several experiments with Twitter4R and Twitter's API and I haven't found a way to get older messages, unless I don't have their specific id. I maybe me missing something, but 'since' just narrows the results from the last 20 Twitter messages anyway. And fetching that much messages every time someone logs in, it might take too long.
Dear developer I want to know how can I tweet something from my account to make it appear in twitternotes of other user, can't I?
Please give me exact the steps using twitternotes, i tried but failed
You just have to login on TwitterNotes using your Twitter account information. Then you can start twittering messages starting with a plus sign, in order to take notes. For more information check out the FAQ.

Leave a Comment

Follow this post comments with this RSS feed.