66from src import printcolors as pc
77import sys
88import signal
9+ import readline
10+
11+ commands = ["quit" , "exit" , "list" , "help" , "addrs" , "captions" , "comments" , "followers" ,
12+ "followings" , "fwersemail" , "fwingsemail" , "hashtags" , "info" , "likes" ,
13+ "mediatype" , "photodes" , "photos" , "propic" , "stories" , "tagged" , "target" ,
14+ "wcommented" , "wtagged" ]
915
1016
1117def printlogo ():
@@ -16,7 +22,7 @@ def printlogo():
1622 pc .printout ("\_______ /____ >__|___| /__| \___ /|__| (____ /__|_| /\n " , pc .YELLOW )
1723 pc .printout (" \/ \/ \/ /_____/ \/ \/ \n " , pc .YELLOW )
1824 print ('\n ' )
19- pc .printout ("Version 0.8 - Developed by Giuseppe Criscione - 2019\n \n " , pc .YELLOW )
25+ pc .printout ("Version 0.9 - Developed by Giuseppe Criscione - 2019\n \n " , pc .YELLOW )
2026 pc .printout ("Type 'list' to show all allowed commands\n " )
2127 pc .printout ("Type 'FILE=y' to save results to files like '<target username>_<command>.txt (deafult is disabled)'\n " )
2228 pc .printout ("Type 'FILE=n' to disable saving to files'\n " )
@@ -41,6 +47,8 @@ def cmdlist():
4147 pc .printout ("followings\t " )
4248 print ("Get users followed by target" )
4349 pc .printout ("fwersemail\t " )
50+ print ("Get email of target followers" )
51+ pc .printout ("fwingsemail\t " )
4452 print ("Get email of users followed by target" )
4553 pc .printout ("hashtags\t " )
4654 print ("Get hashtags used by target" )
@@ -73,7 +81,17 @@ def signal_handler(sig, frame):
7381 sys .exit (0 )
7482
7583
84+ def completer (text , state ):
85+ options = [i for i in commands if i .startswith (text )]
86+ if state < len (options ):
87+ return options [state ]
88+ else :
89+ return None
90+
91+
7692signal .signal (signal .SIGINT , signal_handler )
93+ readline .parse_and_bind ("tab: complete" )
94+ readline .set_completer (completer )
7795
7896printlogo ()
7997
@@ -108,6 +126,8 @@ def signal_handler(sig, frame):
108126 api .get_followings ()
109127 elif cmd == 'fwersemail' :
110128 api .get_fwersemail ()
129+ elif cmd == 'fwingsemail' :
130+ api .get_fwingsemail ()
111131 elif cmd == "hashtags" :
112132 api .get_hashtags ()
113133 elif cmd == "info" :
0 commit comments