Social Media

Social_Media_Sentiment_Analysis.Social_Media.get_tweets(keyword: str, operators: str = '', max_tweets: int | None = None, print_output: bool = True)[source]

Get Tweets from Twitter.

Parameters:
  • keyword (str) – The Tweets you want to find, e.x. ‘BTC’.

  • operators (bool) – Here you can Filter out Tweets, e.x. ‘since:2023-01-17 until:2023-01-18 lang:”en”’.

  • max_tweets – The Max Number of Tweets to find ( If set to None then it will find all tweets ).

  • print_output – Print some details about each Tweet.

Returns:

The Collected Tweets.

Return type:

dict

Social_Media_Sentiment_Analysis.Social_Media.read_tweets(complete_file_location)[source]

Read Tweets ( From Saved Tweets File ).

Parameters:

complete_file_location (str) – The Complete File Location ( Including File name and Extension ).

Returns:

Tweets from the File.

Return type:

pandas.core.frame.DataFrame

Social_Media_Sentiment_Analysis.Social_Media.save_tweets(data: dict, file_location: str)[source]

Save Tweets to a CSV File.

Parameters:
  • data (dict) – This is the Tweets.

  • file_location (str) – This is the File Location (Including File name).