Created
August 29, 2019 11:50
-
-
Save fmarani/9e54c55db2413d2cdc931cd4e05b9c73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_tag_string(post_id, tags=[], new=False): | |
""" | |
... | |
""" | |
if new: | |
tags.append('new') | |
post = get_post(post_id) | |
post_tags = [t.decode("utf8", "ignore") for t in post.get('tags', [])] | |
additional_tags = [t.decode("utf8", "ignore") for t in tags] | |
final_tags = set(post_tags + additional_tags) - set(['']) | |
return '{}: {}'.format(post.get('author'), ', '.join(final_tags)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment