Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Sunday, April 10, 2011

Building Curseleague.com


I really wanted an excuse to play with NodeJS once again and after a conversation with blagdaross in the office I had my idea. I had also been looking for an excuse to stretch the legs of Joyents no.de hosting service for NodeJS. I had all of the pieces needed:


Once again I turned to the trusty toolset of ExpressJS for routing and EJS for template rendering. I wanted to build straight out of Twitter lists, so first thing was to hit Twitter to get the members of a list. As this is an open call, no oAuth handshaking has to take place, which is nice. However, getting the list of members returns a whole bunch of metadata about each member on the list. I didn't need any of this information, and I couldn't find all of the members without pagination. This is where I started to have some fun with writing asynchronous code for very much a synchronous web request.


Once I had the list of members of a list, I could do a lookup on Cursebird for the points they have given those members. I have to say the Cursebird API is just fantastic! Talk about the API being the website, just stick .json on the end of any page you visit and get the data you need. No API key nonsense for open data is also a great move. Well done to Cursebird on their efforts. After sorting the list according to points, all it takes is rendering.


I recognised that crunching all of this data with potentially a few hundred server side calls to Twitter and Cursebird would be slow, so I introduced a really dumb key-value pair cache and use that cache at every level, from caching a single request to Twitter or Cursebird, to caching a whole dataset for a webpage.


Onto hosting, and no.de has this really interesting deployment technique where you do a git push into a repository you're given on the virtual server you have. From there a post-push hook is fired which deploys your app and runs a named file (server.js). The no.de real time analytics are really impressive, although it'd be great to get historical information out of that too.


The one on-going grievance I'm dealing with is locally I deploy on port 3000 but in production I deploy on port 80, and currently I'm changing this on commits as a work. I had a way of doing this through a node module I'd built a while ago to get properties from a json file, although up until now I'd been using nDistro to manage my dependencies, but with no.de I'd have to do this a little differently. I could push the properties project into the NPM repositories but I'm also thinking of building a node module that can read nDistro files and add dependencies at run-time. It's food for thought.


Finally a big thank you to JT for working up the styling.


Cheers,


Robbie

Thursday, May 08, 2008

Latest Scores Makes The Guardian

I was randomly following up on one of my new followers for a latest score tweeter when I found this link to the Guardian: http://www.guardian.co.uk/technology/2008/may/08/socialnetworking.twitter

Towards the bottom under miscellaneous tools is a link off to http://www.code.google.com/p/latestscorestwitter

AWESOME!

Wednesday, April 30, 2008

Open Sourcing Twitter Apps

