From 0c88f2fb1584de9825c5926b6fb28c85b1098ec8 Mon Sep 17 00:00:00 2001 From: Linly <79278516+LinlyBoi@users.noreply.github.com> Date: Fri, 20 Aug 2021 21:42:24 +0200 Subject: [PATCH] Add files via upload Need date function pls --- mainwindow.ui | 37 +++++++++++++++++++++--- twintgui.py | 80 +++++++++++++++++++++++++++++---------------------- 2 files changed, 79 insertions(+), 38 deletions(-) diff --git a/mainwindow.ui b/mainwindow.ui index d396a85..6e1092d 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -19,12 +19,12 @@ 10 160 - 81 + 91 31 - Limit + Tweet Limit @@ -127,12 +127,12 @@ p, li { white-space: pre-wrap; } 10 240 - 81 + 91 31 - FileName + Folder Name @@ -144,6 +144,19 @@ p, li { white-space: pre-wrap; } 29 + + + 2006 + 1 + 1 + + + + yyyy/M/dd + + + true + @@ -167,6 +180,22 @@ p, li { white-space: pre-wrap; } 29 + + + + + + 2006 + 1 + 1 + + + + yyyy/M/dd + + + true + diff --git a/twintgui.py b/twintgui.py index 4674f9d..fb257aa 100644 --- a/twintgui.py +++ b/twintgui.py @@ -12,45 +12,56 @@ import sqlite3 #Ggsya made this :D def backslash(): - return('\ '[0]) + return('\ '[0]) + +#def check_and_create_dir(path): + #if os.path.exists(path): + #print('Dir already exists') + #print('Exiting') + #else: + #os.mkdir(path) +#Ggsleeb if you're reading this please use Tab instead of space idk python dumb +#Nvm its Qt Creator thats big dumb why tf is tab just a bunch of spaces wtf + +#Date Transformation Function +#def date_cruncher(Weekday,month,day,year): +# if (month != 'Jan'): +# pass month = '1' +# + + +# date = day + month + year +# print("I crunched the date!") +# print(date) -def check_and_create_dir(path): - if os.path.exists(path): - print('Dir already exists') - print('Exiting') - else: - os.mkdir(path) def tweet_search(): - #checking if output folder exists - check_and_create_dir(os.getcwd() + '\output') + #checking if output folder exists + #check_and_create_dir(os.getcwd() + '\output') - search = window.Keyword.toPlainText() - city = window.City.toPlainText() + search = window.Keyword.toPlainText() + city = window.City.toPlainText() + #filename = os.getcwd() + '\output' + backslash + window.Filename.toPlainText() + filename = window.Filename.toPlainText() + limit = window.Limit.toPlainText() + if limit != '': + pass + else: + limit = 0 + c = twint.Config() + c.Search = search + c.Near = city + c.Limit = limit + c.Store_csv = True + c.Popular_tweets = window.Popular.checkState() + c.Output = filename + c.timedelta = '2' + #c.Since = + #c.Until = window.Until.date().toString() + #c.Username = - limit = window.Limit.toPlainText() - if limit != '': - pass - else: - limit = 0 - - c = twint.Config() - c.Search = search - c.Near = city - c.Limit = limit - c.Store_csv = True - c.Popular_tweets = window.Popular.checkState() - - #c.Since = window.Since - #c.Until = - #c.Username = - - #filename becomes the file path - filename = os.getcwd() + '\output' + backslash + window.Filename.toPlainText() - c.Output = filename - - twint.run.Search(c) + twint.run.Search(c) # is me :D results_textbox.config(state=DISABLED) @@ -60,8 +71,9 @@ app = QtWidgets.QApplication(sys.argv) window = loader.load("mainwindow.ui", None) +#window.SearchButton.clicked.connect(date_cruncher) window.SearchButton.clicked.connect(tweet_search) window.show() - +#print(window.Since.date().toString()) app.exec()