Musings over the great Facebook debate – friends are friends

October 18, 2007 by boycook

So I was at ‘The great Facebook debate’ yesterday, an event hosted by BT. After some initial statements from people like JP Rangaswami, and some Q&A with them, there was debate over these two motions (I’m not sure on the exact wording):

“It was a mistake to open up the Facebook platform to developers”

“You should not accept you boss’ friend request”

I must say that I was quite disappointed with the wording of these, it led to people talking at cross purposes (perhaps the intent), people repeating the same thing, and people raising non issues. Nevertheless there were still some good points made, and some interesting lines of thought.

As to the first motion I was strongly against. It frustrated me that there were not even any real arguments for it (perhaps I’m being a bit strong here). The panel seemed to focus on the quality of applications, the number of applications and the usefulness of them. These are all valid points, BUT I don’t think that they are valid here. These issues are all down to the developer(s), and are on an app-by-app basis: if you don’t LIKE the applications made then these (reasons) would be good reason to click ‘remove’ or to in fact not add the application in the first place. You shouldn’t say that all applications should be removed because some (if not most) are ‘rubbish’. Remember you don’t have to add the application.

It was the second motion, or the discussion around it, that really interested me. I didn’t actually vote on this one because I really didn’t like the phrasing, it left for a lot of ambiguity (or none depending on the way that you look at it). You could imply from this that “my boss cannot be my friend” or “my boss must be my friend”. I think that the simplest reasoning for “SHOULD I accept a friend request from MY boss” is simply this: “if my boss is my friend then I’ll add him, if he’s not my friend then I won’t add him”. There was a lot of chat about “what if my boss sees pictures of me from the weekend” or “what if my boss reads what some of my friends say to me”, but I think that there’s a bigger point here, I don’t think it just applies to boss’, I think that it is:

“How do I manage my different identities across Facebook (or in life in general)?” JP said last night that if you compartmentalise different parts of your life that you’ll end up with schizophrenia, and I agree with this. The thing is though that most people do have slightly different persona’s or identities depending on the environment that they are in. Everyone adapts but we all adapt differently. There are things that you’ll say to you mother that you won’t tell your friends. There are things that you’ll say to your friends that you won’t say to your colleagues etc. It’s the margins between these differences that you need to think about. Some people may not be all that different at the weekend, some people may be as relaxed around colleagues as they are around friends or family. So I really think that you need to consider what it is you are hoping to achieve or get from Facebook; what part(s) of yourself do you want to be represented.

Consider it this way: Think of Facebook as a party. Now you have many friends, family etc that you could invite. You may be the sort of person where all of your friends get along, all of your family gets along and you could invite who you want and everything would be fine. Or you may be have the situation where some friends or family members do not get along. Or you may know if certain people are there they may offend others or perhaps get you into trouble (telling stories best left private etc). So you have to make a decision what sort of party you want to have, who you want to invite etc. I think Facebook is similar. You may have friends, family and colleagues that you’re perfectly happy to expose to each other and so adding them is fine, but then again you may not want to expose them to each other and in that case you need to choose what route you want to go down. Do I want just my friends as friends, or just my colleagues etc.

Of course there is the ability to profile and restrict access, but most people (rightly or wrongly) probably can’t be bothered to do any real configuration here. So what it normally boils down to is you end up sharing everything with people added as friends.

I think I can sum up with three points:

  • Education. There are lots of features and security setting etc that people are not aware of. If people fully understand what the capabilities are, there will be less confusion, and perhaps less concern over issues that then become mute.
  • Alignment. If the different aspects of your life are vastly different, then you need to manage (or at least be aware of) how they align or cross over (in Facebook).
  • Choice. The web (and indeed life) is all about choice. You CHOOSE to add an application, you CHOOSE to add a friend, you CHOOSE to get drunk and do something stupid (which your friend may post a photo of). At the end of the day Facebook doesn’t force you to do anything. You don’t even have to have a Facebook account. So you cannot blame another person or a website for your actions.

TiddlyBlogger is here – JavaScript blog posting with XML-RPC and TiddlyWiki

October 11, 2007 by boycook

I mentioned in an earlier post that I was interested in turning TiddlyWiki into an offline blogging tool. The idea being that you often get a spare few minutes when you’re offline, and you could use that time to do things like write your blog.

So what I’ve done is added an option to each Tiddler ‘publish as blog’. This calls an object that I’ve created (called blog), which builds and XML-RPC message, and then send’s it via Ajax. At the moment I’ve only tested this with WordPress, but it should also work with blogger and a few others.

You can view an example of this at:

http://www.craigcook.co.uk/samples/TiddlyBlogger.html

