Skip to content

Instantly share code, notes, and snippets.

@tedder
Created December 31, 2013 23:00
Show Gist options
  • Save tedder/8203137 to your computer and use it in GitHub Desktop.
Save tedder/8203137 to your computer and use it in GitHub Desktop.
mlkshk top images of 2013 html generatomagic script
import requests
hotlist = requests.get('http://mlkshk.com/static/outfile.txt').text
count = 0
for line in hotlist.splitlines():
share_key, created, like_count, username = line.split("\t")
count += 1
if share_key == 'share_key': continue
print """
<div class="theimage"><a href="http://mlkshk.com/p/%s"><img src="http://s.mlkshk.com/r/%s" border=0 width="500"></a>
<div class="thetext">Entry %s with %s likes, shared by <a href="http://mlkshk.com/user/%s">%s</a> on %s.</div>
""" % (share_key, share_key, count, like_count, username, username, created.split(' ')[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment