Removed Tumblr and pintrest code, added extra error logging to discord

main
Yuriy 2 years ago
parent c1429ab2f9
commit b21b92da87

@ -1572,7 +1572,7 @@ if(InStr(CurrentTabURL, "/login")){
; SaveOrPostProgress(Message:="Posting through API",PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:="Posting through API",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Posting Through API Message = Posting Through API
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
if(DiscordParlerWebhookURL = ""){ if(DiscordParlerWebhookURL = ""){
Message = Webhook Link not found. Please set "DiscordParlerWebhookURL" in %SettingsIniFilepath%. Message = Webhook Link not found. Please set "DiscordParlerWebhookURL" in %SettingsIniFilepath%.
@ -1707,7 +1707,7 @@ if(InStr(CurrentTabURL, "/login")){
Return Return
} }
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Status := NavigateFromBaseURLTo(SubscribeStarProfileURL) Status := NavigateFromBaseURLTo(SubscribeStarProfileURL)
@ -1892,7 +1892,7 @@ if(InStr(CurrentTabURL, "/login")){
; SaveOrPostProgress(Message:="Posting through API",PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:="Posting through API",PostType:="Tooltip,ErrorLoggingTextFile")
Message = Posting Through API Message = Posting Through API
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
if(TelegramBotToken = "" Or TelegramBotChatID =""){ if(TelegramBotToken = "" Or TelegramBotChatID =""){
@ -2001,6 +2001,9 @@ if(InStr(CurrentTabURL, "/login")){
Return Return
} }
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
URLAttempt := NavigateFromBaseURLTo("https://www.linkedin.com/login") URLAttempt := NavigateFromBaseURLTo("https://www.linkedin.com/login")
if(URLAttempt = "Failed") if(URLAttempt = "Failed")
@ -2218,7 +2221,7 @@ if(InStr(CurrentTabURL, "/login")){
CurrentSite := "Minds" CurrentSite := "Minds"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -2457,7 +2460,7 @@ if(InStr(CurrentTabURL, "/login")){
CurrentSite := "Locals" CurrentSite := "Locals"
; DevModeMsgBox("clik ok to continue") ; DevModeMsgBox("clik ok to continue")
; @todo: Add auto-login to locals ; @todo: Add auto-login to locals
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL
Message = LocalsURL from Ini File: %LocalsURL% Message = LocalsURL from Ini File: %LocalsURL%
@ -2659,7 +2662,7 @@ if(InStr(CurrentTabURL, "/login")){
CurrentSite := "Gab" CurrentSite := "Gab"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -2766,14 +2769,13 @@ if(InStr(CurrentTabURL, "/login")){
; -------------------------------/Gab------------------------------- ; -------------------------------/Gab-------------------------------
; -------------------------------PocketNet-------------------------------
; -------------------------------Bastyon------------------------------- ; -------------------------------Bastyon-------------------------------
PostToPocketNet: PostToPocketNet:
CurrentSite := "Bastyon" CurrentSite := "Bastyon"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://bastyon.com/index") URLAttempt := NavigateFromBaseURLTo("https://bastyon.com/index")
if(URLAttempt = "Failed") if(URLAttempt = "Failed")
@ -3033,7 +3035,7 @@ if(InStr(CurrentTabURL, "/login")){
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://steemit.com/submit.html") URLAttempt := NavigateFromBaseURLTo("https://steemit.com/submit.html")
@ -3217,173 +3219,17 @@ if(InStr(CurrentTabURL, "/login")){
Return Return
;-----------------------/Steemit------------------------- ;-----------------------/Steemit-------------------------
;---Tumblr---
;------------------------------------------------
PostToTumblr:
; Return
CurrentSite := "Tumblr"
; msgbox
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://www.tumblr.com/new/text")
if(URLAttempt = "Failed")
Return
Status := CheckCurrentTabForCurrentSite()
if(Status){
Return
}
sleep, 1000
SaveOrPostProgress(Message:="Checking Login Status",PostType:="Tooltip,ErrorLoggingTextFile")
try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, "/login")){
Message = Login Cookies Expired. Trying to Re-Login
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; sleep, 2000
Xpath = //span[normalize-space()='Log in']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
SaveOrPostProgress(Message:="Failed to Login. Please Login Manually",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
}
Message = Inputting Post Content
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
;---Gettr---
; Input title
Xpath = //textarea[@placeholder='Title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle)
if(Status){
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; Input Body of Post
Xpath = //p[@aria-label='Empty block; start writing or type forward slash to choose a block']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostBody)
if(Status){
Message = Failed to input Post Body
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
if(ImageAttachmentFilepath != ""){
Message = Attaching Thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@role='button']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
if(Status){
Message = Failed to attach Image
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
Message = Waiting 5 seconds for thumbnail to be generated
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 5000
}
message = Inputting Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Input Post Tags
TumblrTags := StrReplace(PostTags, " ", "")
TumblrTags := TumblrTags . ","
; Msgbox % "TumblrTags: " TumblrTags
Xpath = //textarea[@placeholder='#add tags']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=TumblrTags)
Message = Submitting Post
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; msgbox
; Click Submit Button
Xpath = //span[normalize-space()='Post now']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to submit Post
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
IniWrite, Successful, %StatusFileFilePath%, Status, Tumblr
AddToTotalPostsPostedCount()
PauseBetweenPosts()
; TakeScreenshotOfPage()
Return
;---\Tumblr---
;------------------------------------------------ ;------------------------------------------------
PostToGettr:
CurrentSite := "Gettr"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://gettr.com/")
;----------------Pintrest--------------------------------
PostToPintrest:
CurrentSite := "Pintrest"
PintrestPostBodyArray := StrSplit(PostBody, "https")
PintrestPostBody := PintrestPostBodyArray[1]
PintrestURL := PintrestPostBodyArray[2]
PintrestURL := StrSplit(PintrestURL, " ")
PintrestURL := PintrestURL[1]
if(PintrestURL != "")
PintrestURL := "https" . PintrestURL
; Msgbox % "PintrestURL: " PintrestURL
; Msgbox % "PintrestPostTitleAndBody: " PintrestPostTitleAndBody
; Msgbox % "PintrestURL: " PintrestURL
; pintrest has a 500 character limit
if(StrLen(PintrestPostBody) > 499){
Message = Post longer than Pintrest's 500 character limit. Posting Skipped.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
IniWrite, Skipped - Too Long, %StatusFileFilePath%, Status, Pintrest
Return
}
if(ImageAttachmentFilepath = ""){
Message = Post Skipped, No Image attached
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
IniWrite, Skipped - No Image, %StatusFileFilePath%, Status, Pintrest
Return
}
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://www.pinterest.com/pin-builder/")
if(URLAttempt = "Failed") if(URLAttempt = "Failed")
Return Return
@ -3392,126 +3238,29 @@ if(InStr(CurrentTabURL, "/login")){
Return Return
} }
Message = Checking Login Status
Message = Inputting Post Content
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
; Input title ; if string in tab url, then we are logged out
Xpath = //textarea[@placeholder='Add your title'] try CurrentTabURL := driver.Url
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle) if(InStr(CurrentTabURL, "/onboarding"))
if(Status){ {
Message = Post Failed: Check Login Status Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
Xpath = //div[@role='combobox']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PintrestPostBody)
if(Status){
Message = Failed to input Post Body
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
; click input area
; Xpath =//button[contains(text(),'Post')]
; Xpath = ///div[@id='textarea-post']
Xpath = //*[contains(text(),'What's new?')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; Input image
if(ImageAttachmentFilepath != ""){ if(ImageAttachmentFilepath != ""){
Message = Attaching Thumbnail
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Attach Thumbnail
Xpath = //input[@type='file']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
}
Xpath = //textarea[@placeholder='Add a destination link']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PintrestURL)
if(Status){
Message = Failed to Input Destination URL
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; msgbox
Message = Submitting Post
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
/*
OnMessage(0x44, "OnMsgBoxConfirmPost")
MsgBox 0x40040, Confirmation, Please Double Check Post Was Input and Submit It.`n`nThen click OK on this msgbox to move on to the next site.
OnMessage(0x44, "")
*/
; Click Submit Button
Xpath = //button[@data-test-id='board-dropdown-save-button']
try Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)driver.FindElementByXPath(Xpath).click()
if(Status){
Message = Failed to Submit Post
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
IniWrite, Successful, %StatusFileFilePath%, Status, Pintrest
AddToTotalPostsPostedCount()
PauseBetweenPosts()
; TakeScreenshotOfPage()
DevModeMsgBox("done!")
Return
; -------------------------------/Pintrest-------------------------------
;---Gettr---
;------------------------------------------------
PostToGettr:
CurrentSite := "Gettr"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://gettr.com/")
if(URLAttempt = "Failed")
Return
Status := CheckCurrentTabForCurrentSite()
if(Status){
Return
}
Message = Checking Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 1000
; if string in tab url, then we are logged out
try CurrentTabURL := driver.Url
if(InStr(CurrentTabURL, "/onboarding"))
{
Message = Login Expired. Please log back in
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
; click input area
; Xpath =//button[contains(text(),'Post')]
; Xpath = ///div[@id='textarea-post']
Xpath = //*[contains(text(),'What's new?')]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; Input image
if(ImageAttachmentFilepath != ""){
; Attach image ; Attach image
Xpath = //input[@type='file'] Xpath = //input[@type='file']
@ -3528,51 +3277,28 @@ if(ImageAttachmentFilepath != ""){
sleep, 3000 sleep, 3000
} }
; click input area
Xpath = //*[@id="textarea-post"]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; disable spellcheck on input field using javascript so text doesn't get garbled
js = document.getElementById('textarea-post').setAttribute("spellcheck", "false");
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
; DevModeMsgBox(JSPostTitleAndBody)
; JsToExecute = document.querySelector("#textarea-post").text = "%JSPostTitleAndBody%";
; JsToExecute = document.getElementById('textarea-post')[0].text = "%JSPostTitleAndBody%";
/*
; JsToExecute = document.getElementsByClassName('emojionearea-editor pastable')[0].innerText = '%JSPostTitleAndBody%'
Status := JS_TryToExecute(JsToExecute)
if(Status){
Message = Post Failed: Check Login Status
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
*/
; click input area
Xpath = //*[@id="textarea-post"]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
/*; Xpath = //*[@id="textarea-post"] ; disable spellcheck on input field using javascript so text doesn't get garbled
Msgbox % "PostTitleAndBody: " PostTitleAndBody js = document.getElementById('textarea-post').setAttribute("spellcheck", "false");
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitleAndBody) try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
if(Status){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
*/
; DevModeMsgBox(JSPostTitleAndBody)
; JsToExecute = document.querySelector("#textarea-post").text = "%JSPostTitleAndBody%";
; JsToExecute = document.getElementById('textarea-post')[0].text = "%JSPostTitleAndBody%";
StrLengthOfPost := StrLen(PostTitleAndBody) StrLengthOfPost := StrLen(PostTitleAndBody)
SaveOrPostProgress(Message:="Inputting post very slow way to avoid issues with gettr's buggy text post-processing",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Inputting post very slow way to avoid issues with gettr's buggy text post-processing",PostType:="Tooltip,ErrorLoggingTextFile")
Loop % StrLengthOfPost{ Loop % StrLengthOfPost{
; IndexPlusOne := A_index + 1 ; IndexPlusOne := A_index + 1
Current_Char := SubStr(PostTitleAndBody, A_index, 1) Current_Char := SubStr(PostTitleAndBody, A_index, 1)
@ -3590,82 +3316,82 @@ Loop % StrLengthOfPost{
} }
; sleep, 10 ; sleep, 10
; try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.Right) ; try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.Right)
} }
sleep, 500 sleep, 500
; SaveOrPostProgress(Message:="Waiting 2 seconds before submitting",PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:="Waiting 2 seconds before submitting",PostType:="Tooltip,ErrorLoggingTextFile")
; sleep, 2000 ; sleep, 2000
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
sleep, 2000 sleep, 2000
; Click post button ; Click post button
Xpath = //span[normalize-space()='Post'] Xpath = //span[normalize-space()='Post']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){ if(Status){
Message = Failed to Submit Post Message = Failed to Submit Post
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
IniWrite, Successful, %StatusFileFilePath%, Status, gettr IniWrite, Successful, %StatusFileFilePath%, Status, gettr
AddToTotalPostsPostedCount() AddToTotalPostsPostedCount()
PauseBetweenPosts() PauseBetweenPosts()
; TakeScreenshotOfPage() ; TakeScreenshotOfPage()
DevModeMsgBox("done!") DevModeMsgBox("done!")
Return Return
;---/Gettr--- ;---/Gettr---
; -------------------------------MeWe------------------------------- ; -------------------------------MeWe-------------------------------
PostToMeWe: PostToMeWe:
CurrentSite := "MeWe" CurrentSite := "MeWe"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://www.mewe.com/myworld") URLAttempt := NavigateFromBaseURLTo("https://www.mewe.com/myworld")
if(URLAttempt = "Failed") if(URLAttempt = "Failed")
Return Return
Status := CheckCurrentTabForCurrentSite() Status := CheckCurrentTabForCurrentSite()
if(Status){ if(Status){
Return Return
} }
; Click out of try MeWe Premium popup if it appears ; Click out of try MeWe Premium popup if it appears
SaveOrPostProgress(Message:="Checking for Popups and closing them",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Checking for Popups and closing them",PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //button[normalize-space()='Skip Trial'] Xpath = //button[normalize-space()='Skip Trial']
try driver.FindElementByXPath(Xpath).click() try driver.FindElementByXPath(Xpath).click()
sleep, 1000 sleep, 1000
; Click on Tell your contacts what's happening button ; Click on Tell your contacts what's happening button
SaveOrPostProgress(Message:="Clicking into Tell your Contacts.. Box",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Clicking into Tell your Contacts.. Box",PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //div[@class='postbox-placeholder_text'] Xpath = //div[@class='postbox-placeholder_text']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
if(Status){ if(Status){
SaveOrPostProgress(Message:="Post Failed: Check Login Status",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:="Post Failed: Check Login Status",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
} }
; DevModeMsgBox("popup activated?") ; DevModeMsgBox("popup activated?")
; click into popup box to make sure it's activated ; click into popup box to make sure it's activated
/*xpath = //div[@class='ql-editor ql-blank']//div /*xpath = //div[@class='ql-editor ql-blank']//div
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000) Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
DevModeMsgBox(Status) DevModeMsgBox(Status)
@ -3768,7 +3494,7 @@ CurrentSite := "Twetch"
; } ; }
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
URLAttempt := NavigateFromBaseURLTo("https://twetch.com/") URLAttempt := NavigateFromBaseURLTo("https://twetch.com/")
@ -3913,7 +3639,7 @@ PostToFlote:
CurrentSite := "Flote" CurrentSite := "Flote"
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile") ; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
@ -4050,7 +3776,7 @@ CurrentSite := "Thinkspot"
if(PostTags = ""){ if(PostTags = ""){
Message = Skipped: No Post Tags Message = Skipped: No Post Tags
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
IniWrite, Skipped: No Post Tags, %StatusFileFilePath%, Status, Thinkspot IniWrite, Skipped: No Post Tags, %StatusFileFilePath%, Status, Thinkspot
Return Return
} }

Loading…
Cancel
Save