Skip to content

Commit 1e614da

Browse files
adding an admin interface
1 parent e3005b6 commit 1e614da

File tree

324 files changed

+341
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+341
-14
lines changed

src/main/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ async def startup_event():
5858
@app.get("/")
5959
def get_home(request: Request):
6060
context = dict(title=settings.TITLE, description=settings.DESCRIPTION, request=request)
61-
return templates.TemplateResponse("index.html", context)
61+
# return templates.TemplateResponse("index.html", context)

src/tasks/schedulers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44
from asyncio import Queue
55
from urllib.parse import urlparse
6-
6+
from io import BytesIO
77
import requests
88
import tweepy
99
import unicodedata
@@ -142,7 +142,8 @@ async def do_create_tweet(self, article: ArticleData) -> dict[str, str]:
142142
_url: str = article.thumbnail.resolutions[0].url
143143
response = requests.get(_url)
144144
media_content = response.content
145-
media = self._tweepy_api.media_upload(filename=get_filename(_url), file=media_content)
145+
media_file = BytesIO(media_content)
146+
media = self._tweepy_api.media_upload(filename=get_filename(_url), file=media_file)
146147

147148
tweet_data = dict(status=tweet_text, media_ids=[media.media_id])
148149
else:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)