Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various fixes to un-fuck handling of file paths when importing module…
…s within each other The use of manually building file paths was causing various FileNotFoundError problems. I decided to instead use the os.path module to let the paths build themselves using the location of __file__
- Loading branch information
Showing
4 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import datetime | ||
import os | ||
from api import get_twitter_api as api | ||
|
||
PATH_TO_APP_DATA = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'app_data') | ||
|
||
|
||
def extract_all_follower_user_ids(screen_name: str = '') -> None: | ||
""" | ||
Get all of an account's followers' user IDs and write them to a JSON file with today's date. | ||
:param screen_name: | ||
:return: | ||
""" | ||
_api = api.get_twitter_api(os.path.join(PATH_TO_APP_DATA, 'twitter_api_keys.json')) | ||
if screen_name == '': | ||
screen_name = api.get_current_user_json_field('screen_name') | ||
_file_name = f'follower_user_ids {screen_name} {datetime.date.today()}' | ||
print(_file_name) | ||
|
||
|
||
if __name__ == '__main__': | ||
extract_all_follower_user_ids() |