-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
52 lines (33 loc) · 1.38 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import requests
from GeneateImage import GenerateImage
from instabot import Bot
from time import sleep
import shutil
import getpass
try:
shutil.rmtree("config")
except:
pass
bot = Bot()
def CreateQuote(path, styleIndex,username):
response = requests.get('http://api.quotable.io/random')
quote_data = response.json()
quote_content = quote_data['content']
quote_author = quote_data['author']
final_path = GenerateImage(quote_author, quote_content, path, styleIndex, username)
return str(final_path)
# CreateQuote("quotes/", 1)
def InstagramLogin(username, password):
bot.login(username=username, password=password)
LoopCount = 0
while True:
if (LoopCount % 2) == 0:
photo = CreateQuote("quotes/", 0,username)
else:
photo = CreateQuote("quotes/", 1,username)
LoopCount +=1
sleep(1.5)
bot.upload_photo(photo , caption="LIKE SHARE AND FOLLOW PLEASE #quotes #love #motivation #life #inspiration #quoteoftheday #instagram #motivationalquotes #instagood #quote #follow #bhfyp #like #happiness #positivevibes #success #believe #loveyourself #lifestyle #selflove #inspirationalquotes #happy #lovequotes #yourself #poetry #mindset #goals #quotestagram #quotestoliveby #bhfyp")
username = input("Enter Username: ")
password = getpass.getpass("Enter Password:")
InstagramLogin(username,password)