I know it's only a tiny app, but I've had people ask me about how I created the Twitter apps to post the latest football scores (e.g. http://twitter.com/arsenal_scores) so having a bit of extra time (no pun intented) this week I decided to grab the latest copy and put in on Google Code. It serves another purpose as I hadn't backed it up, so now it's in source control and I can point people to it who are interested.

Tuck in - all 3kb of it.

http://code.google.com/p/latestscorestwitter/

Monday, January 07, 2008

My New Years Resolutions

I know it's a little late, but better late then never eh?

My new years resolution is simple really: be more selfish. In the nicest possible way of course. Over the last few months I've found myself being online a lot, in a sort of attached-to-the-hip sort of way.

It really came to me on Saturday when I was sitting on the sofa, enjoying a cup of tea and reading the Guardian. I paused and thought to myself, "this is nice, it's been too long since I just sat and thoroughly read the paper". I went on to think about when I used to go away for the weekend hiking, or mountain biking, or how I used to actually go to the gym regularly, play football and generally be a lot fitter then I am now.

I kept found myself wanting to check my email, Twitter and my RSS reader to see what was going on and thinking back, it seems nothing that I didn't miss that much after all.

Here's an interesting twittersation for you, which left me thinking my new years resolution is to spend less time online, and spend more time doing stuff I used to like doing. (This coming from a man who just wrote four blog posts in an hour!)

To do that, I may have to cull my RSS reader and unfollow people on Twitter, so sorry about that in advance. Please add me to your Google address book though if you use Google Reader, the shared items is a great filter of information.

http://twitter.com/robb1e/statuses/572002322
http://twitter.com/FND/statuses/572157652
http://twitter.com/jayfresh/statuses/572158492
http://twitter.com/FND/statuses/572238092
http://twitter.com/robb1e/statuses/572686122

Wednesday, January 02, 2008

Spamming on Facebook

I thought I'd do my good deed for the day and post on the 'Arsenal Football Club' group on Facebook about the Twitter app/user I created to update according to the latest scores and final result.

I started a discussion, trying to share the app, explaining about Twitter and how everyone could benefit from free SMS updates. That was my good deed.

The first response was telling me that I shouldn't be spamming. I was somewhat shocked at this and of course, sent a Tweat. I thought I was sharing not spamming, and a little later the discussion was deleted.

I looked at the definition of Forum Spam on Wikipedia, certainly I may be guilty of trying to raise awareness of something away from the group/discussion, but I'm certainly no spambot and I thought I'd be doing some people a favour to highlight a really useful free product.

It made me think about Facebook, advertising and spamming in general. There's 20 odd thousand members on this Arsenal group and I presume most of them don't mind that Facebook puts ads on every page, or that their friends send them loads of crappy vampire bites, but they mind if a stranger posts something.

I just find it disappointing. When someone offers something for free and they are paying out of their own pocket (hosting isn't free people) that they get tainted with the word 'spam' when they feel like sharing something they think people may find useful.

Friday, December 28, 2007

SDPs and other acronyms

Acronyms have always filled me with fear ever since my university Software Engineering class where we'd read case studies but with the names changed in a humourous way, like SNAPPERS for an automated processed through a photography lab. What it stands for now escapes me, but leaves me frightened nether-the-less. The telco industry is filled with them, the software industry has plenty go spare too and I'm stuck in the middle.

After reading JPs recent entry about the word 'platform' now being an overloaded word, I remembered what the telco industry was currently going through. I get the impression sometimes that in the industry if it's not worth putting a committee together to solve a problem, then there is no problem.

Take your typical Service Delivery Platform (SDP), talk about a problem that doesn't need solving! SDPs are specific to the telco industry according to Wikipedia. But, why are they specific? If SDPs are so central to (and I cringe as I type this) 'Telco 2.0' why isn't anyone else doing it? Why can't I just buy one? For that matter, why isn't there an open source SDP I can run?

I really like Urmy's "complex is lots of simple" approach. I look at some of the newish companies coming out and they seem to have something in common. David James said something which stuck with me about making your product x, the best damm product x anyone has seen. Take Twitter for example, what they do is really good, and it's simple to use and code against.

When building a generic framework, I'd like to see lots of loosely connected, easy to use web APIs to make it so easy to plug an application together, you could build it before you had time to put a committee together. Yes, those newish start ups do have the luxury of having no legacy systems like telco's do, but that doesn't give anyone permission to shroud those legacy systems in the mysteries of acronyms.

Saturday, December 22, 2007

Twitter as a messaging platform

When you have an itch, scratch it!

Well, that's what I've started to do. My itch is a common one in the UK and probably throughout Europe and certain parts of the world, but when you generalise it, it becomes a problem that nearly every one has. When there's a certain piece of information that I want to know as it happens, how do I find that out?

For me, it's Arsenal scores. I'm a big Arsenal fan, and unfortunately I don't get to see many games live (other wise I might not have this problem). As much as Arsenal play on TV, I often don't get a chance to see that either, I don't subscribe to Sky or cable, so I'll pop to the pub. Anyhoo, I want to know when there's a change of score, and I want to know the final score of all Arsenal games. So what did I do about it?

Let's put that question to one side for now and look at Twitter. I've been using Twitter for a few months and I'm lovin' it! One of the key points here is that it's a pulling mechanism of messaging. You have to 'follow' someone to view their updates but you can view those messages on the web, through RSS, third party applications (using the Twitter web API or RSS) or through SMS.

Let's get back to the question at hand. The Beeb has a great website for sport, particularly their refreshing latest score pages. Although not RSS, which is a shame, the page is formatted nicely, so writing an application to extract key data is pretty simple. Twitter can then be used to post that data too and anyone, myself included, can subscribe that information in my preferred means.

Looking back at the little application I wrote, it's screamingly obvious that with easy to use web APIs all you have to do is write some plumbing code to do what you want to do and scratch that itch that's been irritating you.

So far, I've created users on Twitter for Arsenal, Birmingham and Manchester Utd.

Soon, I'll be creating users for all Premiership clubs and pushing this a little more. Let me know if you have an itch (or well, at least a team you'd like to follow, it can be any team that has a live scores page from the BBC Sport Football website), let me know =)

Friday, December 14, 2007

RippleRap

Whilst at LeWeb3 in Paris earlier in December I had the opportunity to test drive RippleRap.com from my buddies over at Osmosoft. Ripple Rap is a note sharing tool that can be used in Conferences, telephone meetings and the like. One missing feature was a mechanism to give feedback, so I thought I'd throw something up on here and send it over to them.

