def shouldSendAlbum(channel, album): thash = str(''.join(album.cap[:20].split())) + str(channel.id) if not existing.add(thash): return False if album.video or album.imgs: return True return len(album.cap) > 20
def shouldProcess(channel, card, key): if not passFilter(channel, card, key): return False whash = weiboo.getHash(card) + str(channel.id) if not existing.add(whash): return False return True
def send(status): thash = str(getHash(status)) + str(channel.id) if not existing.add(thash): return album = twitter_2_album.get(str(status.id), origin=[str(channel.id), channel.username]) if shouldSendAlbum(channel, album): try: album_sender.send_v2(channel, album) except: debug_group.send_message('send fail. error: %s, url: %s' % (e, album.url))
def shouldProcess(channel, status, key): if channel.id in processed_channels: return False if status._json.get('in_reply_to_status_id'): return False if not passFilter(channel, status, key): return False if status.id < 1361617669598957569: return False # timestamp cut thash = str(getHash(status)) + str(channel.id) if not existing.add(thash): return False processed_channels.add(channel.id) return True