Improve fetching of financial data.
This commit is contained in:
@@ -6,13 +6,17 @@ import glob
|
||||
from datetime import datetime, timezone
|
||||
import praw
|
||||
from dotenv import load_dotenv
|
||||
from pathlib import Path
|
||||
|
||||
# --- CONFIGURATION ---
|
||||
IMAGE_DIR = "images"
|
||||
|
||||
def get_reddit_instance():
|
||||
"""Initializes and returns a PRAW Reddit instance from .env credentials."""
|
||||
load_dotenv()
|
||||
"""Initializes and returns a PRAW Reddit instance using OAuth2 refresh token."""
|
||||
|
||||
env_path = Path(__file__).parent / '.env'
|
||||
load_dotenv(dotenv_path=env_path)
|
||||
|
||||
client_id = os.getenv("REDDIT_CLIENT_ID")
|
||||
client_secret = os.getenv("REDDIT_CLIENT_SECRET")
|
||||
user_agent = os.getenv("REDDIT_USER_AGENT")
|
||||
|
Reference in New Issue
Block a user