示例#1
0
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
示例#2
0
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
示例#3
0
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))
示例#4
0
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