-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtumblr_1.0.py
67 lines (52 loc) · 1.74 KB
/
tumblr_1.0.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import pytumblr, time, random
import re
import sys
import os
from time import sleep
def countdown(t):
while t:
mins, secs = divmod(t, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(timeformat, end='\r')
time.sleep(1)
t -= 1
cls()
restart_program()
def restart_program():
python = sys.executable
os.execl(python, python, * sys.argv)
def cls():
os.system('cls' if os.name=='nt' else 'clear')
"""Add as many tags as you want"""
tags = [
'Anime',
'Cartoons'
]
client = pytumblr.TumblrRestClient(
'<consumer_key>',
'<consumer_secret>',
'<oauth_token>',
'<oauth_secret>'
)
tag = random.choice (tags)
for c in client.tagged(tag):
if not c["reblog_key"] in open('posts.txt').read():
if random.randint(1,1) == 1:
f = open('posts.txt', 'a')
f.write(c["reblog_key"] + "\n")
f.close()
client.like(c["id"],c["reblog_key"])
#"""Change the CHANGEME name"""
client.reblog('CHANGEME.tumblr.com',id=c["id"], reblog_key=c["reblog_key"])
print ("Liked & Rebloged: " + tag + " - " + c["blog_name"] + ".tumblr.com" + " - " + c["slug"] + c["reblog_key"])
client.follow(c["blog_name"] + ".tumblr.com")
print ("Followed: " + tag + " - " + c["blog_name"] + ".tumblr.com")
else:
# client.follow(c["blog_name"] + ".tumblr.com")
print ("Followed: " + tag + " - " + c["blog_name"] + ".tumblr.com")
t = random.randint(20,40)
countdown(t)
print ("Couldnt Get Any Posts!")
print ("Waiting..")
te = random.randint(10,20)
countdown(te)