forked from ruangrupa/konfluks
		
	autoformatter says change this so i change
This commit is contained in:
		| @ -28,8 +28,7 @@ hashtags = [ | ||||
|  | ||||
| def login_mastodon_bot(): | ||||
|     mastodon = Mastodon( | ||||
|         access_token=os.environ.get("MASTODON_AUTH_TOKEN"), | ||||
|         api_base_url = instance | ||||
|         access_token=os.environ.get("MASTODON_AUTH_TOKEN"), api_base_url=instance | ||||
|     ) | ||||
|  | ||||
|     return mastodon | ||||
| @ -73,9 +72,9 @@ def create_post(post_directory, post_metadata): | ||||
|  | ||||
|     template_dir = os.path.join(Path(__file__).parent.resolve(), "templates") | ||||
|     env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir)) | ||||
|     name = post_metadata['account']['display_name'] | ||||
|     name = post_metadata["account"]["display_name"] | ||||
|     name = sub('"', '\\"', name) | ||||
|     post_metadata['account']['display_name'] = name | ||||
|     post_metadata["account"]["display_name"] = name | ||||
|     env.filters["localize_media_url"] = localize_media_url | ||||
|     env.filters["filter_mastodon_urls"] = filter_mastodon_urls | ||||
|  | ||||
| @ -140,7 +139,10 @@ def main(): | ||||
|                     create_post(post_dir, post_metadata) | ||||
|                     all_existing_posts.append(str(post_metadata["id"])) | ||||
|                 else: | ||||
|                     print("not pulling post %s (post is local only)" % (post_metadata["id"])) | ||||
|                     print( | ||||
|                         "not pulling post %s (post is local only)" | ||||
|                         % (post_metadata["id"]) | ||||
|                     ) | ||||
|  | ||||
|             # if we already have the post do nothing, possibly update | ||||
|             elif str(post_metadata["id"]) in existing_posts: | ||||
| @ -149,7 +151,10 @@ def main(): | ||||
|                     str(post_metadata["id"]) | ||||
|                 )  # create list of posts which have not been returned in the feed | ||||
|             elif str(post_metadata["id"]) in all_existing_posts: | ||||
|                 print("skipping post %s as it was already pulled with a different hashtag." % (str(post_metadata["id"]))) | ||||
|                 print( | ||||
|                     "skipping post %s as it was already pulled with a different hashtag." | ||||
|                     % (str(post_metadata["id"])) | ||||
|                 ) | ||||
|  | ||||
|         for post in existing_posts: | ||||
|             print( | ||||
|  | ||||
		Reference in New Issue
	
	Block a user