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,259 +3219,6 @@ 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")
; 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---
;------------------------------------------------
;----------------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")
Return
Status := CheckCurrentTabForCurrentSite()
if(Status){
Return
}
Message = Inputting Post Content
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
; Input title
Xpath = //textarea[@placeholder='Add your title']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitle)
if(Status){
Message = Post Failed: Check Login Status
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")
SaveDriverURLOFErrorPage()
Return
}
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--- ;---Gettr---
@ -3477,8 +3226,8 @@ Return
PostToGettr: PostToGettr:
CurrentSite := "Gettr" CurrentSite := "Gettr"
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://gettr.com/") URLAttempt := NavigateFromBaseURLTo("https://gettr.com/")
if(URLAttempt = "Failed") if(URLAttempt = "Failed")
@ -3542,29 +3291,6 @@ try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly us
; DevModeMsgBox(JSPostTitleAndBody) ; DevModeMsgBox(JSPostTitleAndBody)
; JsToExecute = document.querySelector("#textarea-post").text = "%JSPostTitleAndBody%"; ; JsToExecute = document.querySelector("#textarea-post").text = "%JSPostTitleAndBody%";
; JsToExecute = document.getElementById('textarea-post')[0].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
}
*/
/*; Xpath = //*[@id="textarea-post"]
Msgbox % "PostTitleAndBody: " PostTitleAndBody
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitleAndBody)
if(Status){
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
*/
@ -3632,7 +3358,7 @@ 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")
@ -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