Skip to content

Commit

Permalink
Merge pull request #2 from Neecrownsmith/patch-3
Browse files Browse the repository at this point in the history
Solved Deprecation Issue
  • Loading branch information
DavyJonesCodes authored Nov 22, 2024
2 parents ee96317 + 6c3dd12 commit 2e6ab30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions PyTweetToolkit/utils/request_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import requests
from datetime import datetime
import datetime
import time


Expand Down Expand Up @@ -100,8 +100,8 @@ def _handle_response(self, response: requests.Response) -> requests.Response:
# Handle rate limiting
reset_time = response.headers.get('x-rate-limit-reset')
if reset_time:
reset_time = datetime.utcfromtimestamp(int(reset_time))
current_time = datetime.utcfromtimestamp(time.time())
reset_time = datetime.datetime.fromtimestamp(int(reset_time), datetime.UTC)
current_time = datetime.datetime.fromtimestamp(time.time(), datetime.UTC)
wait_seconds = (reset_time - current_time).total_seconds() + 1
raise RuntimeError(f"429 Too Many Requests | Rate limit exceeded. Retry after {wait_seconds} seconds | Message: {error_msg}".strip())
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="PyTweetToolkit",
version="1.0.1",
version="1.0.2",
author='Dev Jones',
author_email='[email protected]',
description='PyTweetToolkit: An intuitive Python library for managing Twitter interactions, providing tools for posting tweets, engaging with users, and analyzing social media metrics. Perfect for automating tasks and integrating Twitter functionality into Python projects.', # Short project description
Expand Down

0 comments on commit 2e6ab30

Please sign in to comment.