This commit is contained in:
aaron 2025-06-21 10:00:37 +08:00
parent 8498a2f23d
commit 94b77b1949
3 changed files with 18 additions and 4 deletions

View File

@ -58,9 +58,9 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit:
return result
@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)
data = response.json()

View File

@ -29,7 +29,7 @@ services:
cryptoai-api:
build: .
container_name: cryptoai-api
image: cryptoai-api:0.2.22
image: cryptoai-api:0.2.23
restart: always
ports:
- "8000:8000"

16
test.py
View File

@ -1,5 +1,19 @@
from cryptoai.agents.crypto_agent import CryptoAgent
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__":
token_selector.main()
asyncio.run(main())