RippleRap is built on TiddlyWiki, a open source, primarily client based all-in-one wiki page and so I was somewhat familiar with the navigation and use of the application.

So, the question that I wanted answered was why I would want something like this instead of a text editor (local or hosted) or a wiki page online? The wifi at LeWeb was up and down and as you run RippleRap from disc you would never get any connection errors. If you were using a hosted solution you would have had to use local based notes and copy and paste all over the place. If that were the case, why not use just a local text editor? Well, when you do have connection, RippleRap automatically publishes any saved notes to anyone else using the app for that conference. This means others can read your notes and conversely, you can read other people's notes.

I got some benefit being able to read other people's notes from the conference. Others had picked up on things I missed and I could read notes from sessions I missed as soon as someone saved their notes (and had connection to publish). Some added quotes, some commentary and thoughts; I think a range of different possibilities will emerge if this grows.

I like the fact I can also get the feeds from agenda points, there's a great example from JPs talk.

There were some things that could be improved upon and new features which could spring up. My thoughts drift the idea of a conference dashboard where I could enter tags which I'm interested in and be presented in feeds from the web tagged with that information. For example, the tag LeWeb3 appeared in Twitter, Flickr and probably a whole bunch more. I'd also like to be able to tune that to get updates from sites which I'm interested in and not to receive updates from sites in which I'm not interested in.

I'd also like to have a permalink to the notes I've and others have made so I can quote those in blog posts.

It'd be cool to be able to go to RippleRap.com to set up a conference with agenda and then pull that down to distribute it, or get the permalink to that for others to download.

Saturday, October 27, 2007

Posting updates to Twitter with Ruby

Step one in my new Premiership updater: post status to Twitter. It's pretty easy, so I'll just dive straight into code:


require 'net/http'
require 'uri'

url = URI.parse('http://twitter.com/statuses/update.xml')
url.user = "your username"
url.password = "your password"

res = Net::HTTP.post_form(url, {'status' => "hello world"})

puts res.body


Just two requires are needed before getting your hands dirty. Next is setting up Basic Authentication on the URI and posting with a single parameter of 'status'. Job done. View the result in XML or JSON through the update extension in the URI.

Wednesday, October 24, 2007

Twitter for group messaging

As what usually happens, I'm sitting somewhere or doing something completely unconsiderate for writing ideas down when something strikes me. I'm sitting in the car this time, driving home from a co-location day in Milton Keynes. I start thinking about Jay Fresh being stuck on a train, in the nicest possible way of course, and how Twitter could be used for more purposes then one to one or one to many communications. Perhaps an application could use Twitter to update those who are interested in certain information.

My thougths evolved into different kinds of application uses for Twitter and so far I've come up with two. Firstly, an account for an application to use for the specific use of microblogging. After this thought I went and set up an account for Mojo, a project I have been involved in at work, so those interested could hear what Mojo had to say.

The second use is more detailed to an application than say, a group of developers such as the Mojo example. As a football fan, I'm always interested in the latest Arsenal score, but I don't follow them extensively and am often out and about when they play choosing instead to watch highlights. I had thought about building an application that could slurp feeds from relevant sporting sites and post those to Twitter using their API. Then using features such as follow, I could get those feed updates straight to my mobile.

Cool eh? Now I have to go write it =)

Saturday, October 06, 2007

Facebook vs Your Favourite RSS Reader

In the last week or so my web life has changed. I thought I was using RSS properly on iGoogle, but considered the change to Google Reader. Now with email like behaviour rather than static like content, I'm getting much more from the web then before.

This all makes me think about the Facebook debate about walled gardens. To be honest, I do have a Facebook account, but find it generally quite annoying. What it is great at is something close to online personal CRM app with lots of people contributing to. I've already used it a few times to get contact information from when I've not had someones number and needed to get in touch with them.

I think for me, although the friend of a friend (FOAF) issues remain, I'd much rather sign up for various web apps (Twitter, del.icio.us, Dopplr, Flickr and blogs) feeds and watch those through my RSS reader than watch those through Facebook.

It frankly amazes me that they're considered worth £10bn or something. It must be through potential advertising channels and otherwise.

In an effort to attempt to circumnavigate Facebook, I've set up a Yahoo! Pipe to grab all my feeds from across the web and suck then all in one place. For now, you can see that here:

http://pipes.yahoo.com/pipes/pipe.run?_id=8vLND2N03BGbhg_g1vC6Jw&_render=rss