Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| def4d4d57b | |||
| e810133ff5 | |||
| 45420c0b7b | |||
| 7e8830b7d0 | |||
| 1874689568 |
|
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |
155
Compile and Release.ahk
Normal file
155
Compile and Release.ahk
Normal file
@@ -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
|
CoordMode, Mouse, Screen
|
||||||
FileEncoding, UTF-8-RAW ; Needed for special symbols that are used in video descritions
|
FileEncoding, UTF-8-RAW ; Needed for special symbols that are used in video descritions
|
||||||
if(InStr(A_ScriptName, ".ahk")){
|
if(InStr(A_ScriptName, ".ahk")){
|
||||||
Menu, Tray, Icon, %A_ScriptDir%\assets\FreedomainSMP.ico
|
Menu, Tray, Icon, %A_ScriptDir%\assets\Icon.ico
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorLoggingDirectory = %1%
|
ErrorLoggingDirectory = %1%
|
||||||
@@ -46,16 +46,14 @@ global UpdateVersionNumber
|
|||||||
|
|
||||||
;---ToDo---
|
;---ToDo---
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
; @todo: fix post scheduling - countdown not working
|
|
||||||
; @todo: Errorlog not getting appended to on > 1 run (ErrorLoggingFilePath) variable is missing somehwere
|
; @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
|
; Misc info
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
; Parler has a 1k char limit
|
; 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---
|
;---Global Variables---
|
||||||
@@ -97,14 +95,11 @@ global Locals
|
|||||||
global LinkedIn
|
global LinkedIn
|
||||||
global MeWe
|
global MeWe
|
||||||
global Twetch
|
global Twetch
|
||||||
; global ThinkSpot
|
|
||||||
; global Flote
|
|
||||||
global PocketNet
|
global PocketNet
|
||||||
; global parler
|
|
||||||
global Gettr
|
global Gettr
|
||||||
global steemit
|
global steemit
|
||||||
; global Pintrest
|
global Tumblr
|
||||||
; global Tumblr
|
|
||||||
|
|
||||||
; Check if Lib folder exists and create it if not
|
; Check if Lib folder exists and create it if not
|
||||||
LibFolder := A_ScriptDir . "\Lib"
|
LibFolder := A_ScriptDir . "\Lib"
|
||||||
@@ -491,8 +486,14 @@ Gui, Font, s%GUINormalFontSize%
|
|||||||
|
|
||||||
Gui, Font, Bold
|
Gui, Font, Bold
|
||||||
Gui, Add, GroupBox,r6.4 x%PlatformsGroupBoxXLocation% y210 w300, Platforms
|
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, 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 vTelegram Checked%TelegramCheckStatus% gUpdateVars, Telegram
|
||||||
Gui, Add, Checkbox, y+7 vSubscribeStar Checked%SubScribeStarCheckStatus%gUpdateVars, SubscribeStar
|
Gui, Add, Checkbox, y+7 vSubscribeStar Checked%SubScribeStarCheckStatus%gUpdateVars, SubscribeStar
|
||||||
Gui, Add, Checkbox, y+7 vMinds Checked%MindsCheckStatus% gUpdateVars, Minds
|
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 vPocketNet Checked%PocketNetCheckStatus% , Bastyon
|
||||||
Gui, Add, Checkbox, y+7 vGettr Checked%GettrCheckStatus% gUpdateVars, Gettr
|
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 vMeWe Checked%MeWeCheckStatus% gUpdateVars, MeWe
|
||||||
|
Gui, Add, Checkbox, y+7 vTumblr Checked%Tumblr% gUpdateVars, Tumblr
|
||||||
|
|
||||||
|
|
||||||
Gui, Font, Bold
|
Gui, Font, Bold
|
||||||
@@ -609,10 +611,6 @@ UpdateScript:
|
|||||||
UpdateScript()
|
UpdateScript()
|
||||||
Return
|
Return
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*/
|
|
||||||
|
|
||||||
CancelPost:
|
CancelPost:
|
||||||
GuiClose:
|
GuiClose:
|
||||||
; ExitApp
|
; ExitApp
|
||||||
@@ -636,25 +634,27 @@ run, "%A_ScriptFullPath%" "LastPost"
|
|||||||
Return
|
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:
|
SelectFilepath:
|
||||||
FileSelectFile, SelectedImageFilepath
|
FileSelectFile, SelectedImageFilepath
|
||||||
GuiControl,, ImageAttachmentFilepath, %SelectedImageFilepath%
|
GuiControl,, ImageAttachmentFilepath, %SelectedImageFilepath%
|
||||||
Return
|
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:
|
UpdateVars:
|
||||||
Gui, Submit, NoHide
|
Gui, Submit, NoHide
|
||||||
Return
|
Return
|
||||||
@@ -798,7 +798,6 @@ IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowT
|
|||||||
(PocketNet = 1)?(PostedWebsites .= "PocketNet|") : ()
|
(PocketNet = 1)?(PostedWebsites .= "PocketNet|") : ()
|
||||||
(Gettr = 1)?(PostedWebsites .= "Gettr|") : ()
|
(Gettr = 1)?(PostedWebsites .= "Gettr|") : ()
|
||||||
(Steemit = 1)?(PostedWebsites .= "Steemit|") : ()
|
(Steemit = 1)?(PostedWebsites .= "Steemit|") : ()
|
||||||
(Pintrest = 1)?(PostedWebsites .= "Pintrest|") : ()
|
|
||||||
(Tumblr = 1)?(PostedWebsites .= "Tumblr|") : ()
|
(Tumblr = 1)?(PostedWebsites .= "Tumblr|") : ()
|
||||||
|
|
||||||
Message = Starting SMP with: **V%ScriptVersion%** `nTo sites: %PostedWebsites% `nWith Title: **%PostTitle%** `nWith Body:%PostBody% `nWith Tags: %PostTags%
|
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)
|
if(Twetch)
|
||||||
Gosub, PostToTwetch
|
Gosub, PostToTwetch
|
||||||
|
|
||||||
; if(Thinkspot)
|
if(Tumblr)
|
||||||
; Gosub, PostToThinkSpot
|
Gosub, PostToTumblr
|
||||||
|
|
||||||
if(Locals)
|
if(Locals)
|
||||||
Gosub, PostToLocals
|
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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Pintrest%
|
||||||
|
|
||||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
|
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, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Tumblr
|
||||||
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
|
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
|
||||||
|
|
||||||
|
|
||||||
; Gui, Font, s9
|
; 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%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, s%GUINormalFontSize%
|
||||||
Gui, Font, Bold
|
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/
|
; 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
|
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:
|
CopyErrorLoggingFilepath:
|
||||||
; Msgbox % "ErrorLoggingFilePath: " ErrorLoggingFilePath
|
; Msgbox % "ErrorLoggingFilePath: " ErrorLoggingFilePath
|
||||||
@@ -1123,6 +1071,11 @@ Return
|
|||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
#include %A_ScriptDir%\Modules\Post-To-LinkedIn.ahk
|
#include %A_ScriptDir%\Modules\Post-To-LinkedIn.ahk
|
||||||
|
|
||||||
|
; Tumblr
|
||||||
|
;------------------------------------------------
|
||||||
|
#include %A_ScriptDir%\Modules\Post-To-Tumblr.ahk
|
||||||
|
|
||||||
|
|
||||||
; Minds
|
; Minds
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
#include %A_ScriptDir%\Modules\Post-To-Minds.ahk
|
#include %A_ScriptDir%\Modules\Post-To-Minds.ahk
|
||||||
|
|||||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: 6bf72336d0...4a1d2a5d9d
@@ -27,7 +27,7 @@ ReadWebsiteStatuses(){
|
|||||||
; IniRead, Flote, %StatusFileFilePath%, Status, Flote, %A_Space%
|
; IniRead, Flote, %StatusFileFilePath%, Status, Flote, %A_Space%
|
||||||
IniRead, PocketNet, %StatusFileFilePath%, Status, PocketNet, %A_Space%
|
IniRead, PocketNet, %StatusFileFilePath%, Status, PocketNet, %A_Space%
|
||||||
; IniRead, Pintrest, %StatusFileFilePath%, Status, Pintrest, %A_Space%
|
; IniRead, Pintrest, %StatusFileFilePath%, Status, Pintrest, %A_Space%
|
||||||
; IniRead, Tumblr, %StatusFileFilePath%, Status, Tumblr, %A_Space%
|
IniRead, Tumblr, %StatusFileFilePath%, Status, Tumblr, %A_Space%
|
||||||
}
|
}
|
||||||
|
|
||||||
AddToTotalPostsPostedCount(){
|
AddToTotalPostsPostedCount(){
|
||||||
|
|||||||
@@ -83,9 +83,12 @@ if(ImageAttachmentFilepath != ""){
|
|||||||
if(!InStr(Status, "id")){
|
if(!InStr(Status, "id")){
|
||||||
parsed := JSON.Load(Status)
|
parsed := JSON.Load(Status)
|
||||||
Error := parsed.content[1]
|
Error := parsed.content[1]
|
||||||
; Msgbox % "error: " error
|
|
||||||
Message = Discord Post Failed due to API Issue. Error was saved to errorlog; please forward to Yuriy
|
Message = Discord Post Failed due to API Issue. Please See ErrorLog for details
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
|
||||||
|
Message = Discord API Returned Data:`n %Error%
|
||||||
|
SaveOrPostProgress(Message,PostType:=",ErrorLoggingTextFile")
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,13 +146,36 @@ sleep, 500
|
|||||||
driver.FindElementByXPath(Xpath).SendKeys("`n`n")
|
driver.FindElementByXPath(Xpath).SendKeys("`n`n")
|
||||||
sleep, 500
|
sleep, 500
|
||||||
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostBody)
|
if(InStr(PostBody, "http")){
|
||||||
if(Status){
|
StrLengthOfPost := StrLen(PostBody)
|
||||||
Message = Failed to input Post Body
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:="Body has hyperlink, Inputting text key by key",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
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
|
; check if value was input
|
||||||
js = return document.querySelector("trix-editor[role='textbox']").innerText
|
js = return document.querySelector("trix-editor[role='textbox']").innerText
|
||||||
|
|||||||
153
Modules/Post-To-Substack.ahk
Normal file
153
Modules/Post-To-Substack.ahk
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
|
||||||
|
; -------------------------------Minds-------------------------------
|
||||||
|
PostToSubstack:
|
||||||
|
CurrentSite := "Substack"
|
||||||
|
Message = Navigating to Post Creationg Page
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IniRead, SubstackProfileURL, %SettingsIniFilepath%, SocialMediaPoster, SubstackProfileURL, %A_Space%
|
||||||
|
if(SubstackProfileURL = ""){
|
||||||
|
Message = SubstackProfileURL is blank. Please update Settings.ini under [SocialMediaPoster]`nSubstackProfileURL=https://PROFILENAME.substack.com/publish/home
|
||||||
|
IniWrite,%A_Space%,%SettingsIniFilepath%, SocialMediaPoster, SubstackProfileURL
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
URLAttempt := NavigateFromBaseURLTo(SubstackProfileURL)
|
||||||
|
if(URLAttempt = "Failed")
|
||||||
|
Return
|
||||||
|
|
||||||
|
Status := CheckCurrentTabForCurrentSite()
|
||||||
|
if(Status){
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Check Login Status
|
||||||
|
; ------------------------------------------------
|
||||||
|
Message = Checking Login Status
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip")
|
||||||
|
|
||||||
|
|
||||||
|
; Check for New Post button at the top right of page
|
||||||
|
Xpath = (//button[@id='trigger7'])[1]
|
||||||
|
try ElementInnerText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
|
||||||
|
if(!InStr(ElementInnerText, "New post")){
|
||||||
|
Message = New post button not found. Please check login status. If already logged in, the xpath of the element might have changed.
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
; Start Text Post
|
||||||
|
; ------------------------------------------------
|
||||||
|
Message = Creating New Post
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
; click new post button
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
if(status){
|
||||||
|
Message = Failed to click New post button
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; click new note button in popup menu
|
||||||
|
Xpath = //div[contains(text(),'New note')]
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
if(status){
|
||||||
|
Message = Failed to click New note button
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
; Input Title and Text
|
||||||
|
; ------------------------------------------------
|
||||||
|
|
||||||
|
; Input Text Box, this is awful and will probably break in the future, but works for now.
|
||||||
|
; @todo: Figure out relative xpath, SelectorHub is not providing anything useful.
|
||||||
|
Xpath = /html[1]/body[1]/div[4]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]
|
||||||
|
|
||||||
|
|
||||||
|
try, CurrentText := driver.findelementbyxpath(Xpath).Attribute("innerText") ;XPATH Inner Text
|
||||||
|
if(strlen(CurrentText) > 1){
|
||||||
|
Message = Exiting. Functionality to clear out previous failed posts is a WIP.
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody, ClearElement:=0)
|
||||||
|
if(Status){
|
||||||
|
Message = Failed to input Post Title/Body
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Attach Image
|
||||||
|
; ------------------------------------------------
|
||||||
|
if(ImageAttachmentFilepath){
|
||||||
|
Message = Attaching Image
|
||||||
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
Xpath = (//input[@accept='image/*,.heic'])[1]
|
||||||
|
|
||||||
|
; Attach image
|
||||||
|
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")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
; driver.FindElementByXPath(Xpath).SendKeys(PostTitleAndBody)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 = //button[normalize-space()='Post']
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IniWrite, Successful, %StatusFileFilePath%, Status, %CurrentSite%
|
||||||
|
AddToTotalPostsPostedCount()
|
||||||
|
|
||||||
|
PauseBetweenPosts()
|
||||||
|
DevModeMsgBox("done!")
|
||||||
|
|
||||||
|
Message = Post Publish Successful
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
|
||||||
|
Return
|
||||||
|
; -------------------------------/Minds-------------------------------
|
||||||
@@ -88,9 +88,12 @@ TelegramBody := ASCIISTRReplace(PostBody)
|
|||||||
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Message )
|
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Message )
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Status){
|
if(instr(Status, "error_code")){
|
||||||
Message = Upload Failed due to API issue. Telegram API Returned Value:`n %Status%
|
Message = Upload Failed Due To API Issue. Please See Error Log For Details
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
Message = Telegram API Returned Data:`n %Status%
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
165
Modules/Post-To-Tumblr.ahk
Normal file
165
Modules/Post-To-Tumblr.ahk
Normal file
@@ -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]
|
[Social-Media-Poster]
|
||||||
Version=2.92
|
Version=2.96
|
||||||
|
|||||||
Reference in New Issue
Block a user