mirror of
https://gitlab.com/2-chainz/2-chainz-twitter-bot.git
synced 2025-06-16 07:06:53 +00:00
updated urls
This commit is contained in:
parent
f54439e040
commit
d1182731bd
@ -1,6 +1,6 @@
|
|||||||
# 2 Chainz Twitter Bot
|
# 2 Chainz Twitter Bot
|
||||||
|
|
||||||
Posts weekly tweets to the [@bot_chainz](https://twitter.com/bot_chainz) twitter account. More information about this project at [2.chainz.rest](https://2.chainz.rest)
|
Posts weekly tweets to the [@bot_chainz](https://twitter.com/bot_chainz) twitter account. More information about this project at [2chainz.ansonbiggs.com](https://2chainz.ansonbiggs.com)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -11,7 +11,8 @@ def main(mytimer: func.TimerRequest) -> None:
|
|||||||
# Authenticate to Twitter
|
# Authenticate to Twitter
|
||||||
auth = tweepy.OAuthHandler(keys.keys["API"], keys.keys["API_SECRET"])
|
auth = tweepy.OAuthHandler(keys.keys["API"], keys.keys["API_SECRET"])
|
||||||
auth.set_access_token(
|
auth.set_access_token(
|
||||||
keys.keys["TOKEN"], keys.keys["TOKEN_SECRET"],
|
keys.keys["TOKEN"],
|
||||||
|
keys.keys["TOKEN_SECRET"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create API object
|
# Create API object
|
||||||
@ -20,8 +21,8 @@ def main(mytimer: func.TimerRequest) -> None:
|
|||||||
tries = 0
|
tries = 0
|
||||||
while tweeted == False and tries < 10:
|
while tweeted == False and tries < 10:
|
||||||
try:
|
try:
|
||||||
quote = r.get("https://api.chainz.rest/quote").json()["quote"]
|
quote = r.get("https://chainz-rest.azurewebsites.net/quote").json()["quote"]
|
||||||
alias = r.get("https://api.chainz.rest/alias").json()["alias"]
|
alias = r.get("https://chainz-rest.azurewebsites.net/alias").json()["alias"]
|
||||||
|
|
||||||
api.update_status(status=f"{quote} - {alias}\n")
|
api.update_status(status=f"{quote} - {alias}\n")
|
||||||
tweeted = True
|
tweeted = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user