mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 15:40:26 +01:00
update github acction
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
86315f25a0
commit
0b34065deb
7 changed files with 114 additions and 26 deletions
2
test/dart-dio/openapi-generator-config.yaml
Normal file
2
test/dart-dio/openapi-generator-config.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
inputSpec: dist/compatible/openapi-3.0.yaml
|
||||
outputDir: dart_dio_generated
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import json
|
||||
import base64
|
||||
from tweepy_authlib import CookieSessionUserHandler
|
||||
|
||||
auth_handler = CookieSessionUserHandler(
|
||||
|
|
@ -9,4 +10,5 @@ auth_handler = CookieSessionUserHandler(
|
|||
|
||||
cookies = auth_handler.get_cookies()
|
||||
|
||||
print(json.dumps(cookies.get_dict()))
|
||||
data = json.dumps(cookies.get_dict())
|
||||
print(base64.b64encode(data.encode("utf-8")).decode("utf-8"))
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
inputSpec: dist/compatible/openapi-3.0.yaml
|
||||
outputDir: python_generated
|
||||
|
||||
packageName: python_generated
|
||||
packageVersion: 0.0.1
|
||||
projectName: python_generated
|
||||
|
||||
useOneOfDiscriminatorLookup: true
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import json
|
||||
import os
|
||||
import logging
|
||||
import python_generated as pt
|
||||
import base64
|
||||
import openapi_client as pt
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
|
|
@ -12,7 +13,8 @@ if Path("cookie.json").exists():
|
|||
with open("cookie.json", "r") as f:
|
||||
cookies = json.load(f)
|
||||
else:
|
||||
cookies = json.loads(os.environ["TWITTER_SESSION"])
|
||||
data = base64.b64decode(os.environ["TWITTER_SESSION"]).decode("utf-8")
|
||||
cookies = json.loads(data)
|
||||
|
||||
cookies_str = "; ".join([f"{k}={v}" for k, v in cookies.items()])
|
||||
|
||||
|
|
@ -65,6 +67,9 @@ for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UserListApi]:
|
|||
except Exception as e:
|
||||
logger.error(f"{key}")
|
||||
logger.error(e)
|
||||
import traceback
|
||||
|
||||
logger.error(traceback.print_exc())
|
||||
error_count += 1
|
||||
|
||||
if error_count > 0:
|
||||
|
|
|
|||
4
test/typescript-fetch/openapi-generator-config.yaml
Normal file
4
test/typescript-fetch/openapi-generator-config.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
inputSpec: dist/compatible/openapi-3.0.yaml
|
||||
outputDir: typescript_fetch_generated
|
||||
|
||||
legacyDiscriminatorBehavior: false
|
||||
Loading…
Add table
Add a link
Reference in a new issue