rushankg commited on
Commit
3946047
·
verified ·
1 Parent(s): a0ed106

Create memes.py

Browse files
Files changed (1) hide show
  1. memes.py +11 -12
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": "61579",
15
- "Bernie Asking For Support": "233998734",
16
  "Disaster Girl": "97984",
17
- "Waiting Skeleton": "4087833",
18
- "Always Has Been": "124055727",
19
  "Woman Yelling at Cat": "188390779",
20
- "I Bet He's Thinking About Other Women": "61580",
21
- "One Does Not Simply": "61582",
22
- "Success Kid": "12165991",
23
- "Oprah You Get A": "21759",
24
- "Hide the Pain Harold": "28251713",
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": creds["username"],
77
- "password": creds["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
  }