Wednesday, July 2, 2008

RSS and Main Page

So using OmniMents I have found that the most annoying thing is, I have no idea when someone adds a comment to a page or replies to a comment that I left. My only option is to keep refreshing the page every few minutes to see if anyone has added something. (Actually I can look at the datastore to see if anyone has added something, but you can't and its ordered weird.) So I decided to do two things to help with this.

First I added an rss feed that will update with the newest comments. The rss link will take you to the page that the comment is on. This will help you keep track of new comments and easily let you reply to any comments you see in your feed. You can add the rss feed by going here: http://omniments.appspot.com/rss/ or you can click on the rss button that shows up in the Firefox address bar when you are at any of the OmniMents pages. I think the rss feed will become overly huge and annoying once more people start using it, so this is just a temporary fix. I will add one that will allow you to filter what you want sent to you soon.

Second I threw together a quick home page at: http://omniments.appspot.com/ The homepage shows you the last 10 comments and then links to the comment's page so that you can view the thread and add your own comments.

I have also tweaked the script, but nothing significant so I will just wait until I have time to throw it into a Firefox extension before I update it.

So I think next up is creating the Firefox extension and then adding styles and ajaxifying the comments and home pages.

Let me know how everything works for you guys and if you have any ideas for usability improvement.

Thnaks!

Tuesday, July 1, 2008

Updated Script!

I know something you guys wanted was an OmniMents count in Google Reader. Sorry kiddos... No cross domain ajax. It took me forever to figure that out. I have found a workaround by using an iframe... but I think that might cause some strange side effects. Play with it and see. I haven't gotten the formatting right and it doesn't autoupdate yet, just when the page reloads. But here is the new script. Just open the current script in grease monkey and copy this new one in and save it. This one also opens the OmniMents page in a new tab, per Rogers request. And the login is fixed... mostly.

// ==UserScript==
// @name Google Reader OmniMents Link
// @description Adds a OmniMent to the end of the action row
// @namespace http://omniments.appspot.com
// @include http://www.google.tld/reader/*
// @include https://www.google.tld/reader/*
// ==/UserScript==


var entries=document.getElementById("entries");
if(entries)
entries.addEventListener('DOMNodeInserted', function(event){nodeInserted(event);},true);


function nodeInserted(event){
if (event.target.tagName=="DIV"){
if (event.target.className === "entry-actions"){
// List mode
var linkbar=event.target;
} else if (event.target.firstChild && event.target.firstChild.className=="card"){
// Expanded mode
var linkbar=event.target.firstChild.firstChild.childNodes[2].childNodes[1].firstChild;
} else
return;

var parent= linkbar;
while (parent.tagName != "TBODY") {
parent= parent.parentNode;
}

var link = parent.getElementsByClassName("entry-title-link")[0].getAttribute('href');
var site = parent.getElementsByClassName("entry-source-title-parent")[0].getElementsByTagName("A")[0].firstChild.nodeValue;
var title = parent.getElementsByClassName("entry-title-link")[0].firstChild.nodeValue;
var OMLink ="http://omniments.appspot.com/display.html?article=" + link;
var span = document.createElement("span");
span.className = "OmniMents";
var a_link = document.createElement("a");
a_link.href = OMLink;
a_link.title = "OmniMents For: " + title;
a_link.setAttribute('style','text-decoration:none;padding-right:10px;margin-right:10px; background: center right no-repeat;');
a_link.setAttribute('target', '_blank');
a_link.appendChild(document.createTextNode("OmniMents"));
span.appendChild(a_link);
var iframe = document.createElement("iframe");
iframe.setAttribute('src', 'http://omniments.appspot.com/count.html?article=' + link);
iframe.setAttribute('frameborder','0');
iframe.setAttribute('width','20');
iframe.setAttribute('height','20');
iframe.setAttribute('vspace','0');
iframe.setAttribute('hspace','0');
iframe.setAttribute('marginwidth','0');
iframe.setAttribute('scrolling','no');
linkbar.appendChild(span);
linkbar.appendChild(iframe);
}
}
Feel free to play around with the script if you think you can make it look better.

My current list of features to be added (in no particular order):
  • OmniMents popup in a bubble in Google Reader(I think I can do this with an iframe too)
  • Build a firefox extension for OmniMents so you guys don't have to update your scripts everytime I make a change
  • OmniMents favicon and logo. (If anyone has artistic ability and wants to take a shot at this, go for it.)
  • Style the OmniMents page
  • Add threading and ratings to the OmniMents
  • Ajax and web 2.0 -ify anything I can
  • Home page for OmniMents that shows hot and recent threads, and the ones you commented on recently
  • Any other ideas guys? Let me know
I know there is a lot of work ahead and I appreciate you guys using the app and letting me know how to improve it.

Thanks!

Monday, June 30, 2008

OmniMents

I absolutlely love Google Reader. It brings all of my favorite web pages, blogs, news sources, and comics to one central site. The only complaint I have is that it doesn't have a built-in comments section. I know that you can share things with a note... but notes suck. You can't reply, unless you make another note... and it is hard for people to follow the conversation.

I did quick search on Google to see if anyone else had had this problem and did something about it. I found a few people who agree with me, but no one has made a solution. So I decided to give it a try.

Introducing OmniMents!(name subject to change)

This is a very early version of a Google Reader Commenting System. And I mean early. This is basically a proof of concept, but I am a strong believer of release early, release often. So I am releasing at the earliest possible moment and I will try to add at least one feature a week. (We will see how long that last.)

Installing OmniMents:
  1. First you need firefox: www.getfirefox.com
  2. Then you need GreaseMonkey: https://addons.mozilla.org/en-US/firefox/addon/748
  3. Once GreaseMonkey is installed, restart firefox. Then right click on the little monkey on the bottom right hand corner. Go to "New User Script." You should see something like this:
  4. Make sure the includes is: "http://www.google.com/reader/view/*"
  5. Once you choose your favorite text editor then copy this into the script:
    // ==UserScript==
    // @name Google Reader OmniMents Link
    // @description Adds a OmniMent to the end of the action row
    // @namespace http://omniments.appspot.com
    // @include http://www.google.tld/reader/*
    // @include https://www.google.tld/reader/*
    // ==/UserScript==

    var entries=document.getElementById("entries");
    if(entries)
    entries.addEventListener('DOMNodeInserted', function(event){nodeInserted(event);},true);

    function nodeInserted(event){
    if (event.target.tagName=="DIV"){
    if (event.target.className === "entry-actions"){
    // List mode
    var linkbar=event.target;
    } else if (event.target.firstChild && event.target.firstChild.className=="card"){
    // Expanded mode
    var linkbar=event.target.firstChild.firstChild.childNodes[2].childNodes[1].firstChild;
    } else
    return;

    var parent= linkbar;
    while (parent.tagName != "TBODY") {
    parent= parent.parentNode;
    }

    var link = parent.getElementsByClassName("entry-title-link")[0].getAttribute('href');
    var site = parent.getElementsByClassName("entry-source-title-parent")[0].getElementsByTagName("A")[0].firstChild.nodeValue;
    var title = parent.getElementsByClassName("entry-title-link")[0].firstChild.nodeValue;

    link = "http://omniments.appspot.com/display.html?article=" + link
    var span = document.createElement("span");
    span.className = "OmniMents";
    var a_link = document.createElement("a");
    a_link.href = link;
    a_link.title = "OmniMents For: " + title;
    a_link.setAttribute('style','text-decoration:none;padding-right:10px;margin-right:10px; background: center right no-repeat;');
    a_link.appendChild(document.createTextNode("OmniMents"));
    span.appendChild(a_link);
    linkbar.appendChild(span);
    }
    }
  6. Then go to Google Reader and OmniMents should be in your action bar:

Clicking on the OmniMents link will take you to a comments page just for that URL. It should make you login the first time you try to post a comment. (It throws an error after logging in, but if you hit back twice it should all be good from there. I will fix the error tonight!)

Let me know any features you want added and any problems you have in the comments!

Thanks!