Spreadsheet output added
This commit is contained in:
199
mainwindow.ui
199
mainwindow.ui
@@ -67,8 +67,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QPushButton" name="SearchButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>380</y>
|
||||
<x>140</x>
|
||||
<y>400</y>
|
||||
<width>95</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
@@ -135,37 +135,11 @@ p, li { white-space: pre-wrap; }
|
||||
<string>FileName</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="Output">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>390</x>
|
||||
<y>10</y>
|
||||
<width>571</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="Popular">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>300</y>
|
||||
<width>94</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Popular?</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDateEdit" name="Since">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>330</y>
|
||||
<y>310</y>
|
||||
<width>110</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
@@ -174,9 +148,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>330</y>
|
||||
<width>66</width>
|
||||
<x>10</x>
|
||||
<y>310</y>
|
||||
<width>41</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -187,8 +161,8 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QDateEdit" name="Until">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>330</y>
|
||||
<x>260</x>
|
||||
<y>310</y>
|
||||
<width>110</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
@@ -197,9 +171,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>330</y>
|
||||
<width>66</width>
|
||||
<x>210</x>
|
||||
<y>310</y>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -207,28 +181,147 @@ p, li { white-space: pre-wrap; }
|
||||
<string>Until</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>980</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menukij">
|
||||
<property name="title">
|
||||
<string>TwintGUI</string>
|
||||
<widget class="QTableWidget" name="Output">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>21</y>
|
||||
<width>571</width>
|
||||
<height>361</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="rowCount">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>140</number>
|
||||
</attribute>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="Popular">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>360</y>
|
||||
<width>94</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Popular</string>
|
||||
</property>
|
||||
<addaction name="action_Close"/>
|
||||
</widget>
|
||||
<addaction name="menukij"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="action_Close">
|
||||
<property name="text">
|
||||
<string>& Close</string>
|
||||
<string> Close</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
25
twintgui.py
25
twintgui.py
@@ -1,6 +1,6 @@
|
||||
# main.py
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
from PySide6 import *
|
||||
from PySide6 import QtWidgets
|
||||
@@ -8,25 +8,23 @@ from PySide6.QtUiTools import QUiLoader
|
||||
import twint
|
||||
from PySide6.QtWidgets import QApplication, QPushButton
|
||||
from PySide6.QtCore import Slot
|
||||
|
||||
|
||||
import os
|
||||
import sqlite3
|
||||
|
||||
#Ggsya made this :D
|
||||
def backslash():
|
||||
return('\ '[0])
|
||||
|
||||
#def check_and_create_dir(path):
|
||||
# if os.path.exists(path):
|
||||
# print('Dir already exists')
|
||||
# print('Exiting')
|
||||
# else:
|
||||
# os.mkdir(path)
|
||||
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')
|
||||
check_and_create_dir(os.getcwd() + '\output')
|
||||
|
||||
search = window.Keyword.toPlainText()
|
||||
city = window.City.toPlainText()
|
||||
@@ -41,6 +39,7 @@ def tweet_search():
|
||||
c.Search = search
|
||||
c.Near = city
|
||||
c.Limit = limit
|
||||
c.Store_csv = True
|
||||
c.Popular_tweets = window.Popular.checkState()
|
||||
|
||||
#c.Since = window.Since
|
||||
@@ -48,8 +47,8 @@ def tweet_search():
|
||||
#c.Username =
|
||||
|
||||
#filename becomes the file path
|
||||
#filename = os.getcwd() + '\output' + backslash() + window.Filename.toPlainText() + '.txt'
|
||||
#c.Output = filename
|
||||
filename = os.getcwd() + '\output' + backslash + window.Filename.toPlainText()
|
||||
c.Output = filename
|
||||
|
||||
twint.run.Search(c)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.15.2, 2021-08-14T12:13:33. -->
|
||||
<!-- Written by QtCreator 4.15.2, 2021-08-15T11:23:56. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@@ -173,16 +173,16 @@
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">/home/linly/Documents/Work/Apps/TwintGUI/twintgui.py</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">PythonEditor.RunConfiguration./home/linly/Documents/Work/Apps/TwintGUI/twintgui.py</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/linly/Documents/Work/Apps/TwintGUI/twintgui.py</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">/home/linly/Work/Apps/TweetSearcherPOG/twintgui.py</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">PythonEditor.RunConfiguration./home/linly/Work/Apps/TweetSearcherPOG/twintgui.py</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/linly/Work/Apps/TweetSearcherPOG/twintgui.py</value>
|
||||
<value type="QString" key="PythonEditor.RunConfiguation.Interpreter">{f1c2d9db-f11e-401c-8982-385dc026078c}</value>
|
||||
<value type="QString" key="PythonEditor.RunConfiguation.Script">/home/linly/Documents/Work/Apps/TwintGUI/twintgui.py</value>
|
||||
<value type="QString" key="PythonEditor.RunConfiguation.Script">/home/linly/Work/Apps/TweetSearcherPOG/twintgui.py</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/linly/Documents/Work/Apps/TwintGUI</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/linly/Work/Apps/TweetSearcherPOG</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
|
||||
Reference in New Issue
Block a user