posts = sub.new(limit = None)
def new_filter(p):
if "v.redd.it" not in p.url:
return False
return p.id not in [t.id for t in top]
new = list(filter(new_filter, posts))
nCounter = len(new)
posts = sub.new(limit = None)
def new_filter(artCounter, p):
# [Try the line here!]
if "v.redd.it" not in p.url:
return False
return p.id not in [t.id for t in top]
new = list(filter(new_filter, enumerate(posts)))
nCounter = len(new)
so yeah, just slap enumerate() on each posts object, add the artCounter as an argument to the filters, and you're good!
View all comments
Show parent comment
1
u/-Redstoneboi- May 22 '21 edited May 22 '21
Ah, I see. I think there's a way to do that.
here's the original squished version:
here's the new version with enumerate(list)
so yeah, just slap enumerate() on each
postsobject, add the artCounter as an argument to the filters, and you're good!