update
This commit is contained in:
parent
8498a2f23d
commit
94b77b1949
@ -58,9 +58,9 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
@router.get("/news")
|
@router.get("/news")
|
||||||
async def get_crypto_news(session: Session = Depends(get_db)):
|
async def get_crypto_news(page: Optional[int] = 1, limit: Optional[int] = 0, session: Session = Depends(get_db)):
|
||||||
|
|
||||||
url = 'https://api.blockbeats.cn/h5v1/newsflash/list?page=1&limit=0&ios=1&end_time=&detective=-2'
|
url = f'https://api.blockbeats.cn/h5v1/newsflash/list?page={page}&limit={limit}&ios=1&end_time=&detective=-2'
|
||||||
|
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
|||||||
@ -29,7 +29,7 @@ services:
|
|||||||
cryptoai-api:
|
cryptoai-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: cryptoai-api
|
container_name: cryptoai-api
|
||||||
image: cryptoai-api:0.2.22
|
image: cryptoai-api:0.2.23
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|||||||
16
test.py
16
test.py
@ -1,5 +1,19 @@
|
|||||||
from cryptoai.agents.crypto_agent import CryptoAgent
|
from cryptoai.agents.crypto_agent import CryptoAgent
|
||||||
import cryptoai.tasks.token_selector as token_selector
|
import cryptoai.tasks.token_selector as token_selector
|
||||||
|
import telegram
|
||||||
|
import asyncio
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
# token_selector.main()
|
||||||
|
|
||||||
|
#https://t.me/c/2299979359/26
|
||||||
|
|
||||||
|
chat_id = "2299979359"
|
||||||
|
|
||||||
|
bot = telegram.Bot(token="5671996954:AAH5ymtcEPEnjlkI5ah2I8MemScmX3VF3bY")
|
||||||
|
|
||||||
|
await bot.send_message(chat_id=chat_id, text="Hello, world!")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
token_selector.main()
|
asyncio.run(main())
|
||||||
Loading…
Reference in New Issue
Block a user