def fave_mentions(api, dry_run=None):
f = api.favorites(include_entities=False, count=<NUM_LIT>)<EOL>favs = [m.id_str for m in f]<EOL>try:<EOL><INDENT>mentions = api.mentions_timeline(trim_user=True, include_entities=False, count=<NUM_LIT>)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise e<EOL><DEDENT>for mention in mentions:<EOL><INDENT>if mention.id_str not in favs:<EOL><INDENT>try:<EOL><INDENT>api.logger.info('<STR_LIT>', mention.id_str, mention.text)<EOL>if not dry_run:<EOL><INDENT>api.create_favorite(mention.id_str, include_entities=False)<EOL><DEDENT><DEDENT>except RateLimitError:<EOL><INDENT>api.logger.warning("<STR_LIT>", RATE_LIMIT_RESET_MINUTES)<EOL>sleep(RATE_LIMIT_RESET_MINUTES * <NUM_LIT>)<EOL>api.create_favorite(mention.id_str, include_entities=False)<EOL><DEDENT>except TweepError as e:<EOL><INDENT>api.logger.error('<STR_LIT>', mention.id_str)<EOL>api.logger.error("<STR_LIT>", e.api_code, e)<EOL><DEDENT><DEDENT><DEDENT>
Fave (aka like) recent mentions from user authenicated in 'api'.
:api twitter_bot_utils.api.API
:dry_run bool don't actually favorite, just report