def decode_unionid(unionid_text): numbers = unionid.decode(unionid_text) if len(numbers) == 3: click.echo('user_id={} feed_id={} offset={}'.format(*numbers)) elif len(numbers) == 2: click.echo('user_id={} feed_id={}'.format(*numbers)) else: click.echo(numbers)
def _decode_union_feed_ids(option_feeds): """ >>> _decode_union_feed_ids('014064,0140be') [196, 366] """ return [unionid.decode(x)[1] for x in option_feeds.strip().split(',')]