Add files via upload
Need date function pls
This commit is contained in:
@@ -19,12 +19,12 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>160</y>
|
<y>160</y>
|
||||||
<width>81</width>
|
<width>91</width>
|
||||||
<height>31</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Limit</string>
|
<string>Tweet Limit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextEdit" name="Keyword">
|
<widget class="QTextEdit" name="Keyword">
|
||||||
@@ -127,12 +127,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>240</y>
|
<y>240</y>
|
||||||
<width>81</width>
|
<width>91</width>
|
||||||
<height>31</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FileName</string>
|
<string>Folder Name</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QDateEdit" name="Since">
|
<widget class="QDateEdit" name="Since">
|
||||||
@@ -144,6 +144,19 @@ p, li { white-space: pre-wrap; }
|
|||||||
<height>29</height>
|
<height>29</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</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>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@@ -167,6 +180,22 @@ p, li { white-space: pre-wrap; }
|
|||||||
<height>29</height>
|
<height>29</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</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>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
|
|||||||
46
twintgui.py
46
twintgui.py
@@ -14,41 +14,52 @@ import sqlite3
|
|||||||
def backslash():
|
def backslash():
|
||||||
return('\ '[0])
|
return('\ '[0])
|
||||||
|
|
||||||
def check_and_create_dir(path):
|
#def check_and_create_dir(path):
|
||||||
if os.path.exists(path):
|
#if os.path.exists(path):
|
||||||
print('Dir already exists')
|
#print('Dir already exists')
|
||||||
print('Exiting')
|
#print('Exiting')
|
||||||
else:
|
#else:
|
||||||
os.mkdir(path)
|
#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 tweet_search():
|
def tweet_search():
|
||||||
|
|
||||||
#checking if output folder exists
|
#checking if output folder exists
|
||||||
check_and_create_dir(os.getcwd() + '\output')
|
#check_and_create_dir(os.getcwd() + '\output')
|
||||||
|
|
||||||
search = window.Keyword.toPlainText()
|
search = window.Keyword.toPlainText()
|
||||||
city = window.City.toPlainText()
|
city = window.City.toPlainText()
|
||||||
|
#filename = os.getcwd() + '\output' + backslash + window.Filename.toPlainText()
|
||||||
|
filename = window.Filename.toPlainText()
|
||||||
limit = window.Limit.toPlainText()
|
limit = window.Limit.toPlainText()
|
||||||
if limit != '':
|
if limit != '':
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
limit = 0
|
limit = 0
|
||||||
|
|
||||||
c = twint.Config()
|
c = twint.Config()
|
||||||
c.Search = search
|
c.Search = search
|
||||||
c.Near = city
|
c.Near = city
|
||||||
c.Limit = limit
|
c.Limit = limit
|
||||||
c.Store_csv = True
|
c.Store_csv = True
|
||||||
c.Popular_tweets = window.Popular.checkState()
|
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
|
c.Output = filename
|
||||||
|
c.timedelta = '2'
|
||||||
|
#c.Since =
|
||||||
|
#c.Until = window.Until.date().toString()
|
||||||
|
#c.Username =
|
||||||
|
|
||||||
twint.run.Search(c)
|
twint.run.Search(c)
|
||||||
|
|
||||||
@@ -60,8 +71,9 @@ app = QtWidgets.QApplication(sys.argv)
|
|||||||
|
|
||||||
window = loader.load("mainwindow.ui", None)
|
window = loader.load("mainwindow.ui", None)
|
||||||
|
|
||||||
|
#window.SearchButton.clicked.connect(date_cruncher)
|
||||||
window.SearchButton.clicked.connect(tweet_search)
|
window.SearchButton.clicked.connect(tweet_search)
|
||||||
window.show()
|
window.show()
|
||||||
|
|
||||||
|
#print(window.Since.date().toString())
|
||||||
app.exec()
|
app.exec()
|
||||||
|
|||||||
Reference in New Issue
Block a user