|
|
@ -40,7 +40,7 @@ global UpdateVersionNumber
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScriptName = Freedomain Social Media Poster
|
|
|
|
ScriptName = Freedomain Social Media Poster
|
|
|
|
ScriptVersion = 2.76
|
|
|
|
ScriptVersion = 2.77
|
|
|
|
FullScriptName := ScriptName . " " . ScriptVersion
|
|
|
|
FullScriptName := ScriptName . " " . ScriptVersion
|
|
|
|
|
|
|
|
|
|
|
|
;---ToDo---
|
|
|
|
;---ToDo---
|
|
|
@ -2378,6 +2378,7 @@ CurrentSite := "Locals"
|
|
|
|
; @todo: Add auto-login to locals
|
|
|
|
; @todo: Add auto-login to locals
|
|
|
|
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space%
|
|
|
|
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space%
|
|
|
|
if(LocalsURL = ""){
|
|
|
|
if(LocalsURL = ""){
|
|
|
|
Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=
|
|
|
|
Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=
|
|
|
@ -2385,8 +2386,18 @@ if(LocalsURL = ""){
|
|
|
|
Return
|
|
|
|
Return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; Message = LocalsURL from Ini File: %LocalsURL%
|
|
|
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
Message = LocalsURL from Ini File: %LocalsURL%
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!InStr(LocalsURL, "/share/post")){
|
|
|
|
|
|
|
|
LocalsURL = https://freedomain.locals.com/share/post
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Message = LocalsURL from ini file was incorrect. New URL set to %LocalsURL% and saved to settings.ini
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IniWrite, %LocalsURL%, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; LocalsURL := StrReplace(Localsurl, "/share/post", "")
|
|
|
|
; LocalsURL := StrReplace(Localsurl, "/share/post", "")
|
|
|
|
; LocalsURL := Localsurl . "/login"
|
|
|
|
; LocalsURL := Localsurl . "/login"
|
|
|
@ -2413,87 +2424,27 @@ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
|
|
|
Return
|
|
|
|
Return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
; Xpath = //textarea[@id='body']
|
|
|
|
|
|
|
|
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=2000)
|
|
|
|
|
|
|
|
; if(Status){
|
|
|
|
|
|
|
|
; Message = Trying to Log Back In
|
|
|
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; LocalsLoginURL := LocalsURL . "/login"
|
|
|
|
|
|
|
|
; try driver.Get(LocalsLoginURL) ;Open selected URL
|
|
|
|
|
|
|
|
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; sleep, 3000
|
|
|
|
|
|
|
|
; js = document.getElementsByName('submit')[0].click();
|
|
|
|
|
|
|
|
; try driver.executeScript(js)
|
|
|
|
|
|
|
|
; ; DevModeMsgBox(js)
|
|
|
|
|
|
|
|
; ; clipboard := js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
|
|
|
|
|
|
; sleep, 5000
|
|
|
|
|
|
|
|
; ; try driver.Get(LocalsURL) ;Open selected URL
|
|
|
|
|
|
|
|
; ; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Xpath = //textarea[@id='body']
|
|
|
|
Message = Inputting Post Content
|
|
|
|
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
; {
|
|
|
|
|
|
|
|
; Message = Post Failed: Check Login Status
|
|
|
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
|
|
|
|
; Return
|
|
|
|
|
|
|
|
; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Message = Post Failed: Check Login Status
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
|
|
|
|
Return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Message = Page did not load after 30 seconds. Force stopping refresh and trying to continue
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
send, {Escape} ; Temporary workaround, as Page seems to endlessly load for Stef
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Xpath = //textarea[@id='body']
|
|
|
|
|
|
|
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
|
|
|
|
|
|
|
if(Status){
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:="Post Failed: Check Login Status",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Message = Inputting Post Content
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Xpath = //*[@id="body"]
|
|
|
|
Xpath = //*[@id="body"]
|
|
|
|
try driver.FindElementByXPath(Xpath).click()
|
|
|
|
try driver.FindElementByXPath(Xpath).click()
|
|
|
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
|
|
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
|
|
|
if(Status){
|
|
|
|
if(Status){
|
|
|
|
Message = Failed to input Title
|
|
|
|
Message = Failed to input Title
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
Return
|
|
|
|
Return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; sleep, 1000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Xpath = //textarea[@id='body']
|
|
|
|
|
|
|
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostBody)
|
|
|
|
|
|
|
|
if(Status){
|
|
|
|
|
|
|
|
Message = Failed to Input Post Body
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
|
|
|
|
Return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ImageAttachmentFilepath != ""){
|
|
|
|
if(ImageAttachmentFilepath != ""){
|
|
|
|
; Click the upload image button
|
|
|
|
; Click the upload image button
|
|
|
|
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
@ -2513,9 +2464,9 @@ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
|
|
|
SaveOrPostProgress(Message:="Waiting 10 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
SaveOrPostProgress(Message:="Waiting 10 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
sleep, 10000
|
|
|
|
sleep, 10000
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Message = Submitting Post
|
|
|
|
Message = Submitting Post
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|