# main.py import os import sys from PySide6 import * from PySide6 import QtWidgets from PySide6.QtUiTools import QUiLoader import twint from PySide6.QtWidgets import QApplication, QPushButton from PySide6.QtCore import Slot #Ggsya made this :D backslash = '\\' #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 date_dic= { 'Jan':'1', 'Feb':'2', 'Mar':'3', 'Apr':'4', 'May':'5', 'Jun':'6', 'Jul':'7', 'Aug':'8', 'Sep':'9', 'Oct':'10', 'Nov':'11', 'Dec':'12' } def date_cruncher(bad_date): good_date_list = bad_date.split() good_date_day = good_date_list[2] good_date_month = date_dic[good_date_list[1]] good_date_year = good_date_list[3] good_date = good_date_year + '-' + good_date_month + '-' + good_date_day return(good_date) def tweet_search(): #checking if output folder exists #check_and_create_dir(os.getcwd() + '\output') 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 = date_cruncher(window.Since.date().toString()) c.Until = date_cruncher(window.Until.date().toString()) #c.Username = 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()