and the script file can be found at:

http://www.craigcook.co.uk/samples/BlogPlugin.js

You’ll need to modify some variables in BlogPlugin.js for your own blog details.

TiddlyMojo – Sending SMS and making phone calls with TiddlyWiki

October 5, 2007 by boycook

So I took a slightly different route than planned this week. My day job steered me towards looking into mojo (http://mojo.bt.com). This is an implementation of the BT SDK (http://web21c.bt.com/) that allows you to create gadgets that utilise Web21C and can be easily be added to your website (or application).

So in keeping of all things TiddyWiki (http://tiddlywiki.com/) I created a plugin for TiddlyWiki that allows you to send a SMS and make a call from within your TiddlyWiki.

You can view a sample of it at:

http://www.craigcook.co.uk/samples/TiddlyMojo.html

Or you can just download the scriptfile directly:

http://www.craigcook.co.uk/samples/MojoPlugin.js

Please note that you will also need the following file for encryption:

http://www.craigcook.co.uk/samples/sha1.js

TiddlyBlogger – publishing blogs created in TiddlyWiki to online blog

October 1, 2007 by boycook

Continuing on from my RSS reader TiddlyWiki frame of mind, I thought that it would be cool to be able to something similar with writing blogs.

My idea stems from the fact that TiddlyWiki is perfect for offline working.

So to set the scenario you you’re working offline, but you want to write your blog: you may be on the train to work, you may on a bus, you may be in the office where you cannot connect to the internet etc. There are hundreds of different circumstances.

What I want to create is a plugin that will enable you to write your blog into a tiddler, and then when you’re online do something like ‘click to publish’ and then this will post your blog into your blogging account (e.g. WordPress, blogger etc).

So I’m currently trawling the internet looking for any web services that allow you to publish blogs. This way I can create a direct interface in TiddlyWiki and will have no need to create any middleware (or server side code). I’ve found a few API’s (WordPress for example has one), but I’d like to avoid having to write any server side code.

If anyone has any ideas/resources that they think will help please let me know.

I’ll keep you all updated with my progress.

RSSWiki or TiddlyBlog – pulling RSS feeds into your TiddlyWiki

September 26, 2007 by boycook

When I first looked at TiddlyWiki I thought that this would be really cool to use for blogging.

So recently I’ve started to fiddle with creating macros/plugins for TiddlyWiki and I came up with the idea of an RSS reader macro. What it does is pulls in blogs via RSS, and creates a tiddler for each blog, and then tags the tiddler to link it to a specific blog feed (e.g. ‘craigCookBlog’).

The macro I’ve created can either accept two direct parameters (RSSFeedURL, tagName), or if you pass in none it will look to a specific tiddler (RSSFeedList) which contains a comma separated list of RSS feeds and their tagNames.

At the moment it only works if the TiddyWiki is stored locally, I’m working on a solution for when it is stored remotely (i.e. on a server). I’m also working on a better way of adding RSS feeds to the list, but for the moment you get the principle.

You can check it out at:

http://www.craigcook.co.uk/samples/RSSWiki.html

P.s. Please tell me if you have any issues with this URL.

How do I see users presence on a website? (or How do I detect when a user closes the browser?)

September 24, 2007 by boycook

This applies to a website with the client/server relationship. The short answer to this is that you can’t (that I’m aware of anyway). Not properly using any web browser/server components anyway. You can however make a good attempt at it. The problem is this situation is that the client and the server are not in permanent communication with each other, they are disconnected. I would also like to point out that there may be better ways of doing this, this is just a way that has worked for me in the past.

Let’s first set the scene. You have a website where users come and go. They log in and out. Now you want to be able to tell at any one time how many, and specifically which, users are logged in. There are many reasons for wanting to do this, the reason I first did was to create a messaging plug-in for one of my websites.

The easiest way of doing this is every time a user logs in you create an audit record (you could use application variables or write to a DB, it doesn’t really matter), and then when they log out you create another audit record. Then you can compare the records to tell if a user is still logged in.

This is fine if all of your users are nice people that actually bother to click ‘log out’ 99% of users will just close the browser or tab when they are finished, resulting in the users session remaining until it expires (usually about 20 minutes or so later). This is where the problem lies, and what we need to solve.

The solution lies in three areas:

  • An audit log (DB, application variables) to store who is currently logged in. Managed by having records for log in and out.
  • Capturing session start and end.
  • Calling the server to log the session end from the client.

The easiest way to work through this is backwards:

  • The last thing that needs to happen is the function that writes the ‘log out’ audit record is called.
  • This will be called by a function when the user session expired. This can go somewhere like the global.asax file (assuming .Net).

The next problem is that the session will still be alive until it reaches its expiry time. We need to force the session to expire early. This can be done by using the following code at the server level:

HttpContext.Current.Session.Abandon();

We now need to call this from the client at the appropriate time i.e. when the user closes the browser. Unfortunately there is no client-side (JavaScript) event that is fired when the browser closes. There is a:

window.close;

event, but don’t let this fool you. This only works for pop-ups, it doesn’t work for the main browser window. The closest events that do work are:

window.unload;

window.beforeunload;

So you could do something like:

Client JavaScript:

window.unload = funManageUnload;

var closeMe = true;

function funManageUnload()
{
if (closeMe)
{
//Make Ajax call to server

}
}

function navigateWebSite(url)
{
closeMe = false;
window.location.href = url;
}

Server C#

private void killSession()
{
HttpContext.Current.Session.Abandon();
}

void Session_End(object sender, EventArgs e)
{
//Logout code
}

private void logIn(string uName, string pWord)
{
//Login code
}

private void logOut(string uName)
{
//Logout code
}

public bool isUserLoggedIn(string uName)
{
//Compare audit records
}

Both those JavaScript events fire when a form unloads, which does happen when the browser closes. So you can set your code to call specific JS functions when these events fire. You now have to tackle working out when the form is unloading because the browser has been closed, or because of just normal website navigation. There are a couple of ways of doing this:

  • You can use frames in your website. By running the main site through a single frame within a parent frame and then change the child frame URL to different pages as you navigate your website. That way the parent frame will always be loaded and will only unload (or fire the window.unload event) when the browser is closed. The problem with this solution is that it makes searching your website hard. It also means that you cannot have direct URL’s to specific pages of your website (unless you pass in the page name via a querystring), which will mean that search engines (i.e. Google) will not be able to trawl your site. This isn’t really a problem if your site is for personal or company use.
  • Run ALL form submitting through one JavaScript function. You can use a variable to determine if the page is just navigating through the website normally, if set to true (as in the example above) you can make an Ajax call to the server to end the session. If it is set to false then do nothing because this is just normal website navigation. The problem with this way is that if you are using any additional form elements other than plain HTML (e.g. ASP.Net form controls) then there may be form submissions that you cannot trap with JavaScript (e.g. if you allow sorting on an asp:DataGrid)
  • You can use the ASP.Net pagemethods functionality. This allows you to call a function on the server from your JavaScript code. This can be used in the funManageUnload() function, and then the server side function called can kill the session etc. For more information on this see the website http://www.asp.net/ajax/

I’ve not aimed to give a definite solution to this problem, but I’ve hoped to give some pointers in directions that you can take. If anyone finds any better solutions I’d love to hear them.

Shaka, when the walls fell

September 21, 2007 by boycook

One of the fundamentally best ways of learning in life is by example. It’s interesting then to consider a race (the Tamarians in TNG 5×02 ‘Darmok’) that communicates entirely by example, or by metaphor.

‘Shaka, when the walls fell’ is an example of failure (presumeably a battle that went wrong). We can all do well to consider out failures and see what we learn from them. Although we can and do make mistakes the first time round, this is not reason to give up or feel disheartened, but we should view these times as an opportunity to do better. The best way to learn is by example, and if that example is our own we are only human, and although that means we can fail, it also means that we can do better.

‘Darmok and Jalad at Tanagra’ is further example of lessons learned in the pass (two men defeating a common enemy together). People working together will almost always be more benificial than people working alone, and the lessons learned together will again be more benificial than those just learned by oneself. This is an interesting double metaphor, because it suggests that example can be used to go forward in the future, and it itself is an example of this, but also understanding this will be a benfit to those learning it.

Proud to be geeks

September 21, 2007 by boycook

I’m going to keep this brief.

Several years ago Bill Gates said something like ‘be careful how you treat geeks, you may end up working for one’ (my girlfriend added ‘or married to one’).

How true this is. It seems that even without realising, more and more people are becoming ‘geeks’. Not necessarily in the classic sense of the word, but let me put it to you this way: how may people do you know that DON’T have a computer, how many people do you know that DON’T have an email address or mobile phone.

More and more people are finding technology interesting and fun. You get people reading such magazines as stuff and SFX, taking an interest in the later mobile phone and the latest TV series. Who would have thought that ‘Lost’ a Sci-Fi would have the attention of so many ‘normal’ people.

It really excites me that people seem to be finally embracing the advantages of science and technology, and that they are slowly becoming part of everyday life (blog is now almost an everyday term). I look forward to the advances we can make in the future.