mirror of
https://github.com/anatolykopyl/Twitter-Bot.git
synced 2026-03-26 12:54:49 +00:00
Cleaned the code up
Spacing mostly and unnecesarry comments
This commit is contained in:
@@ -10,10 +10,6 @@ import filecmp
|
||||
import shutil
|
||||
import check
|
||||
|
||||
|
||||
|
||||
#Pillow
|
||||
|
||||
#authorization in Twitter and clarifai
|
||||
from clarifai import rest
|
||||
from clarifai.rest import ClarifaiApp
|
||||
@@ -23,12 +19,7 @@ from keys import *
|
||||
app = ClarifaiApp(CLIENT_ID, CLIENT_SECRET)
|
||||
model = app.models.get("general-v1.3")
|
||||
|
||||
|
||||
|
||||
def id_generator(size=5, chars=string.ascii_letters + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
|
||||
|
||||
|
||||
|
||||
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
|
||||
4
check.py
4
check.py
@@ -1,7 +1,5 @@
|
||||
|
||||
def check_temp(): #return temp. yours Rpi
|
||||
cmd = '/opt/vc/bin/vcgencmd measure_temp'
|
||||
line = os.popen(cmd).readline().strip()
|
||||
temp = line.split('=')[1].split("'")[0]
|
||||
return temp
|
||||
|
||||
return temp
|
||||
4
main.py
4
main.py
@@ -1,4 +1,3 @@
|
||||
|
||||
from twython import Twython, TwythonError
|
||||
import random
|
||||
import sys
|
||||
@@ -12,14 +11,13 @@ import shutil
|
||||
from check import *
|
||||
import authorization
|
||||
|
||||
|
||||
import PIL
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
from clarifai import rest
|
||||
from clarifai.rest import ClarifaiApp
|
||||
log_file=open('log_file.txt','a')
|
||||
|
||||
log_file=open('log_file.txt','a')
|
||||
|
||||
dir = str(os.getcwd())+'/'
|
||||
os.chdir(dir)
|
||||
|
||||
Reference in New Issue
Block a user