Skip to content

Commit

Permalink
Feat: Added cache command
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince-Shaikh committed May 12, 2021
1 parent ff12ce7 commit 214dcbf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions config/credentials.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Credentials]
username =

This comment has been minimized.

Copy link
@Babur1996

Babur1996 Apr 1, 2023

m.mbabur

This comment has been minimized.

Copy link
@DD436

DD436 Nov 20, 2023

AIFA

password =

This comment has been minimized.

Copy link
@DD436

DD436 Nov 20, 2023

naim_bouabada

username =

This comment has been minimized.

Copy link
@DD436

DD436 Nov 20, 2023

naim_bouabada

password =
11 changes: 3 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
import sys
import signal

try:
f = open("config/settings.json",'w')
f.write("{}")
except FileNotFoundError:
print("Settings.json don't exist.")
finally:
f.close()

is_windows = False

try:
Expand Down Expand Up @@ -47,6 +39,8 @@ def cmdlist():
print("Enable/disable export in a '<target username>_<command>.json' file'")
pc.printout("addrs\t\t")
print("Get all registered addressed by target photos")
pc.printout("cache\t\t")
print("Clear cache of the tool")
pc.printout("captions\t")
print("Get target's photos captions")
pc.printout("commentdata\t")
Expand Down Expand Up @@ -136,6 +130,7 @@ def _quit():
'quit': _quit,
'exit': _quit,
'addrs': api.get_addrs,
'cache': api.clear_cache,
'captions': api.get_captions,
"commentdata": api.get_comment_data,
'comments': api.get_total_comments,
Expand Down
10 changes: 10 additions & 0 deletions src/Osintgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,3 +1535,13 @@ def get_comments(self):
json.dump(json_data, f)
else:
pc.printout("Sorry! No results found :-(\n", pc.RED)

def clear_cache(self):
try:
f = open("config/settings.json",'w')
f.write("{}")
pc.printout("Cache Cleared.\n",pc.GREEN)
except FileNotFoundError:
pc.printout("Settings.json don't exist.\n",pc.RED)
finally:
f.close()

0 comments on commit 214dcbf

Please sign in to comment.