From 0869f9d017dbc6b1a1b88aac54a8b7085dd9a9ba Mon Sep 17 00:00:00 2001 From: Linly <79278516+LinlyBoi@users.noreply.github.com> Date: Sat, 14 Aug 2021 15:41:41 +0200 Subject: [PATCH] Add files via upload --- mainwindow.ui | 237 ++++++++++++++++++++++++++++++++++++++++ twintgui.py | 70 ++++++++++++ twintgui.pyproject | 3 + twintgui.pyproject.user | 202 ++++++++++++++++++++++++++++++++++ 4 files changed, 512 insertions(+) create mode 100644 mainwindow.ui create mode 100644 twintgui.py create mode 100644 twintgui.pyproject create mode 100644 twintgui.pyproject.user diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..5f31668 --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,237 @@ + + + QMainWindow + + + + 0 + 0 + 980 + 466 + + + + Tweet Search + + + + + + 10 + 160 + 81 + 31 + + + + Limit + + + + + + 120 + 20 + 251 + 31 + + + + + + + 120 + 90 + 251 + 31 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dubai</p></body></html> + + + + + + 120 + 160 + 251 + 31 + + + + + + + 110 + 380 + 95 + 27 + + + + Search + + + true + + + false + + + + + + 10 + 90 + 81 + 31 + + + + City + + + + + + 10 + 20 + 81 + 31 + + + + Keyword + + + + + true + + + + 120 + 240 + 251 + 31 + + + + + + + 10 + 240 + 81 + 31 + + + + FileName + + + + + + 390 + 10 + 571 + 341 + + + + + + + 10 + 300 + 94 + 24 + + + + Popular? + + + false + + + + + + 70 + 330 + 110 + 29 + + + + + + + 0 + 330 + 66 + 31 + + + + Since + + + + + + 270 + 330 + 110 + 29 + + + + + + + 200 + 330 + 66 + 31 + + + + Until + + + + + + + 0 + 0 + 980 + 29 + + + + + TwintGUI + + + + + + + + + & Close + + + + + + diff --git a/twintgui.py b/twintgui.py new file mode 100644 index 0000000..ea1a4b6 --- /dev/null +++ b/twintgui.py @@ -0,0 +1,70 @@ +# main.py + + +import sys +from PySide6 import * +from PySide6.QtUiTools import QUiLoader +import twint +from PySide6.QtWidgets import QApplication, QPushButton +from PySide6.QtCore import Slot +import os + + +#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 tweet_search(): + print(window.Keyword) + #checking if output folder exists + check_and_create_dir(os.getcwd() + '/output') + + search = window.Keyword.toPlainText() + city = window.City.toPlainText() + + limit = window.Limit.toPlainText() + if limit != '': + pass + else: + limit = 0 + + c = twint.Config() + c.Search = search + c.Near = city + c.Limit = limit + c.Popular_tweets = window.Popular.checkState() + + #c.Since = window.Since + #c.Until = + #c.Username = + + #filename becomes the file path + filename = os.getcwd() + '/output' + '/' + window.Filename.toPlainText() + '.txt' + c.Output = filename + + twint.run.Search(c) + + # is me :D results_textbox.config(state=DISABLED) + + +loader = QUiLoader() +app = QtWidgets.QApplication(sys.argv) + +window = loader.load("mainwindow.ui", None) + +window.SearchButton.clicked.connect(tweet_search) +window.show() + + +app.exec() diff --git a/twintgui.pyproject b/twintgui.pyproject new file mode 100644 index 0000000..1202ca4 --- /dev/null +++ b/twintgui.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["twintgui.py","mainwindow.ui"] +} diff --git a/twintgui.pyproject.user b/twintgui.pyproject.user new file mode 100644 index 0000000..a930820 --- /dev/null +++ b/twintgui.pyproject.user @@ -0,0 +1,202 @@ + + + + + + EnvironmentId + {d50745ff-adff-49b2-8d76-5a191a9d5fa3} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 3 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Desktop + {8b8a4b26-78ec-4f5c-9c80-398035c50ac9} + -1 + 0 + 0 + 0 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + + 25 + + 1 + true + false + true + + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + /home/linly/Documents/Work/Apps/TwintGUI/twintgui.py + PythonEditor.RunConfiguration./home/linly/Documents/Work/Apps/TwintGUI/twintgui.py + /home/linly/Documents/Work/Apps/TwintGUI/twintgui.py + {f1c2d9db-f11e-401c-8982-385dc026078c} + /home/linly/Documents/Work/Apps/TwintGUI/twintgui.py + false + true + false + true + /home/linly/Documents/Work/Apps/TwintGUI + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + +