Add files via upload
Need date function pls
This commit is contained in:
@@ -19,12 +19,12 @@
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>81</width>
|
||||
<width>91</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Limit</string>
|
||||
<string>Tweet Limit</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="Keyword">
|
||||
@@ -127,12 +127,12 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>240</y>
|
||||
<width>81</width>
|
||||
<width>91</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FileName</string>
|
||||
<string>Folder Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDateEdit" name="Since">
|
||||
@@ -144,6 +144,19 @@ p, li { white-space: pre-wrap; }
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumDate">
|
||||
<date>
|
||||
<year>2006</year>
|
||||
<month>1</month>
|
||||
<day>1</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string>yyyy/M/dd</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
@@ -167,6 +180,22 @@ p, li { white-space: pre-wrap; }
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedKingdom"/>
|
||||
</property>
|
||||
<property name="minimumDate">
|
||||
<date>
|
||||
<year>2006</year>
|
||||
<month>1</month>
|
||||
<day>1</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string>yyyy/M/dd</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
|
||||
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