-
Notifications
You must be signed in to change notification settings - Fork 0
/
tweepy_send_tweet.py
37 lines (27 loc) · 1.18 KB
/
tweepy_send_tweet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import tweepy
from amboss_get_LN_capacity import *
import os
from dotenv import load_dotenv, find_dotenv
ENV_FILE = find_dotenv()
if ENV_FILE:
load_dotenv(ENV_FILE)
# consumer_key = os.environ.get("CONSUMER_KEY")
# consumer_secret = os.environ.get("CONSUMER_SECRET")
# access_token = os.environ.get("ACCESS_TOKEN")
# access_token_secret = os.environ.get("ACCESS_TOKEN_SECRET")
def tweepy_send_tweet(tweet_message,tweet_image):
consumer_key = os.environ.get("CONSUMER_KEY")
consumer_secret = os.environ.get("CONSUMER_SECRET")
access_token = os.environ.get("ACCESS_TOKEN")
access_token_secret = os.environ.get("ACCESS_TOKEN_SECRET")
auth = tweepy.OAuth1UserHandler(consumer_key, consumer_secret, access_token, access_token_secret)
api = tweepy.API(auth)
# get_capacity()
# Define the tweet text
# tweet="Current LN channel capacity: " + str(capacity_btc) + "BTC"
# tweet_message="Current LN channel capacity: " + str(capacity_btc) + "BTC"
# For text only tweets
# api.update_status(tweet)
# tweet_image ='LNmarketcapbotLIGHTNING.png'
# Generate text tweet with media (image)
api.update_status_with_media(tweet_message, tweet_image)