Add files via upload
Need date function pls
This commit is contained in:
80
twintgui.py
80
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()
|
||||
|
||||
Reference in New Issue
Block a user