Create memes.py
Browse files
memes.py
CHANGED
|
@@ -11,17 +11,17 @@ IMGFLIP_URL = "https://api.imgflip.com/caption_image"
|
|
| 11 |
# 12 template names → Imgflip template_ids
|
| 12 |
TEMPLATE_IDS = {
|
| 13 |
"Drake Hotline Bling": "181913649",
|
| 14 |
-
"UNO Draw 25 Cards": "
|
| 15 |
-
"Bernie Asking For Support": "
|
| 16 |
"Disaster Girl": "97984",
|
| 17 |
-
"Waiting Skeleton": "
|
| 18 |
-
"Always Has Been": "
|
| 19 |
"Woman Yelling at Cat": "188390779",
|
| 20 |
-
"I Bet He's Thinking About Other Women": "
|
| 21 |
-
"One Does Not Simply": "
|
| 22 |
-
"Success Kid": "
|
| 23 |
-
"Oprah You Get A": "
|
| 24 |
-
"Hide the Pain Harold": "
|
| 25 |
}
|
| 26 |
|
| 27 |
@st.cache_resource
|
|
@@ -70,11 +70,10 @@ def article_to_meme(article_text: str) -> str:
|
|
| 70 |
if template_id is None:
|
| 71 |
raise KeyError(f"Unknown template: {template}")
|
| 72 |
|
| 73 |
-
creds = st.secrets["imgflip"]
|
| 74 |
params = {
|
| 75 |
"template_id": template_id,
|
| 76 |
-
"username":
|
| 77 |
-
"password":
|
| 78 |
"text0": text0,
|
| 79 |
"text1": text1,
|
| 80 |
}
|
|
|
|
| 11 |
# 12 template names → Imgflip template_ids
|
| 12 |
TEMPLATE_IDS = {
|
| 13 |
"Drake Hotline Bling": "181913649",
|
| 14 |
+
"UNO Draw 25 Cards": "217743513",
|
| 15 |
+
"Bernie Asking For Support": "222403160",
|
| 16 |
"Disaster Girl": "97984",
|
| 17 |
+
"Waiting Skeleton": "109765",
|
| 18 |
+
"Always Has Been": "252600902",
|
| 19 |
"Woman Yelling at Cat": "188390779",
|
| 20 |
+
"I Bet He's Thinking About Other Women": "110163934",
|
| 21 |
+
"One Does Not Simply": "61579",
|
| 22 |
+
"Success Kid": "61544",
|
| 23 |
+
"Oprah You Get A": "28251713",
|
| 24 |
+
"Hide the Pain Harold": "27813981",
|
| 25 |
}
|
| 26 |
|
| 27 |
@st.cache_resource
|
|
|
|
| 70 |
if template_id is None:
|
| 71 |
raise KeyError(f"Unknown template: {template}")
|
| 72 |
|
|
|
|
| 73 |
params = {
|
| 74 |
"template_id": template_id,
|
| 75 |
+
"username": st.secrets["IMGFLIP_USERNAME"],
|
| 76 |
+
"password": st.secrets["IMGFLIP_PASSWORD"],
|
| 77 |
"text0": text0,
|
| 78 |
"text1": text1,
|
| 79 |
}
|