Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import shelve
- import os
- db = shelve.open('archive.db')
- kl = db.keys()
- PATH = '/archive/hex/'
- #users who posted in the sub during open period
- users=["imtheswagmaster","oss_spy","team-periwinkle","GrantH527","Kevenomous","VectorAlpha","Dmosk","macho_horse","KAZZZSPIELPLAZZZ","KAZZZSPIELPLAZZZ","7ty7","MurdockSiren","37a6259cc0c1dae299a7","t_the_initial","kamalist","wae55","WishIWasOnACatamaran","jdaher","Twitch89","Llama_7","supahstein","LicensedPrism","magi093","-Orion-","canadianwater","1------6EQUJ5-11--1-","Imabucsfan","62696e617279","bluesci","kaizack","someone31988","SmellyTurbin","lichorat","Toddler_Souffle","oblonglamppost","D748BC45DE589BA8","Am_Alzheimers","nick5627","JiminP","PM_ME_UR_SONICS","LotsOfVodka","bigcakes","42x42","Tasarus","Barvoucher","imtheswagmaster","dreamtreedown","L1maCh4rlie","river58","davidvillar","VoltNine","khaosoffcthulhu","Boo1098","Ramza_Claus","augenwiehimmel","yungodiin","BowsersaurusRex","Kaeny","Stiverton","CreepyMinerLance"]
- print '\n%i records found' %(len(kl))
- a = raw_input('Create Archive? (Y/N) > ')
- if a == 'y' or a == 'Y':
- print '\nplease wait...'
- if not os.path.exists(PATH):
- os.makedirs(PATH)
- ld = os.listdir(PATH)
- for i,k in enumerate(kl):
- ext = '.hex'
- fname = db[k]['data']['title']+"_"+db[k]['data']['id']+ ext
- text = db[k]['data']['selftext']
- author = db[k]['data']['author']
- if author not in users:
- f = open(PATH + fname, 'w+')
- f.write(text)
- print 'done...'
Add Comment
Please, Sign In to add comment