moved imports to main function
We import tweetdelete during setup (for version and author retrieval), but don't have toml yet.
This commit is contained in:
parent
4b84373ad4
commit
759306c02f
1 changed files with 16 additions and 16 deletions
|
@ -6,6 +6,7 @@ __copyright__ = "Copyright 2021 Tobias Schmidl"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
import os
|
import os
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
@ -22,7 +23,6 @@ tweets_to_save = twitter_config["tweets_to_save"] if "tweets_to_save" in twitter
|
||||||
secrets = twitter_config["secrets"]
|
secrets = twitter_config["secrets"]
|
||||||
|
|
||||||
# auth and api
|
# auth and api
|
||||||
if __name__ == "__main__":
|
|
||||||
auth = tweepy.OAuthHandler(secrets['api_key'], secrets['api_key_secret'])
|
auth = tweepy.OAuthHandler(secrets['api_key'], secrets['api_key_secret'])
|
||||||
auth.set_access_token(secrets['access_token'], secrets['access_token_secret'])
|
auth.set_access_token(secrets['access_token'], secrets['access_token_secret'])
|
||||||
api = tweepy.API(auth)
|
api = tweepy.API(auth)
|
||||||
|
|
Loading…
Reference in a new issue