Github Actions의 설정과 학사일정의 대한 정보 추가 및 인스타 업로드 연동
This commit is contained in:
parent
974d900321
commit
468676c432
5 changed files with 201 additions and 78 deletions
33
app/force-event.py
Normal file
33
app/force-event.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import json
|
||||
from instagrapi import Client
|
||||
from datetime import datetime, timedelta
|
||||
import library.lib as lib
|
||||
|
||||
with open('./config.json') as json_file:
|
||||
json_data = json.load(json_file)
|
||||
KEY = json_data['KEY']
|
||||
ROOT = json_data['ROOT']
|
||||
font = f"{ROOT}/library/Pretendard-Bold.ttf"
|
||||
WEBHOOK_URL = json_data['WEBHOOK_URL']
|
||||
|
||||
print("🍪 | Retrieving saved account information.")
|
||||
cl = Client(json.load(open('./temp/auth/cookies.json')))
|
||||
cl.set_proxy("socks5h://localhost:9999")
|
||||
print("🍪 | Account information was successfully retrieved.")
|
||||
|
||||
오늘 = datetime.today()
|
||||
내일 = 오늘 + timedelta(days=1)
|
||||
MLSV_YMD = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d')
|
||||
|
||||
print("📅 | Today is the last day of the month.")
|
||||
print("📆 | Uploading School Event Post")
|
||||
학사일정_경로 = lib.학사일정_얻기(MLSV_YMD)
|
||||
cl.photo_upload(
|
||||
학사일정_경로,
|
||||
caption=f"#인천상정중학교 #상정중학교 #학사일정 \n{내일.strftime("%Y")}년 {내일.strftime("%m")}월 학사일정",
|
||||
extra_data={'is_paid_partnership': False}
|
||||
)
|
||||
|
||||
print("📆 | School Event Post Uploaded")
|
||||
|
||||
print("🎉 | All tasks completed.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue