Created
December 31, 2013 23:00
-
-
Save tedder/8203137 to your computer and use it in GitHub Desktop.
mlkshk top images of 2013 html generatomagic script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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