Skip to content

Commit

Permalink
add connection
Browse files Browse the repository at this point in the history
  • Loading branch information
dachosen1 committed Oct 26, 2024
1 parent 6f10612 commit f311581
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nearquake/tweet_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def _tweepy_connect(self) -> tweepy.client:

self.client = client

def __init__(self) -> None:
self._tweepy_connect()

def post_tweet(self, tweet_text: dict) -> None:
"""
Post a tweet to twitter
Expand Down Expand Up @@ -61,5 +64,6 @@ def run_tweet_operator(self, tweet_text: dict, conn) -> None:
:param tweet_text: A dictionary containing the tweet data to be posted and saved.
:param conn: A database connection object used to insert the tweet data into the database.
"""
self._tweepy_connect()
self.post_tweet(tweet_text=tweet_text)
self.save_tweet_to_db(tweet_text=tweet_text, conn=conn)

0 comments on commit f311581

Please sign in to comment.