

Ask HN: Review my Code - My_Favorite_HN_Submitters - markerdmann

The Python script is available at:<p>http://dl.getdropbox.com/u/1395097/MyFavoriteSubmitters.py<p>This script will:<p>1. Ask you for your credentials
2. Login to HN
3. Download your list of saved links
4. Use that list to generate a sorted list of your favorite submitters
5. Output that list as a simple HTML file with appropriate links. You can now easily browse the saved links of each of your favorite submitters.<p>Please use this responsibly! The idea is not to bring down the HN server with a flood of automated traffic. You'll notice that there is a delay built into the script that slows down the HTTP requests. Don't comment that out! :-)<p>While writing this script, I noticed a few interesting things:<p>The first is that HN doesn't keep a permanent record of your saved links. After 210, it starts discarding the oldest ones. Perhaps this could be changed?<p>The second is that the top-ranked submitters tend to be people who submit more links. Makes sense. One way to improve this script would be to design a formula for submitter quality. For example, take the number of submissions that you voted up and divide it by the user's total number of submissions in that period of time. This involves even more scraping of the site, though, which I'm hesitant to do before pg gives this a thumbs up or thumbs down.<p>The third thing is the extent to which the "new" page can be a no man's land where good links go to die. Many of my favorite submitters have excellent submissions with only one karma point, which is a result of the "now or never" voting phenomenon. If a new link isn't given one or two upvotes within a few minutes of being submitted (so that it appears on the front page), it has forever lost any hope of getting the votes it deserves. Perhaps this could be fixed? One idea might be to give links a "second chance" at the new page if they receive an upvote after being completely dormant for more than a week.<p>I hope you enjoy the script! I've been teaching myself programming over the past year (mostly by reading SICP and Hacker News), and I would love to receive feedback. Is there anything I could have done better? Could I have written something in a more elegant way? Is there something I did really well?<p>Thank you to everyone for making this site so amazing. I owe this community a debt of gratitude.
======
jacquesm
> If a new link isn't given one or two upvotes within a few minutes of being
> submitted (so that it appears on the front page), it has forever lost any
> hope of getting the votes it deserves.

This has been a real problem, and the last two weeks it has gotten very bad
indeed.

The 'new' page doesn't scale.

A good indicator of how big the problem is at the moment is the 'age' of the
oldest item on the new page. That used to be 2 to 4 hours, now even on a
'quiet' time of the day it is only 1 hour.

The reason why there is a cut-off at 210 elements for the 'new', 'saved' and
'news' pages is that this will reduce some performance bottlenecks. They're
slowly getting shorter.

It's a real pity, especially for the 'saved' page because that is one use of
HN, as a bookmarking service.

------
jacquesm
Ok, a review of the code:

I increased the sleep to 10 seconds, 1 second is pushing it.

Double return of the same value in the tail of GetFavoriteSubmitters so you
can drop two lines there.

Maybe add a linefeed at the end of every row of users so you can still make
sense of it in a text editor ?

Missing 'close' at the end of the writing of the file. Sure, the file will be
closed by the script that exits but that's sloppy.

That's about it.

The results:

    
    
      edw519	5
      yarapavan	4
      fogus	4    
      amichail	4
      zjj	2
      prabodh	2
      nopassrecover	2
      dreemteem	2
      boundlessdreamz	2
    

All the rest of them are 'one-offs'. I guess I'm not much of a groupie :)

~~~
markerdmann
Thank you for your feedback, Jacque! I'll change the script accordingly.

------
markerdmann
Clickable link:

<http://dl.getdropbox.com/u/1395097/MyFavoriteSubmitters.py>

