Created
February 7, 2025 15:27
-
-
Save guinslym/3b7283b5619136af98cc9f5906fcd366 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from dotenv import dotenv_values | |
# Read the .secrets file | |
config = dotenv_values(".secrets") | |
print(config) | |
from lh3.api import Client | |
client = Client() | |
try: | |
daily_chats = client.chats().list_day(2024, 3, 1) | |
print("Connection successful") | |
except Exception as e: | |
print(f"Connection failed: {str(e)}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [6]: from lh3.api import Client | |
...: | |
...: # Create client and test connection | |
...: client = Client() | |
...: try: | |
...: daily_chats = client.chats().list_day(2024, 3, 1) | |
...: print("Connection successful") | |
...: except Exception as e: | |
...: print(f"Connection failed: {str(e)}") | |
...: | |
Connection failed: invalid username/password combination |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment