|
|
|
|
@ -26,7 +26,7 @@ if __name__ == "__main__": |
|
|
|
|
# Argument och alternativ |
|
|
|
|
argv = argv[1:] |
|
|
|
|
try: |
|
|
|
|
opts, args = getopt(argv, "su:o:", ["single", "users=", "other="]) |
|
|
|
|
opts, args = getopt(argv, "m:u:o:", ["mode=", "users=", "other="]) |
|
|
|
|
for o, a in opts: |
|
|
|
|
if o in ["-u", "--user"]: |
|
|
|
|
users = [ |
|
|
|
|
@ -35,10 +35,16 @@ if __name__ == "__main__": |
|
|
|
|
] |
|
|
|
|
if o in ["-o", "--other"]: |
|
|
|
|
url_other_picture = a |
|
|
|
|
if o in ["-s", "--single"]: |
|
|
|
|
single = True |
|
|
|
|
# mode_nr används för hur ofta profile ska roteras |
|
|
|
|
if o in ["-m", "--mode"]: |
|
|
|
|
mode = a |
|
|
|
|
if mode == 'single': |
|
|
|
|
mode_nr = 1,7 |
|
|
|
|
elif mode == 'few': |
|
|
|
|
mode_nr = 1,4 |
|
|
|
|
else: |
|
|
|
|
single = False |
|
|
|
|
mode_nr = 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if "users" not in globals(): |
|
|
|
|
users = [ |
|
|
|
|
@ -52,11 +58,10 @@ if __name__ == "__main__": |
|
|
|
|
for i in input("Vem/vilka vill du kolla bilder för? ").split(",") |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
if input("Söka bara en bild (single)? ") in ["ja, yes, j, y"]: |
|
|
|
|
single = True |
|
|
|
|
else: |
|
|
|
|
single = False |
|
|
|
|
|
|
|
|
|
mode = input("Söka efter alla, första/sida eller första? (all, few, single)? ").lower().strip() |
|
|
|
|
if mode == '': |
|
|
|
|
mode = 'all' |
|
|
|
|
|
|
|
|
|
if "url_other_picture" in globals(): |
|
|
|
|
users[0].url_other_picture = url_other_picture[url_other_picture.find('facebook.com') + 12:] |
|
|
|
|
|
|
|
|
|
@ -96,7 +101,7 @@ if __name__ == "__main__": |
|
|
|
|
|
|
|
|
|
if user.username not in members_checked:# Hämta reaktioner för den första användaren LÄGG TILL NOT IN MEMBERS_CHECKED |
|
|
|
|
try: |
|
|
|
|
profile_picture_reactions(profile, user, all_pictures, first_user=True, single=single) |
|
|
|
|
profile_picture_reactions(profile, user, all_pictures, first_user=True, mode=mode) |
|
|
|
|
except: |
|
|
|
|
print(traceback.format_exc()) |
|
|
|
|
if len(users) == 1: |
|
|
|
|
@ -122,8 +127,9 @@ if __name__ == "__main__": |
|
|
|
|
sleep_(2) |
|
|
|
|
try: |
|
|
|
|
profile_picture_reactions( |
|
|
|
|
profile, user, all_pictures, single=single |
|
|
|
|
profile, user, all_pictures, mode=mode |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if profile.blocked == True: |
|
|
|
|
# Ta bort profilen ur databasen |
|
|
|
|
arangodb.remove_profile(profile.doc["_key"]) |
|
|
|
|
@ -145,12 +151,12 @@ if __name__ == "__main__": |
|
|
|
|
print("Klar med", user.username, "\n") |
|
|
|
|
|
|
|
|
|
# Rotera fb-profiler |
|
|
|
|
if count_friends == 6: |
|
|
|
|
if count_friends > 5 * mode_nr: |
|
|
|
|
if random.randrange(0, 2, 1) == 1: |
|
|
|
|
profile_nr += 1 |
|
|
|
|
count_friends = 0 |
|
|
|
|
print("Växlar till", profiles[profile_nr].name) |
|
|
|
|
elif count_friends == 10: |
|
|
|
|
elif count_friends > 9 * mode_nr: |
|
|
|
|
profile_nr += 1 |
|
|
|
|
count_friends = 0 |
|
|
|
|
print("Växlar till", profiles[profile_nr].name) |
|
|
|
|
|