removed thinkspot and GUI reworks

main
Yuriy 11 months ago
parent 4215cc71ae
commit 038bbdf9fa

@ -98,7 +98,7 @@ global Locals
global LinkedIn
global MeWe
global Twetch
global ThinkSpot
; global ThinkSpot
; global Flote
global PocketNet
; global parler
@ -266,7 +266,7 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
VideoURL := BitChuteURL
if(PodcastNumber != ""){
PodcastURL := https://fdrpodcasts.com/%PodcastNumber% . "`n"
PodcastURL := "https://fdrpodcasts.com/" . PodcastNumber . "`n"
}
; Append bitchute url to bottom of description
@ -306,7 +306,7 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
(Locals != "")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 1)
(LinkedIN != "")?(LinkedINCheckStatus := 0) : (LinkedINCheckStatus := 1)
(Twetch != "")?(TwetchCheckStatus := 0) : (TwetchCheckStatus := 1)
(ThinkSpot != "")?(ThinkSpotCheckStatus := 0) : (ThinkSpotCheckStatus := 0)
; (ThinkSpot != "")?(ThinkSpotCheckStatus := 0) : (ThinkSpotCheckStatus := 0)
; (Flote != "")?(FloteCheckStatus := 0) : (FloteCheckStatus := 0)
; (Pintrest != "")?(PintrestCheckStatus := 0) : (PintrestCheckStatus := 1)
; (Parler != "")?(ParlerCheckStatus := 0) : (ParlerCheckStatus := 0)
@ -327,7 +327,7 @@ if(TestingMode){ ; Easy testing for Yuriy
LinkedINCheckStatus := 0
MeWeCheckStatus := 0
TwetchCheckStatus := 0
ThinkSpotCheckStatus := 0
; ThinkSpotCheckStatus := 0
PocketNetCheckStatus := 0
}
@ -486,9 +486,9 @@ Gui, Add, Checkbox, y+7 vTwetch Checked%TwetchCheckStatus% gUpdateVars, Twetch
; Second Row
; Gui, Add, Checkbox, vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
Gui, Add, Checkbox, x+75 yp-180 vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
Gui, Add, Checkbox, x+75 yp-190 vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
; Gui, Add, Checkbox, y+7 vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
Gui, Add, Checkbox, y+7 vThinkspot Checked%ThinkSpotCheckStatus% gUpdateVars, Thinkspot
; Gui, Add, Checkbox, y+7 vThinkspot Checked%ThinkSpotCheckStatus% gUpdateVars, Thinkspot
; Gui, Add, Checkbox, y+7 vFlote Checked%FloteCheckStatus% gUpdateVars, Flote
; Gui, Add, Checkbox, y+7 vParler Checked%ParlerCheckStatus% gUpdateVars, Parler
Gui, Add, Checkbox, y+7 vSteemit Checked%SteemitCheckStatus% gUpdateVars, Steemit
@ -826,7 +826,7 @@ IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowT
(Locals = 1)?(PostedWebsites .= "Locals|") : ()
(LinkedIn = 1)?(PostedWebsites .= "LinkedIn|") : ()
(Twetch = 1)?(PostedWebsites .= "Twetch|") : ()
(ThinkSpot = 0)?(PostedWebsites .= "ThinkSpot|") : ()
; (ThinkSpot = 0)?(PostedWebsites .= "ThinkSpot|") : ()
; (Flote = 1)?(PostedWebsites .= "Flote|") : ()
(PocketNet = 1)?(PostedWebsites .= "PocketNet|") : ()
(Gettr = 1)?(PostedWebsites .= "Gettr|") : ()
@ -901,8 +901,8 @@ Gosub, PostToMeWe
if(Twetch)
Gosub, PostToTwetch
if(Thinkspot)
Gosub, PostToThinkSpot
; if(Thinkspot)
; Gosub, PostToThinkSpot
if(Locals)
Gosub, PostToLocals
@ -994,20 +994,14 @@ Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center,
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %MeWe%
Gui, Font, s9
Gui, Add, Button, x%MarginSpace% y+20 w165 h50 gCancelPost, Close
Gui, Add, Button, x+%Marginspace% w215 h50 gSendErrorLoggingThroughTelegram, Telegram Detailed Errorlog
Gui, Add, Button, x+%Marginspace% h50 w165 gTryFailedAgain, Try Failed Again
Gui, Font, s%GUINormalFontSize%
gui, font, s8
Gui, Add, Button,x%StatusTextSecondRowXPos% y40 w%WebsiteButtonWidths%Center h%ButtonHeights%, ThinkSpot
Gui, Font, s%GUINormalFontSize%
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %ThinkSpot%
; gui, font, s8
; Gui, Add, Button,x%StatusTextSecondRowXPos% y40 w%WebsiteButtonWidths%Center h%ButtonHeights%, ThinkSpot
; Gui, Font, s%GUINormalFontSize%
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %ThinkSpot%
Gui, Font, s%GUINormalFontSize%
; Gui, Font, s%GUINormalFontSize%
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Flote
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Flote%
@ -1015,21 +1009,31 @@ Gui, Font, s%GUINormalFontSize%
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% gActivateParlerTab Center, Parler
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Parler%
Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Steemit
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Steemit
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Steemit%
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Pintrest
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Pintrest%
Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Tumblr
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
; Gui, Font, s9
/*
Gui, Add, Button, x%MarginSpace% y+20 w165 h50 gCancelPost, Close
Gui, Add, Button, x+%Marginspace% w215 h50 gSendErrorLoggingThroughTelegram, Telegram Detailed Errorlog
*/
Gui, Font, s8
Gui, Add, Button, x%StatusTextSecondRowXPos% y+40 w270 h40 Center gCopyPostToClipboard, Copy Post To Clipboard `nFor Easy Pasting to Other Sites
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSpace% w270 h40 Center gCopyImageFilepathToClipboard, Copy Image Filepath To Clipboard
Gui, Add, Button, x%StatusTextSecondRowXPos% y40 w270 h40 Center gCopyPostToClipboard, Copy Post To Clipboard `nFor Easy Pasting to Other Sites
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%marginspace% w270 h40 Center gCopyImageFilepathToClipboard, Copy Image Filepath To Clipboard
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%marginspace% h50 w270 h80 gTryFailedAgain, Try Failed Again
/*Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, PocketNet
@ -1187,7 +1191,7 @@ Return
; Thinkspot
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
; #include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
; Misc Functions
;------------------------------------------------

@ -1,196 +0,0 @@
; -------------------------------ThinkSpot-------------------------------
PostToThinkSpot:
CurrentSite := "Thinkspot"
if(PostTags = ""){
Message = Skipped: No Post Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
IniWrite, Skipped: No Post Tags, %StatusFileFilePath%, Status, Thinkspot
Return
}
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://www.thinkspot.com/create/post")
if(URLAttempt = "Failed")
Return
Status := CheckCurrentTabForCurrentSite()
if(Status){
Return
}
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, "/sign_in")){
Message = Login Cookies Expired. Trying to Re-Login
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; SaveDriverURLOFErrorPage()
; Return
Xpath = //input[@name='commit']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
if(!Status){
Message = Logged in Successfully
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo("https://www.thinkspot.com/create/post")
(Status)?(Return):()
sleep, 2000
}
}
Status := CheckCurrentTabForCurrentSite()
if(Status){
Return
}
/*
Xpath = //a[@href='/create/post']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to Click "Create Post" button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
*/
; CLick into the title box of the new post window
Xpath = //div[@id='editorjs']//div[@class='ql-editor ql-blank']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to Click Into Titlebox: Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
sleep, 500
; Input the Post Title
SaveOrPostProgress(Message:="Inputting Post Title",PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitle)
if(Status){
Message = Failed to Input Post Title: Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Input post body
if(ImageAttachmentFilepath != "")
PostBody := PostBody . "`n"
SaveOrPostProgress(Message:="Inputting Post Content",PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //div[@id='editorjs']//p
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostBody)
if(Status){
Message = Failed to Input Post Body: Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Input Post Tags
Xpath = //span[@role='textbox']
TagsArray := StrSplit(PostTags, ",")
TagsArrayLength := TagsArray.Length() ; Save total number of items in the array
loop, %TagsArrayLength%{
Tag := TagsArray[A_Index]
Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=Tag)
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
}
if(ImageAttachmentFilepath != ""){
; Click "Image" button
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
; Insert image by sending it directly.
; elements aren't loaded until the attach image button is pressed though, so defeats the purpose
/*Xpath = //input[@class='ql-image']
try driver.FindElementByXPath(Xpath).SendKeys(ImageAttachmentFilepath)
*/
Xpath = //button[@class='ql-image']
Status := Selenium_LoopToClickXpathAndWaitForOpenWindow(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
if(Status){
Message = Failed to click "Attach Image" button
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = //input[@class='ql-image']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
if(Status){
Message = Failed to Attach Image (E#7611)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
else, {
InputStatus := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
if(InputStatus = "Failed")
{
sleep, 2000
Xpath = //i[@class='material-icons-outlined'][normalize-space()='image'] ; give it a second try :fingerscrossed:
Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
InputStatus := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
if(InputStatus)
{ ; Try sending directly to element
Xpath = //input[@class='ql-image']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
if(Status){
Message = Failed to Attach Image (E#7612)
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
}
}
SaveOrPostProgress(Message:="Waiting 10 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 10000
}
; Click the Post button
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //button[normalize-space()='Post']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){
Message = Failed to Submit Post
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
IniWrite, Successful, %StatusFileFilePath%, Status, Thinkspot
AddToTotalPostsPostedCount()
PauseBetweenPosts()
; dismiss the pop up that appears for some reason
; try driver.switchToalert().accept()
DevModeMsgBox("done!")
Message = Post Publish Successful
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Return
; -------------------------------/ThinkSpot-------------------------------
Loading…
Cancel
Save