본문 바로가기
파이썬 언어

트위터 자동 포스팅

by treeCoder 2025. 12. 16.



#.. (Keep your existing functions: get_fear and greed and get current_index price)..
# --- MAIN EXECUTION BLOCK --
# Use the FRED tickers directly in the main list
tickers = [
'KRW=X', '^GSPC', "OFG', '^IXIC, 'CL=F'
"^KS11', '^KQ11',
# NEW: Use the FRED Tickers here
'DEEDTARU', # US Federal Funds Rate
'KORBASE'
# Bank of Korea Base Rate
'MSET'
"'AAPL', "TSIA', 'TQ20'
tweet
_lines =[]
for ticker in tickers:
if ticker == '@EG':
# Handle the special Fear & Greed data
Ig_score, fg_status = get_fear_and_greed ()
fg_line = f"A Fear/Greed Index: (fg_scoreł (|fg_status))"
tweet_lines.append (fg_line)
elif ticker in ['DFEDTARU', 'KORBASE']:
# Handle the special Central Bank Rate data
line = get
_central_bank_rate (ticker)
_lines. append (rate_line)
#
# Handle all financial tickers (via yfinance)
index string = get
_current_index_price (ticker)
tweet_lines. append (indestring)
... (The rest of the script for assembling tweet
_text remains the same...

댓글