Ask HN: Review my Code - My_Favorite_HN_Submitters
http://dl.getdropbox.com/u/1395097/MyFavoriteSubmitters.py
This script will:
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.
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! :-)
While writing this script, I noticed a few interesting things:
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?
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.
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.
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?
Thank you to everyone for making this site so amazing. I owe this community a debt of gratitude.