Python tripcodes```import cryptdef tripcode(pw): pw = pw[:8] salt = (pw + "H.")[1:3] trip = crypt.crypt(pw, salt) return trip[-10:]```
backlinksimport osimport refrom collections import defaultdictdef do_backlink(th='0'): mt = load_thread(th) # here a thread is a list of replies. bl = defaultdict(list) for n, t in enumerate(mt): repl = re.findall(r'\>\>[1-9][00-99]*', t) repl = [r[8:] for r in repl if r] for r in repl: if int(r) >= len(mt) or str(n) in bl[r]: continue bl[r].append(str(n)) # generate the list of backlinks for r in sorted([int(k) for k in bl.keys()]): r = str(r) return bl[/code]Then...[code] # for each post in a threadif str(post_number) in bl.keys(): print("<div class='bl'>Replies: ") anchor = "<a href='#{0}'><i>>>{0}</a></i>" print(", ".join([anchor.format(ref) \ for ref in bl[str(post_number)]])) print("</div>")
>>1>>2The tag is "cb" here, not "code".
>>3You don't tell me what to do.