updated shared functions submodule and added Locals URL check and version bump
This commit is contained in:
@@ -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,57 +2424,7 @@ 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']
|
|
||||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
|
||||||
; {
|
|
||||||
; 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
|
Message = Inputting Post Content
|
||||||
@@ -2480,17 +2441,7 @@ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
|||||||
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 != ""){
|
||||||
|
|||||||
Reference in New Issue
Block a user