1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 14:34:19 +00:00
pds-2021-g2-nest/nest_crawler/authentication.py

21 lines
421 B
Python
Raw Normal View History

2021-05-27 09:21:51 +00:00
import tweepy as tw
import os
2021-05-27 09:21:51 +00:00
def authenticate():
2021-05-30 15:35:49 +00:00
c_k = os.environ['C_K']
c_s = os.environ['C_S']
a_t = os.environ['A_T']
a_t_s = os.environ['A_T_S']
2021-05-27 09:21:51 +00:00
auth = tw.OAuthHandler(c_k, c_s)
auth.set_access_token(a_t, a_t_s)
api = tw.API(auth, wait_on_rate_limit=True)
# client = tw.Client(b_t, c_k, c_s, a_t, a_t_s, wait_on_rate_limit=True);
2021-05-28 13:40:39 +00:00
return api
__all__ = (
"authenticate",
)