Digg New Comment System Easter Egg

May 16th, 2008

Found a small easter egg in the digg comment code.
Type the following into the comment box at the bottom of the page (Make sure not to hit any keys for at least 2 seconds before you type this, and make sure to type this relatively quickly. No copy and paste):
&&((%’%'ba

Digg New Comment System

May 16th, 2008

For all you greasemonkey script developers, I’ve created a nicely formatted version of diggs new comment javascript.
It’s a replica of what my console looks like, so I apologize for the black background.

I’ll be creating a few scripts that I’ve been thinking of doing sometime in the near future (hopefully).

Posted in comments, digg | 1 Comment »

Digg Top Ten Normalizer

May 11th, 2008

I’ve created a new greasemonkey script to ‘normalize’ the top ten sidebar in digg. Now instead of linking to the comments, it links directly to the story. Beside it there is a link to the comments:

Enjoy: Digg Top Ten Normalizer

Greasemonkey Bug - DOMNodeInserted event doesn’t allow GM_xmlhttpRequest

May 9th, 2008

I’ve been rewriting the Digg Rating Extender greasemonkey script to not use unsafeWindow (The new version is out by the way, so go get it) and ran into an interesting bug.

I’m using the DOMNodeInserted event to see when any comments/replies are added to the comments of the currently viewed story. (It turns out that even though by default you only see the first x (50?) comments in digg, in the background it fetches the rest of the comments and inserts them into the DOM, hidden). So I figure if I see a reply to a comment and I haven’t received the data from the digg api of the number of ups/downs of that reply, I will fetch it using GM_xmlhttpRequest. Fine, should be simple enough.

But, turns out there is a problem with running GM_xmlhttpRequest inside a DOMNodeInserted event. You get the following error:

Error: Greasemonkey access violation: unsafeWindow cannot call GM_xmlhttpRequest.

Why does it consider it an unsafeWindow? I’m not sure. I’m not sure if it’s a firefox issue or a greasemonkey issue, but I have found a simple workaround. Just add the GM_xmlhttpRequest inside of a setTimeout:

Code (javascript)

node.addEventListener(
        "DOMNodeInserted",
        function()
        {
                setTimeout(
                        function()
                        {
                                GM_xmlhttpRequest();
                        },
                        0);
        },
        true);
 

Result: no error!
I’ve submitted a ticket to greasemonkey, but haven’t heard anything back. And since there is a simple workaround I don’t think it’s a high priority for anyone.

Expired Domain

May 6th, 2008

Looks like I let me domain expire… oops.
I got the domain back so all should be back to normal. Sorry for the scare

Digg API Down

September 20th, 2007

UPDATE: They’ve fixed the issue



Sorry all, looks like the digg api is broken/down for a bit.
I can’t update the main digg stats page cause I don’t have ssh access at work.

I’ll keep you all updated on any changes as I find out.

In the mean time, I’ve started a thread on it in the Digg API google group: http://groups.google.com/group/diggapi/browse_thread/thread/45b81c0ab610968b
And I’ve also sent a bug report.

Thanks for the patience!



UPDATE: They’ve fixed the issue

Posted in digg | No Comments »

Graphing Digg Friends

August 21st, 2007

I’ve been playing around with graphviz a little bit.
It’s an interesting application that uses some algorithms I’ve been reading up on to graph different nodes in either a directed or undirected graph (and a bunch of other features that I haven’t played around with).

I thought that maybe I could use it to plot the relationship of friends in a digg story. Works fine for stories with only a few diggs… not so well with any more than 30 or 40.
For the uninitiated, Digg gives members the ability to befriend other members. However, unlike facebook, myspace and the like, the other person doesn’t have to befriend you back. So, person A can have B as a friend, but not necessarily vice-versa.

So, I got a nice looking graph for a story with 30 people, but it was sort of boring. There was a small cluster of about 5 people who were friends with each other, but the rest were pretty much separate. So I tried a larger story, with 120 diggs. Not a good idea.
The result is a 1.5 mb file that doesn’t say anything at all.

For your amusement, I’ve uploaded it here. Click on the fuzziness below:

test.png

WARNING: 1.3MB

Digg Rating Extender

August 19th, 2007


Install Script (Must have Greasemonkey installed on Firefox)



I created a greasemonkey script (FIREFOX ONLY, for now) to show the digg ups and digg downs on digg stories. Here’s a picture of what it looks like now:

screenshot-digg-greasemonkey-sample.png

For those who are interested, details are below. Those who aren’t can’t just go straight to downloading the script.

Some bugs that I am aware of:

  • If you digg a comment up or down, the up and down don’t get updated. (Simple fix, I believe)
  • Sometimes, the up and down don’t match the current rating. There is no fix to that. I’m retrieving the most up to date info from the API and sometimes either there is a delay with that or there is a delay with either the api (likely) or digg. This shouldn’t be a big problem, I’ve only noticed it once or twice while testing and it was only off by one.
  • Doesn’t work with Opera. Will be fixed soon, for both of you.
  • Under heavy load, the ups and downs may not get loaded. You can see if there was an API error in your javascript console, it will probably say error 500. Not sure what I can do about that. I could possibly make the API keep trying, but that’s just going to compound the problem on the server
  • There is a delay, especially when loading large pages. Don’t know what I can do about that, but I’ll look into it

Features I want to add:

  • Clicking on the number of digg downs or digg ups will down down or digg up the story.
  • Ability to choose the design for how to display the ups/downs. (See previous post)
  • Implementing any ideas you suggest.

Other random bits of information:

  • Overhead: There is of course some overhead when using this. Essentially, for every comment you see, the script needs to retrieve that comment again from the api server. This is done asynchronously thanks to AJAX, so the page won’t load any slower than before (Unless you’re running on something like a 56k modem, in which case, welcome to the 21st century).
  • Errors: Let me know if you run into any errors. They should be logged on the javascript console. (Firefox: Tools -> Error Console, should be under messages or errors depending on what the issue was).


Digg Comments, Up and Down

August 15th, 2007

I’ve been on a Digg API kick recently and it doesn’t seem to be stopping.
What surprised me particularly about the API is that theres some info that you can retrieve that’s not even shown on the digg pages. One example of that is the number of ups and downs that a comment received.
Personally, I think that would be really interesting to see, especially for sensitive topic stories (politics, religion, your favorite console (ha), etc).
So of course, I went ahead and did that. Using greasemonkey, I’ve written a short script that shows both the up, the down, and the rating for comments.

Digg Rating Extender Greasemonkey Script
Digg Rating Extender Greasemonkey Script


I’m planning on releasing the script shortly, I just have to work some small bugs out first. Keep on the lookout.

Also, I still haven’t received any designs for the digg comment statistics page, so if you are interested in that, there’s still time. Some people have already expressed interest, but I haven’t seen anything yet.

Design

August 10th, 2007

I’m looking to redesign the digg comment statistics page. The back-end I generally have no problems with, but when it comes to design, I just have no clue.
If someone is willing to redesign my page, I’ll offer you fame, fortune, and a link on the stats page to you or your email address! (OK, one out of three)
Basically, I don’t care how it looks, as long as it looks better than what I have (which isn’t saying much).

Some points to consider:

  • I have both a wide screen monitor and a regular monitor, so I would prefer that the page looks good on both. I generally can’t stand sites that end up using only 800 pixels of my screen. That being said, if it can’t be variable width, I’ll live if it looks good anyway.
  • The graph width can be very wide. So wherever that ends up should probably be in a div with overflow: auto.
  • The same goes for comments. Sometimes people will post a very long link in a comment and it will mess with all the other comments. That’s not good, so each comment should probably be in its own element with overflow: auto.
  • Based on stats, I get about 75% firefox hits. So, if for whatever reason, your idea only works in firefox but still looks reasonable in ie, safari, etc (graceful degradation), I won’t lose too much sleep over it.
  • If more than one person wants to redesign the site, maybe I’ll set up something where people can vote on which they like better? I’m not sure about that yet.

    So if anyone out there is interested and has some time to kill, please let me know.
    You can email me any designs at neaveru AT gmail dot com