Skip to content

Commit

Permalink
Alphabetized command commentdata and added to general commandlist
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuye committed Apr 1, 2021
1 parent 4af6257 commit 9bf9ee8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions doc/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
```
- addrs Get all registered addressed by target photos
- captions Get user's photos captions
- commentdata Get a list of all the comments on the target's posts
- comments Get total comments of target's posts
- followers Get target followers
- followings Get users followed by target
Expand Down
17 changes: 9 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from src.Osintgram import Osintgram
import argparse
Expand All @@ -18,11 +17,11 @@

def printlogo():
pc.printout("________ .__ __ \n", pc.YELLOW)
pc.printout("\_____ \ _____|__| _____/ |_ ________________ _____ \n", pc.YELLOW)
pc.printout(" / | \ / ___/ |/ \ __\/ ___\_ __ \__ \ / \ \n", pc.YELLOW)
pc.printout("/ | \\\___ \| | | \ | / /_/ > | \// __ \| Y Y \\\n", pc.YELLOW)
pc.printout("\_______ /____ >__|___| /__| \___ /|__| (____ /__|_| /\n", pc.YELLOW)
pc.printout(" \/ \/ \/ /_____/ \/ \/ \n", pc.YELLOW)
pc.printout("\\_____ \\ _____|__| _____/ |_ ________________ _____ \n", pc.YELLOW)
pc.printout(" / | \\ / ___/ |/ \\ __\\/ ___\\_ __ \\__ \\ / \\ \n", pc.YELLOW)
pc.printout("/ | \\\\___ \\| | | \\ | / /_/ > | \\// __ \\| Y Y \\\n", pc.YELLOW)
pc.printout("\\_______ /____ >__|___| /__| \\___ /|__| (____ /__|_| /\n", pc.YELLOW)
pc.printout(" \\/ \\/ \\/ /_____/ \\/ \\/ \n", pc.YELLOW)
print('\n')
pc.printout("Version 1.1 - Developed by Giuseppe Criscione\n\n", pc.YELLOW)
pc.printout("Type 'list' to show all allowed commands\n")
Expand All @@ -42,6 +41,8 @@ def cmdlist():
print("Get all registered addressed by target photos")
pc.printout("captions\t")
print("Get target's photos captions")
pc.printout("commentdata\t")
print("Get a list of all the comments on the target's posts")
pc.printout("comments\t")
print("Get total comments of target's posts")
pc.printout("followers\t")
Expand Down Expand Up @@ -128,6 +129,7 @@ def _quit():
'exit': _quit,
'addrs': api.get_addrs,
'captions': api.get_captions,
"commentdata": api.get_comment_data,
'comments': api.get_total_comments,
'followers': api.get_followers,
'followings': api.get_followings,
Expand All @@ -146,8 +148,7 @@ def _quit():
'tagged': api.get_people_tagged_by_user,
'target': api.change_target,
'wcommented': api.get_people_who_commented,
'wtagged': api.get_people_who_tagged,
"commentdata": api.get_comment_data
'wtagged': api.get_people_who_tagged
}

signal.signal(signal.SIGINT, signal_handler)
Expand Down
8 changes: 4 additions & 4 deletions src/Osintgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def setTarget(self, target):

def __getUsername__(self):
try:
u = open("config/username.conf", "r").read()
u = open("config/username.conf").read()
u = u.replace("\n", "")
return u
except FileNotFoundError:
Expand All @@ -57,7 +57,7 @@ def __getUsername__(self):

def __getPassword__(self):
try:
p = open("config/pw.conf", "r").read()
p = open("config/pw.conf").read()
p = p.replace("\n", "")
return p
except FileNotFoundError:
Expand Down Expand Up @@ -1108,7 +1108,7 @@ def login(self, u, p):
settings_file = "config/settings.json"
if not os.path.isfile(settings_file):
# settings file does not exist
print('Unable to find file: {0!s}'.format(settings_file))
print(f'Unable to find file: {settings_file!s}')

# login new
self.api = AppClient(auto_patch=True, authenticate=True, username=u, password=p,
Expand All @@ -1126,7 +1126,7 @@ def login(self, u, p):
on_login=lambda x: self.onlogin_callback(x, settings_file))

except (ClientCookieExpiredError, ClientLoginRequiredError) as e:
print('ClientCookieExpiredError/ClientLoginRequiredError: {0!s}'.format(e))
print(f'ClientCookieExpiredError/ClientLoginRequiredError: {e!s}')

# Login expired
# Do relogin but use default ua, keys and such
Expand Down

0 comments on commit 9bf9ee8

Please sign in to comment.