Skip to content

Commit

Permalink
send today's tees with a unique message
Browse files Browse the repository at this point in the history
  • Loading branch information
frascu committed Nov 22, 2020
1 parent 701bd73 commit e3a1c35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Binary file added __pycache__/tee.cpython-38.pyc
Binary file not shown.
10 changes: 6 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ def send(method, params):
print("CALL: ", BASE_URL + method)
print("PARAMETERS:", params)

r = requests.get(url=url_string, params=params)
r = requests.post(url=url_string, json=params)

print("RESPONSE:", r.json())


caption = '[New Today\'s Tee]\n\n{}\n\n{}'
caption = '[New Today\'s Tee]\n{}\n{}'

images = get_tees()
media_array = []
for image in images:
title = image.title.replace(" by", "\nby")
send("sendPhoto", {"chat_id": CHAT_ID, "photo": image.link, "caption": caption.format(title, image.source)})
media_array.append({"type": "photo", "media": image.link, "caption": caption.format(image.title, image.source)})

send("sendMediaGroup", {"chat_id": CHAT_ID, "media": media_array})

0 comments on commit e3a1c35

Please sign in to comment.