def SendingList(api, tag, list_name):
"""
Sending message
"""
global FFS, CONTROLE, counter, dryrun
print "Running for %s: %d" % (tag, len( FFS[list_name] ))
MSG = tag + " "
for name in FFS[list_name]:
if CONTROLE.has_key(name):
continue
else:
CONTROLE[name] = 1
print counter, name
name = '@' + name
if ( len(MSG + " " + name) > SIZE):
print MSG
if not dryrun:
api.PostUpdate(MSG)
sleep(randrange(1,30) * 60)
MSG = tag + " " + name
else:
MSG += " " + name
counter += 1
print MSG
if not dryrun:
try:
if not re.search("@", MSG):
# empty
return
api.PostUpdate(MSG)
except twitter.TwitterError as e:
if ( re.search('Status is a duplicate.', e.message) ):
pass
sleep(randrange(1,30) * 60)
评论列表
文章目录