Compare commits

..

4 Commits
2.94 ... main

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 355 KiB

@ -0,0 +1,155 @@
;---ENVIRONMENT---------------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
;DetectHiddenWindows, On
#SingleInstance, Force
DetectHiddenWindows, ON
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;SetKeyDelay, 500
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
; #NoTrayIcon
; Menu, Tray, Icon, RMScriptManager.ico
;---Notes/Extra Info/#Includes------------------------------------------------------
#Include, %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\WindowCredentialManager.ahk
;---VARIABLES-----------------------------------------------------------------------
ProgramName = Freedomain Social Media Poster
ExeProgramName = %ProgramName%.exe
AHKFilepath = %A_ScriptDir%\%ProgramName%.ahk
Exefilepath = %A_ScriptDir%\%ProgramName%.exe
icopath = %A_ScriptDir%\Assets\Icon.ico
VersionIniFP = %A_ScriptDir%\Version.ini
; Generate a new errorlog text file each run
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
ErrorLogTextFile = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
cred := CredRead("FDR-Gitea-Token")
GiteaToken := Cred.Password
; Info for Creating the Release with Gitea-CreateRelease.ps1
CreateReleasePS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-CreateRelease.ps1
CreateReleaseAPIURL = https://freedomain.dev/api/v1/repos/yuriy/social-media-poster/releases?token=%GiteaToken%
; Info for Attaching exe file to release using Gitea-AttachAssetToRelease.ps1
AttachAssetToReleasePS1Filepath = %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-AttachAssetToRelease.ps1
AttachAssetToReleaseAPIURL = https://freedomain.dev/api/v1/repos/yuriy/social-media-poster/releases
;---\VARIABLES-----------------------------------------------------------------------
; Compile to .exe
; ------------------------------------------------
; Bump the version number in the version.ini file
IniRead, VersionNumber, %VersionIniFP%, Social-Media-Poster, Version, 0.0 ; , Filename, Section, Key [, Default]
VersionNumber += .01
VersionNumber := SubStr(VersionNumber, 1, 4)
IniWrite, %VersionNumber%, %VersionIniFP%,Social-Media-Poster, Version
; Kill any active intances of the uploaders so the .exe file can be overwriten by the compilation
process, close, %ExeProgramName%
sleep, 500
; Delete the .exe file so it can be repalced
if(FileExist(Exefilepath)){
FileDelete, %Exefilepath%
if(ErrorLevel){
msgbox, failed to delete Exe file. Please delete manually and re-run the compiler.
ExitApp
}
}
; check if file exists and if not, give user error and stop
if(!FileExist(AHKFilepath)){
msgbox, %AHKFilepath% does not exist`nExiting
ExitApp
}
; check if file exists and if not, give user error and stop
if(!FileExist(icopath)){
msgbox, %icopath% does not exist`nExiting
ExitApp
}
; run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
Command = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%"
Results := RunCMD(Command)
LogToErrorLogFile(Results, ErrorLogTextFile)
if(!InStr(Results, "Successfully")){
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
ExitApp
}
; Create new Release on Gitea using Gitea-CreateRelease.ps1
; ------------------------------------------------
InputBox, ReleaseBody, Release Body, Please Input Text to be used in the Release Body
ReleaseName := VersionNumber
ReleaseTag := VersionNumber
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
Message = PowerShell Command to Create Release:`n%Command%
LogToErrorLogFile(Message, ErrorLogTextFile)
Results := RunCMD(Command)
LogToErrorLogFile(Results, ErrorLogTextFile)
; Pull out the release ID Number, needed for attaching a file to the release
SplitText = @{id=
SplitText2 = `;
ReleaseID := StrSplit(Results, SplitText)[2]
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
Message = ReleaseID: %ReleaseID%
LogToErrorLogFile(Message, ErrorLogTextFile)
; Attach .exe File to Release using Gitea-AttachAssetToRelease.ps1
; ------------------------------------------------
AttachAssetToReleaseAPIURL = %AttachAssetToReleaseAPIURL%/%ReleaseID%/assets
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
Command = Powershell "%AttachAssetToReleasePS1Filepath%" "%AttachAssetToReleaseAPIURL%" "%GiteaToken%" "'%ExeProgramName%'" "'%Exefilepath%'"
LogToErrorLogFile(Command, ErrorLogTextFile)
Results := RunCMD(Command)
LogToErrorLogFile(Results, ErrorLogTextFile)
ExitApp
;---FUNCTIONS-----------------------------------------------------------------------
LogToErrorLogFile(Text, TextFileFilepath){
FileAppend, %Text%`n, %TextFileFilepath%
}

@ -7,7 +7,7 @@ CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
FileEncoding, UTF-8-RAW ; Needed for special symbols that are used in video descritions
if(InStr(A_ScriptName, ".ahk")){
Menu, Tray, Icon, %A_ScriptDir%\assets\FreedomainSMP.ico
Menu, Tray, Icon, %A_ScriptDir%\assets\Icon.ico
}
ErrorLoggingDirectory = %1%
@ -46,16 +46,14 @@ global UpdateVersionNumber
;---ToDo---
;------------------------------------------------
; @todo: fix post scheduling - countdown not working
; @todo: Errorlog not getting appended to on > 1 run (ErrorLoggingFilePath) variable is missing somehwere
; @todo: Add tags support on all sites that support it - ask stef is useful
; @todo: All post submits: mark with "Post Submit Successful" OR "Post Submit Failed" for easier reading of errorlogs
; Misc info
;------------------------------------------------
; Parler has a 1k char limit
; All post submits: mark with "Post Submit Successful" OR "Post Submit Failed" for easier reading of errorlogs
;---Global Variables---
@ -97,14 +95,11 @@ global Locals
global LinkedIn
global MeWe
global Twetch
; global ThinkSpot
; global Flote
global PocketNet
; global parler
global Gettr
global steemit
; global Pintrest
; global Tumblr
global Tumblr
; Check if Lib folder exists and create it if not
LibFolder := A_ScriptDir . "\Lib"
@ -491,8 +486,14 @@ Gui, Font, s%GUINormalFontSize%
Gui, Font, Bold
Gui, Add, GroupBox,r6.4 x%PlatformsGroupBoxXLocation% y210 w300, Platforms
Gui, Font, s8
Gui, Font, Bold
Gui, Add, Button, xp+110 yp+0 gUncheckAllPlatforms, Uncheck All
Gui, Font, s%GUINormalFontSize%
Gui, Font, Normal
Gui, Add, Checkbox, xp+10 yp+30 vDiscord Checked%DiscordCheckStatus% gUpdateVars, Discord
Gui, Add, Checkbox, x%PlatformsGroupBoxXLocation% yp+30 vDiscord Checked%DiscordCheckStatus% gUpdateVars, Discord
Gui, Add, Checkbox, y+7 vTelegram Checked%TelegramCheckStatus% gUpdateVars, Telegram
Gui, Add, Checkbox, y+7 vSubscribeStar Checked%SubScribeStarCheckStatus%gUpdateVars, SubscribeStar
Gui, Add, Checkbox, y+7 vMinds Checked%MindsCheckStatus% gUpdateVars, Minds
@ -506,6 +507,7 @@ Gui, Add, Checkbox, y+7 vSteemit Checked%SteemitCheckStatus% gUpdateVars, Steemi
Gui, Add, Checkbox, y+7 vPocketNet Checked%PocketNetCheckStatus% , Bastyon
Gui, Add, Checkbox, y+7 vGettr Checked%GettrCheckStatus% gUpdateVars, Gettr
Gui, Add, Checkbox, y+7 vMeWe Checked%MeWeCheckStatus% gUpdateVars, MeWe
Gui, Add, Checkbox, y+7 vTumblr Checked%Tumblr% gUpdateVars, Tumblr
Gui, Font, Bold
@ -609,10 +611,6 @@ UpdateScript:
UpdateScript()
Return
/*
*/
CancelPost:
GuiClose:
; ExitApp
@ -636,25 +634,27 @@ run, "%A_ScriptFullPath%" "LastPost"
Return
CompileScript:
; msgbox, compiling
IniWrite, %changelog%, %ChangelogIniFilepath%, %ScriptSettingsSection%, Changelog
IniWrite, %ScriptVersion%, %ChangelogIniFilepath%, %ScriptSettingsSection%, ScriptVersion
IniWrite, %UpdateURL%, %ChangelogIniFilepath%, %ScriptSettingsSection%, UpdateURL
run, "%A_scriptdir%\Lib\Releases\Compile Scripts to EXE.ahk" SocialMediaPoster Production
; ExitApp
Return
UploadFiles:
msgbox, this button needs to be re-programmed. Search for "UploadFiles:" in main program
Return
SelectFilepath:
FileSelectFile, SelectedImageFilepath
GuiControl,, ImageAttachmentFilepath, %SelectedImageFilepath%
Return
UncheckAllPlatforms:
GuiControl,,Discord, 0
GuiControl,,Telegram, 0
GuiControl,,SubScribeStar, 0
GuiControl,,Minds, 0
GuiControl,,Gab, 0
GuiControl,,Locals, 0
GuiControl,,Twetch, 0
GuiControl,,LinkedIn, 0
GuiControl,,Steemit, 0
GuiControl,,Bastyon, 0
GuiControl,,Gettr, 0
GuiControl,,MeWe, 0
GuiControl,,Tumblr, 0
Return
UpdateVars:
Gui, Submit, NoHide
Return
@ -798,7 +798,6 @@ IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowT
(PocketNet = 1)?(PostedWebsites .= "PocketNet|") : ()
(Gettr = 1)?(PostedWebsites .= "Gettr|") : ()
(Steemit = 1)?(PostedWebsites .= "Steemit|") : ()
(Pintrest = 1)?(PostedWebsites .= "Pintrest|") : ()
(Tumblr = 1)?(PostedWebsites .= "Tumblr|") : ()
Message = Starting SMP with: **V%ScriptVersion%** `nTo sites: %PostedWebsites% `nWith Title: **%PostTitle%** `nWith Body:%PostBody% `nWith Tags: %PostTags%
@ -862,8 +861,8 @@ Gosub, PostToMeWe
if(Twetch)
Gosub, PostToTwetch
; if(Thinkspot)
; Gosub, PostToThinkSpot
if(Tumblr)
Gosub, PostToTumblr
if(Locals)
Gosub, PostToLocals
@ -977,10 +976,10 @@ Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Steemit%
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Pintrest%
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Bastyon%
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Tumblr
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Tumblr
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
; Gui, Font, s9
@ -999,10 +998,6 @@ Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSize% w270 h40 gOpenGite
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSize% w270 h80 gTryFailedAgain, Try Failed Again
/*Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, PocketNet
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
*/
Gui, Font, s%GUINormalFontSize%
Gui, Font, Bold
; gui, add, text, x%ErrorSummaryLogSplitLineXPos% y20 h200 0x11 ; 0x11 is a "line" ; refer to here: https://autohotkey.com/board/topic/50910-draw-line-gui/
@ -1027,53 +1022,6 @@ AddToTotalRunTime()
Return
ActivateParlerTab:
DevModeMsgBox("activating")
DevModeMsgBox(ParlerTabURL)
; FindAndActivateTab(ParlerTabURL)
Return
SendErrorLoggingThroughTelegram:
Message = Uploading Errorlog to FDRBotTesting Telegram Server.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; ErrorLoggingFilePath := VideoFolderDir . "\" . "ErrorLogging.txt"
; Msgbox % "ErrorLoggingFilePath: " ErrorLoggingFilePath
; Credentials to FDRBotTesting Channel
ELTelegramBotToken=1422687468:AAEzdzkck5PhgOG687cEn1cChp5cJFodjVM
ELTelegramBotChatID=-1001460795978
; DevModeMsgBox(ErrorLoggingFilePath)
Status := SendTelegramFile(ELTelegramBotToken, ELTelegramBotChatID, ErrorLoggingFilePath, caption := "" )
if(InStr(Status, "error_code")){
Message = Telegram Post Failed due to an API Issue. Error was saved to ErrorLogging file. Please send it to Yuriy.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Status,PostType:=",ErrorLoggingTextFile")
Message = Telegram Error: %Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; msgbox, 4096, Error!, %Message%
ToolTip
Return
}
ToolTip
Message = Errorlog was successfully uploaded to the FDRBotTesting Telegram Server.`nThank You!
msgbox, 4096, Success!, %Message%
; Clipboard := ErrorLoggingFilePath
; Message = %ErrorLoggingFilePath% `n`nwas copied to the clipboard for easy attachment
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
; msgbox, 4096, Filepath Copied to Clipboard, %ErrorLoggingFilePath%`n`nwas copied to the clipboard for easy attachment.
Return
CopyErrorLoggingFilepath:
; Msgbox % "ErrorLoggingFilePath: " ErrorLoggingFilePath
@ -1123,6 +1071,11 @@ Return
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-LinkedIn.ahk
; Tumblr
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Tumblr.ahk
; Minds
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Minds.ahk

@ -1 +1 @@
Subproject commit 6bf72336d0af0aa57064fc40c267677bb27577f3
Subproject commit 4a1d2a5d9d95d06567e84f4128f02b1a233d53df

@ -27,7 +27,7 @@ ReadWebsiteStatuses(){
; IniRead, Flote, %StatusFileFilePath%, Status, Flote, %A_Space%
IniRead, PocketNet, %StatusFileFilePath%, Status, PocketNet, %A_Space%
; IniRead, Pintrest, %StatusFileFilePath%, Status, Pintrest, %A_Space%
; IniRead, Tumblr, %StatusFileFilePath%, Status, Tumblr, %A_Space%
IniRead, Tumblr, %StatusFileFilePath%, Status, Tumblr, %A_Space%
}
AddToTotalPostsPostedCount(){

@ -83,9 +83,12 @@ if(ImageAttachmentFilepath != ""){
if(!InStr(Status, "id")){
parsed := JSON.Load(Status)
Error := parsed.content[1]
; Msgbox % "error: " error
Message = Discord Post Failed due to API Issue. Error was saved to errorlog; please forward to Yuriy
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Message = Discord Post Failed due to API Issue. Please See ErrorLog for details
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Message = Discord API Returned Data:`n %Error%
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile")
Return
}
}

@ -146,13 +146,36 @@ sleep, 500
driver.FindElementByXPath(Xpath).SendKeys("`n`n")
sleep, 500
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(InStr(PostBody, "http")){
StrLengthOfPost := StrLen(PostBody)
SaveOrPostProgress(Message:="Body has hyperlink, Inputting text key by key",PostType:="Tooltip,ErrorLoggingTextFile")
Loop % StrLengthOfPost{
Current_Char := SubStr(PostBody, A_index, 1)
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=20,StringTextContent:=Current_Char)
if(Status){
Message = Failed to Input Text
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage()
Return
}
}
}
else, {
SaveOrPostProgress(Message:="Body has no hyperlink, inputting entire text body into element.",PostType:="Tooltip,ErrorLoggingTextFile")
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
}
}
; check if value was input
js = return document.querySelector("trix-editor[role='textbox']").innerText

@ -88,9 +88,12 @@ TelegramBody := ASCIISTRReplace(PostBody)
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Message )
}
if(Status){
Message = Upload Failed due to API issue. Telegram API Returned Value:`n %Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
if(instr(Status, "error_code")){
Message = Upload Failed Due To API Issue. Please See Error Log For Details
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message = Telegram API Returned Data:`n %Status%
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
Return
}

@ -0,0 +1,165 @@
; -------------------------------Minds-------------------------------
PostToTumblr:
CurrentSite := "Tumblr"
Message = Navigating to Post Creationg Page
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
URLAttempt := NavigateFromBaseURLTo("https://www.tumblr.com/")
if(URLAttempt = "Failed")
Return
Status := CheckCurrentTabForCurrentSite()
if(Status){
Return
}
; Check Login Status
; ------------------------------------------------
Message = Checking Login Status
SaveOrPostProgress(Message,PostType:="Tooltip")
Xpath = (//button[normalize-space()='Photo'])[1]
try ElementInnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
if(ElementInnerText != "Photo"){
Message = Site is Logged out. Please log back in.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; Start Text Post
; ------------------------------------------------
Message = Creating New Post
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = (//button[normalize-space()='Text'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(status){
Message = Failed to Start Post. Check Login Status
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = (//span[@data-rich-text-placeholder='Title'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle, ClearElement:=0)
if(status){
Message = Failed to Input Post Title
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
Xpath = (//span[@data-rich-text-placeholder='Go ahead, put anything.'])[1]
; newline is needed so the "attach image" to post option appears in the next line down
PostBodyWithNewLine = %PostBody%`n
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:=PostBodyWithNewLine, ClearElement:=0)
if(status){
Message = Failed To Input Post Body
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
if(ImageAttachmentFilepath){
; Click into space below the preview image so the "add photo" button shows up
Xpath = (//div[@class='block-list-appender wp-block'])[1]
try, driver.FindElementByXPath(Xpath).click()
; Xpath = (//button[@title='Add photo'])[1]
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
; Click the Photo Icon on the next line down to attach an image
Xpath = (//button[@title='Add photo'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(status){
Message = Failed to Click Attach Image Button
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
; send image filepath to element to attach picture
Xpath = (//input[@role='button'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath, ClearElement:=0)
if(status){
Message = Failed to Attach Image to Post
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
}
; Input Tags
Xpath = (//textarea[@placeholder='#add tags to help people find your post'])[1]
try, driver.FindElementByXPath(Xpath).SendKeys(PostTags)
try, driver.SendKeys(driver.Keys.Enter)
sleep, 1000
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 now'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(status){
Message = Failed to Click Post Now Button
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return
}
/*; start photo post button
Xpath = (//button[normalize-space()='Photo'])[1]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(status){
Message = Failed to Start Post
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
if(ImageAttachmentFilepath){
; Attach Image
Xpath = (//input[@role='button'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath, ClearElement:=0)
if(status){
Message = Failed to Attach Image
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
}
; input Text Post
Xpath = (//span[@data-rich-text-placeholder='Go ahead, put anything.'])[1]
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=)
*/
IniWrite, Successful, %StatusFileFilePath%, Status, %CurrentSite%
AddToTotalPostsPostedCount()
PauseBetweenPosts()
DevModeMsgBox("done!")
Message = Post Publish Successful
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Return
; -------------------------------/Minds-------------------------------

@ -1,2 +1,2 @@
[Social-Media-Poster]
Version=2.92
Version=2.96

Loading…
Cancel
Save