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!