Created
September 25, 2022 22:35
-
-
Save rahulbanerjee26/675a40e657f98a75b09418b8c06bc201 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
import os | |
from dotenv import load_dotenv | |
load_dotenv() | |
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN') | |
domain = "" | |
title = "" | |
post_wp = True | |
post_medium = True | |
post_devto = True | |
post_hashnode = True | |
with open("index.md", "r") as f: | |
post_content_md = f.read() | |
snippets = getCodeSnippetsFromMarkdown(post_content_md) | |
gistURLs = createGists( | |
GITHUB_TOKEN, | |
snippets, | |
public=True | |
) | |
new_content = replaceCodeSnippetsWithGists( | |
post_content_md, | |
gistURLs, | |
title, | |
hashnode=post_hashnode, | |
devto=post_devto, | |
medium=post_medium, | |
wp=post_wp | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment