added workaround to paste formatting bug, added confirmation setting and implemented check on all selenium sites
This commit is contained in:
@@ -30,34 +30,6 @@ ReadWebsiteStatuses(){
|
||||
; IniRead, Tumblr, %StatusFileFilePath%, Status, Tumblr, %A_Space%
|
||||
}
|
||||
|
||||
; -------------------------------CreateErrorLoggingFiles-------------------------------
|
||||
CreateErrorLoggingFiles(Path := ""){
|
||||
FormatTime, TodayDate, YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
||||
|
||||
ErrorLoggingDirectory := Path
|
||||
|
||||
if(Path = ""){
|
||||
ErrorLoggingDirectory := A_ScriptDir . "\Lib\ErrorLogging"
|
||||
; If directory for error logging doesn't exist, create it
|
||||
if(!FileExist(ErrorLoggingDirectory))
|
||||
FileCreateDir, %ErrorLoggingDirectory%
|
||||
|
||||
ErrorLoggingDirectory := ErrorLoggingDirectory . "\" . TodayDate . "_FSMP"
|
||||
}
|
||||
; Msgbox % "ErrorLoggingDirectory: " ErrorLoggingDirectory
|
||||
FileCreateDir, %ErrorLoggingDirectory%
|
||||
|
||||
; Create variables with filepaths that content will be saved to.
|
||||
ErrorLoggingFilePath := ErrorLoggingDirectory . "\" . "ErrorLogging.txt"
|
||||
StatusFileFilePath := ErrorLoggingDirectory . "\" . "PostStatus.ini"
|
||||
PostTitleFilePath := ErrorLoggingDirectory . "\" . "PostTitle.txt"
|
||||
PostBodyFilePath := ErrorLoggingDirectory . "\" . "PostBody.txt"
|
||||
|
||||
; Msgbox % "ErrorLoggingDirectory: " ErrorLoggingDirectory
|
||||
Return
|
||||
}
|
||||
; -------------------------------/CreateErrorLoggingFiles-------------------------------
|
||||
|
||||
AddToTotalPostsPostedCount(){
|
||||
IniRead, TotalPostsPosted, %SettingsIniFilepath%, SocialMediaPoster, TotalPostsPosted, 0
|
||||
TotalPostsPosted += 1
|
||||
|
||||
@@ -100,77 +100,70 @@ if(Status = ""){
|
||||
|
||||
|
||||
sleep, 2000
|
||||
/*
|
||||
*/
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
; Message = Attaching Image
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
; Message = Attaching Image
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
; Click the "Image" button
|
||||
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; Click the "Image" button
|
||||
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
/* Xpath = //div[@title='Add Images to Post']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Click "Attach Image" Button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
; sleep, 5000
|
||||
|
||||
Xpath = //input[@type='file']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=3,SleepLength:=5000,StringTextContent:=ImageAttachmentFilepath)
|
||||
if(Status){
|
||||
Message = Failed to Attach Image
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 10 Seconds For Image to Upload",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
sleep, 10000
|
||||
|
||||
|
||||
}
|
||||
|
||||
; Input Tags
|
||||
Xpath = //div[@class='search fastSearchShow']//input[@id='text']
|
||||
TagsArray := StrSplit(PostTags, ",")
|
||||
TagsArrayLength := TagsArray.Length() ; Save total number of items in the array
|
||||
loop, %TagsArrayLength% {
|
||||
Tag := TagsArray[A_Index]
|
||||
Tag := StrReplace(Tag, " ", "")
|
||||
DevModeMsgBox(Tag)
|
||||
; Tag = %Tag%
|
||||
Xpath = //input[@placeholder='Categories and tags']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(Tag)
|
||||
catch e {
|
||||
Message = Failed to input tag: %tag%
|
||||
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
|
||||
|
||||
if(A_index = 5)
|
||||
Break
|
||||
}
|
||||
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; CLick the post button
|
||||
Xpath = //button[normalize-space()='Post']
|
||||
loop, 3 {
|
||||
try driver.FindElementByXPath(Xpath).click()
|
||||
sleep, 1500
|
||||
Xpath = //input[@type='file']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=3,SleepLength:=5000,StringTextContent:=ImageAttachmentFilepath)
|
||||
if(Status){
|
||||
Message = Failed to Attach Image
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
||||
; sleep, 2000
|
||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 10 Seconds For Image to Upload",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
sleep, 10000
|
||||
|
||||
}
|
||||
|
||||
; Input Tags
|
||||
Xpath = //div[@class='search fastSearchShow']//input[@id='text']
|
||||
TagsArray := StrSplit(PostTags, ",")
|
||||
TagsArrayLength := TagsArray.Length() ; Save total number of items in the array
|
||||
loop, %TagsArrayLength% {
|
||||
Tag := TagsArray[A_Index]
|
||||
Tag := StrReplace(Tag, " ", "")
|
||||
DevModeMsgBox(Tag)
|
||||
; Tag = %Tag%
|
||||
Xpath = //input[@placeholder='Categories and tags']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(Tag)
|
||||
catch e {
|
||||
Message = Failed to input tag: %tag%
|
||||
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
|
||||
|
||||
if(A_index = 5)
|
||||
Break
|
||||
}
|
||||
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
; CLick the post button
|
||||
Xpath = //button[normalize-space()='Post']
|
||||
loop, 3 {
|
||||
try driver.FindElementByXPath(Xpath).click()
|
||||
sleep, 1500
|
||||
}
|
||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
||||
; sleep, 2000
|
||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
||||
/* if(Status){
|
||||
Message = Failed to Submit Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
|
||||
@@ -88,6 +88,13 @@ if(Status){
|
||||
; Click the final "post" button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Xpath = //*[@id="gabsocial"]/div/div[2]/div[2]/main/div/div[3]/div/div
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
||||
if(Status){
|
||||
|
||||
@@ -106,6 +106,13 @@ sleep, 500
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 2000
|
||||
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
; Click post button
|
||||
Xpath = //span[normalize-space()='Post']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
||||
|
||||
@@ -168,7 +168,7 @@ if(ImageAttachmentFilepath != ""){
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 5 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 5000
|
||||
*/
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -200,42 +200,38 @@ loop, 3 {
|
||||
; Continue
|
||||
}
|
||||
|
||||
/* if(!Status){ ; if BLANK
|
||||
Message = Post Failed: Failed to input Post for some reason
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
*/
|
||||
; sleep, 2000
|
||||
|
||||
if(InStr(PostTitleAndBody, "http") OR InStr(PostTitleAndBody, "www")){
|
||||
Message = Waiting 10 seconds for Preview to Get Fetched
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 10000
|
||||
}
|
||||
else, {
|
||||
sleep, 2000
|
||||
}
|
||||
if(InStr(PostTitleAndBody, "http") OR InStr(PostTitleAndBody, "www")){
|
||||
Message = Waiting 10 seconds for Preview to Get Fetched
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 10000
|
||||
}
|
||||
else, {
|
||||
sleep, 2000
|
||||
}
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Xpath = //span[normalize-space()='Post'] ; Click the final "post" button
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Jscheck = return document.querySelector("div[aria-label='Text editor for creating content']").textContent ; Grabb innertext
|
||||
try TextContent := driver.executeScript(Jscheck)
|
||||
Xpath = //span[normalize-space()='Post'] ; Click the final "post" button
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Jscheck = return document.querySelector("div[aria-label='Text editor for creating content']").textContent ; Grabb innertext
|
||||
try TextContent := driver.executeScript(Jscheck)
|
||||
|
||||
Message = Failed to Submit Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Message = Failed to Submit Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
|
||||
Message = Failed to Submit Post: Text Content that got input: %TextContent%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
Message = Failed to Submit Post: Text Content that got input: %TextContent%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
/* ; Keep trying to click the home button until able to and then move on to next site because sometimes it takes a while for a post to upload
|
||||
Xpath = //span[normalize-space()='Home']
|
||||
|
||||
@@ -91,6 +91,11 @@ if(ImageAttachmentFilepath != ""){
|
||||
}
|
||||
Message = Submitting Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
; Click Publish post
|
||||
js = document.getElementsByName('submitPost')[0].click(); ; Send content through javascript (Great for getting around emoji chrome limitaitons)
|
||||
@@ -111,31 +116,20 @@ Return
|
||||
|
||||
}
|
||||
|
||||
/* ; Double check that post got submitted
|
||||
js = return document.querySelector("#body").value
|
||||
Status := driver.executeScript(js)
|
||||
if(Status != ""){
|
||||
Message = Error: Post Failed to Submit for some reason
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, Locals
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
PauseBetweenPosts()
|
||||
DevModeMsgBox("done!")
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, Locals
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
|
||||
Return
|
||||
; -------------------------------/Locals-------------------------------
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
PauseBetweenPosts()
|
||||
DevModeMsgBox("done!")
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
|
||||
Return
|
||||
; -------------------------------/Locals-------------------------------
|
||||
|
||||
@@ -35,15 +35,6 @@ if(Status){
|
||||
Return
|
||||
}
|
||||
|
||||
; DevModeMsgBox("popup activated?")
|
||||
|
||||
|
||||
; click into popup box to make sure it's activated
|
||||
/*xpath = //div[@class='ql-editor ql-blank']//div
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
DevModeMsgBox(Status)
|
||||
*/
|
||||
; DevModeMsgBox("inputting post now after clickng")
|
||||
|
||||
; input post title and body with javascript
|
||||
JsToExecute = document.querySelector(".ql-editor").innerText = '%JSPostTitleAndBody%';
|
||||
@@ -103,6 +94,11 @@ if(ImageAttachmentFilepath != ""){
|
||||
sleep, 10000
|
||||
}
|
||||
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
; Click the "Post" button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
@@ -119,11 +115,6 @@ IniWrite, Successful, %StatusFileFilePath%, Status, MeWe
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
|
||||
PauseBetweenPosts()
|
||||
DevModeMsgBox("done!")
|
||||
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
@@ -173,6 +173,11 @@ else, { ; otherwise, input just text
|
||||
|
||||
; sleep, 2000
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
loop, 3 {
|
||||
|
||||
@@ -65,59 +65,47 @@ else, {
|
||||
try, driver.switchToalert().accept() ; if text exists Steemit will pop up menu asking for confirmation for clearing
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
Message = Inputting Post Content
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
; Input title
|
||||
Xpath = //input[@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
|
||||
}
|
||||
|
||||
|
||||
Xpath = //textarea[@placeholder='Write your story...']
|
||||
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(Status){
|
||||
Message = Post Failed, Please check login status
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
; Click "Accept" popup that asks if you're sure you want to clear post
|
||||
try, driver.switchToalert().accept()
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
Message = Attaching Thumbnail
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
Message = Inputting Post Content
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
; Input title
|
||||
Xpath = //input[@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
|
||||
}
|
||||
|
||||
|
||||
Xpath = //textarea[@placeholder='Write your story...']
|
||||
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[@type='file']
|
||||
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
|
||||
}
|
||||
Xpath = //input[@type='file']
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
Xpath = //a[normalize-space()='selecting them']
|
||||
@@ -161,33 +149,35 @@ else, {
|
||||
if(A_index = 8) ; Steemit only allows 8 tags
|
||||
Break
|
||||
}
|
||||
/*
|
||||
*/
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Message = Submitting Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Message = Submitting Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
; Click Submit Button
|
||||
Xpath = //button[@type='submit']
|
||||
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
|
||||
}
|
||||
; Click Submit Button
|
||||
Xpath = //button[@type='submit']
|
||||
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, Steemit
|
||||
AddToTotalPostsPostedCount()
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, Steemit
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
|
||||
PauseBetweenPosts()
|
||||
DevModeMsgBox("done!")
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
Return
|
||||
;-----------------------/Steemit-------------------------
|
||||
Return
|
||||
;-----------------------/Steemit-------------------------
|
||||
|
||||
@@ -178,77 +178,68 @@ if(ImageAttachmentFilepath != ""){
|
||||
Xpath = //input[@multiple='multiple']
|
||||
driver.FindElementByXPath(Xpath).SendKeys(ImageAttachmentFilepath)
|
||||
|
||||
|
||||
/* Xpath = //span[@class='trix-button-group trix-upload-buttons']//button[2]
|
||||
Status := Selenium_LoopToClickXpathAndWaitForOpenWindow(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to click on Picture Upload button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
InputStatus := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
|
||||
if(InputStatus = "Failed")
|
||||
{
|
||||
Message = Upload Failed:`nUnable to Find "Open File" window to input filepath into
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
*/
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 5 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 5000
|
||||
}
|
||||
SaveOrPostProgress(Message:="Waiting 5 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 5000
|
||||
}
|
||||
|
||||
|
||||
; Click the post Button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
; Click the post Button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
; post button at bottom right corner
|
||||
Selector = ".flat_button.for-post_form"
|
||||
; post button at bottom right corner
|
||||
Selector = ".flat_button.for-post_form"
|
||||
|
||||
; check if post button exists
|
||||
js = return document.querySelector(%Selector%).innerText
|
||||
try, Status := driver.executeScript(js)
|
||||
if(!Status){
|
||||
Message = Post Failed. Unable to find Post button using usual method.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
else, {
|
||||
Message = Post Button Exists and has the text: %Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
; check if post button exists
|
||||
js = return document.querySelector(%Selector%).innerText
|
||||
try, Status := driver.executeScript(js)
|
||||
if(!Status){
|
||||
Message = Post Failed. Unable to find Post button using usual method.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
else, {
|
||||
Message = Post Button Exists and has the text: %Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
; click submit button
|
||||
js = document.querySelector(%Selector%).click()
|
||||
try, Status := driver.executeScript(js)
|
||||
; Msgbox % "Status: " Status
|
||||
|
||||
sleep, 2000
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
; check if post button still exists
|
||||
js = return document.querySelector(%Selector%).innerText
|
||||
try, Status := driver.executeScript(js)
|
||||
if(Status){
|
||||
Message = Post Failed. Failed to click Post button using usual method.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
; click submit button
|
||||
js = document.querySelector(%Selector%).click()
|
||||
try, Status := driver.executeScript(js)
|
||||
; Msgbox % "Status: " Status
|
||||
|
||||
sleep, 2000
|
||||
|
||||
; check if post button still exists
|
||||
js = return document.querySelector(%Selector%).innerText
|
||||
try, Status := driver.executeScript(js)
|
||||
if(Status){
|
||||
Message = Post Failed. Failed to click Post button using usual method.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
; double double check that post got posted by checking if able to grab text that was just input
|
||||
js = return document.querySelector("trix-editor[role='textbox']").innerText
|
||||
try, Status := driver.executeScript(js)
|
||||
if(Status){
|
||||
Message = Post Failed. Input box still exists on page but no errors were thrown when clicking post button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
; double double check that post got posted by checking if able to grab text that was just input
|
||||
js = return document.querySelector("trix-editor[role='textbox']").innerText
|
||||
try, Status := driver.executeScript(js)
|
||||
if(Status){
|
||||
Message = Post Failed. Input box still exists on page but no errors were thrown when clicking post button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Xpath = //button[contains(text(),'Post')]
|
||||
|
||||
@@ -108,7 +108,22 @@ if(ImageAttachmentFilepath != ""){
|
||||
sleep, 5000
|
||||
}
|
||||
|
||||
/*; Get User confirmation if they have the setting checked
|
||||
if(ConfirmBeforeSubmit){
|
||||
Status := ConfirmBeforeSubmitMsgboxFunc()
|
||||
if(Status){
|
||||
Message := Status
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
if (ConfirmBeforeSubmit && ConfirmBeforeSubmitMsgboxFunc() != true) {
|
||||
Message = User Selected STOP button when asked for confirmation. Cancelling Rest of Site Upload.
|
||||
SaveOrPostProgress(Message:=Message, PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
return
|
||||
}
|
||||
|
||||
; Click on "Post" button
|
||||
sleep, 2000
|
||||
|
||||
Reference in New Issue
Block a user