Thursday, October 13, 2011

You can find me now blogging at Agiliq.com where I blog about Django Web Development.

Monday, February 5, 2007

Reddit Trivia One

1. http://www.downingstreetmemo.com/ was the first link submitted to Reddit. It got a total of four comments.
2. There were no comments on reddit for the first few months.
3. A poll against Bush got the maximum votes on reddit. Ever. (1720). This was an obvious karma whoring.
4. There is a reddiquite page. Have you read it yet? (All reddit help)
5. There is a reddit store. Have you bought anything yet?
6. Kam0 is the user with maximum overall karma
7. Reddit used to store passwords in cleartext, instead of hashing it. Not now. After they lost the password.
8. Reddit had an overly agressive user agreements. Everybody who read it got pissed. Spez, an admin had to say that the policy was bulshit before people cooled down.
9. Reddit's first user was kn0thing
10. Reddit currently has more than 1,800,000 (around two million) links in the system. How do I know this? Check the www.reddit.com page. Bring your mouse over the save/hide link and check the status bar. The id for current highest link is 1812514, and all ids in the between exist.
Id for the oldest link is 7. Do the maths.

And now, a bonus for reading till the end. (From store)

Saving *EVERY* link on reddit

The previous hack allowed you to upvote every link on reddit. This hack can be used to save every/ a number of links in one go.

(Doing this hack requires you to be using Firefox with Firebug installed. You might line reading the previous hack to understand this better)

1. Start the firebug console.
2. Paste this code in the console.
for(i=100; i < 200 ; i++){
id = i;
uh = '[your user hash]';
dir = 1;
new Ajax.Request('/ajax', {parameters: "action=save&id=" + id});
}
3. Click run.
4. Check your profile, to see that the links have got saved.
(Or check my profile saved links And see that about a hundered links were saved that way.)

Upvoting *EVERY* link on reddit

(Doing this hack requires you to be using Firefox with Firebug installed. )

Using this hack you can upvote any number of links at a time. However use this at you own risk. If you end up getting banned, sued or anything else, I probably cant help you.

1. Get the user hash which Reddit uses to uniquely identify you.
1.1 Right click in the page and choose "View source".
1.2 Search(CTRL+F) for 'onclick="javascript:mod' , without the quotes.
1.3 This would show something like
onclick="javascript:mod(1813204, 0, '479733a478a35011111b4e70000000000').
1.4 Note the last string, this is your user hash.

2 Start the firebug console.
2.1. Once you have both firefox and firebug installed, you would see a green check box in your bottom-right corner.
2.2. Click it to start firebug.
2.3 Click on console tab and paste this code after typing your user hash

for(i=100; i <200; i++)
{
id = i;

uh = ''[your user hash]";
dir = 1;
new Ajax.Request('/ajax', {parameters: "action=mod&id="+id+"&dir="+dir+"&uh="+uh});
}
3. Click on run. You have just upvoted a hundred links.

(Please do not abuse this. If you upvote thousands of link, the reddit servers would get overloaded and this hack probably banned).

(Explaination of the hack for the programatically inclined.)

When you upvote a link on Reddit, the function mod(id, uc, uh) from reddit.js?v=2 is called.

The arguments used are
1. id = id of the link. (My guess is that it is the primary key of the links table in the reddit database)
2. uc = Whether we want to upvote or downvote?
3. uh = User hash. This is used to uniquely determine which user has voted for the link. This probably is the salted hash of your username.

It does a number of things like checking if you are logged in, and those do not interest us. The last line is the only interesting line for us.

new Ajax.Request('/ajax', {parameters: "action=mod&id="+id+"&dir="+dir+"&uh="+uh});
This makes a HTTP Post request to upvote the link you choose. Since we want to upvote ten requests at a time, we use a loop and make that post requests ten times, or hundered times as needed.

What is reddit?

Reddit is a community website where users can post links to content on the web. Other users may then vote the posted links up or down, causing them to appear more or less prominently on the reddit home page.

The site also has discussion areas where users may discuss the posted links. Users may also vote for or against others' comments. When there are enough votes against a given comment, it will not be displayed by default, although a reader can cause it to be shown through a link or preference. Users who submit articles which are liked and subsequently voted up receive "karma", points which a user receives as a reward for submitting interesting articles.

Reddit also includes several topical sections called subreddits, which focus on specific topics, including programming and science.

(From http://en.wikipedia.org/wiki/Reddit.com)