Compare commits
39 Commits
57ab61167b
...
2.98
| Author | SHA1 | Date | |
|---|---|---|---|
| def4d4d57b | |||
| e810133ff5 | |||
| 45420c0b7b | |||
| 7e8830b7d0 | |||
| 1874689568 | |||
| b928db02b6 | |||
| 7c7e97d056 | |||
| a8358ffef9 | |||
| b540942eea | |||
| 5b2e8970bf | |||
| 3a439e7300 | |||
| 64c03c9f65 | |||
|
|
845af386c0 | ||
|
d5edbc058c
|
|||
|
f70498afce
|
|||
|
|
a3f16aa6f2 | ||
|
982f857640
|
|||
|
|
0597c90144 | ||
|
|
5703a896ff | ||
|
9b506a8f73
|
|||
|
|
1880170b07 | ||
|
|
09c9dbd485 | ||
|
|
5492130564 | ||
|
|
5ba8412f18 | ||
|
|
7fd46a9913 | ||
|
|
9c93a35b37 | ||
|
17cc313f83
|
|||
|
|
bde745f6e2 | ||
|
|
108baea92e | ||
|
|
6be4fac939 | ||
| 5ed47d281c | |||
| e67b80a2d8 | |||
| 600481a517 | |||
| 038bbdf9fa | |||
| 4215cc71ae | |||
| 181044be9a | |||
| de310d8f14 | |||
| 1e10349d56 | |||
| c4eef942e5 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,3 +27,4 @@ Compile Scripts to EXE.ahk
|
||||
Freedomain Video Uploader.exe
|
||||
Lib/LBRY Process Killer.exe
|
||||
Lib/chrome-win64
|
||||
Lib/Version.ini
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "Lib/Freedomain-Posters-Shared-Functions"]
|
||||
path = Lib/Freedomain-Posters-Shared-Functions
|
||||
url = https://git.freedomainplaylists.com/yuriy/Freedomain-Posters-Shared-Functions.git
|
||||
url = https://freedomain.dev/yuriy/posters-shared-functions.git
|
||||
|
||||
|
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |
BIN
Assets/icon.png
Normal file
BIN
Assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -14,29 +14,24 @@ CoordMode, Mouse, Screen
|
||||
|
||||
;---Notes/Extra Info/#Includes------------------------------------------------------
|
||||
|
||||
; msgbox
|
||||
|
||||
;---VARIABLES-----------------------------------------------------------------------
|
||||
/*ScriptToCompile = %1%
|
||||
CompileType = %2% ; Testing OR Production
|
||||
if(CompileType = "")
|
||||
CompileType = Testing
|
||||
; Msgbox % "CompileType: " CompileType
|
||||
if(ScriptToCompile = "")
|
||||
ExitApp
|
||||
|
||||
|
||||
*/
|
||||
|
||||
; Msgbox % "ScriptToCompile: " ScriptToCompile
|
||||
ScriptToCompile = SocialMediaPoster
|
||||
; ScriptToCompile = ScriptUpdater
|
||||
;---MAIN SCRIPT---------------------------------------------------------------------
|
||||
|
||||
AHKFilepath = %A_ScriptDir%\Freedomain Social Media Poster.ahk
|
||||
Exefilepath = %A_ScriptDir%\Freedomain Social Media Poster.exe
|
||||
icopath = %A_ScriptDir%\Assets\FreedomainSMP.ico
|
||||
VersionIniFP = %A_ScriptDir%\Version.ini
|
||||
|
||||
|
||||
; 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)
|
||||
; Msgbox % "VersionNumber: " VersionNumber
|
||||
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, Freedomain Social Media Poster.exe
|
||||
@@ -68,8 +63,6 @@ if(!FileExist(icopath)){
|
||||
run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
|
||||
|
||||
|
||||
; OldNotify(ScriptToCompile,"Compiled Successfully",5)
|
||||
; sleep, 5000
|
||||
ExitApp
|
||||
|
||||
|
||||
|
||||
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,10 +7,11 @@ 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%
|
||||
PassedInArgument = %1%
|
||||
|
||||
; Add menus to the toolbar icon
|
||||
Menu, tray, NoStandard ; remove standard tray
|
||||
@@ -39,24 +40,20 @@ global UpdateVersionNumber
|
||||
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\JSON.ahk
|
||||
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\RunCMD.ahk
|
||||
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.ahk
|
||||
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\URLDownloadToVar.ahk
|
||||
|
||||
|
||||
ScriptName = Freedomain Social Media Poster
|
||||
ScriptVersion = 2.83
|
||||
FullScriptName := ScriptName . " " . ScriptVersion
|
||||
|
||||
;---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---
|
||||
@@ -98,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"
|
||||
@@ -122,6 +116,15 @@ ChangelogIniFilepath := A_ScriptDir . "\Lib\FreedomScriptsChangelogINI"
|
||||
global ScriptSettingsSection
|
||||
ScriptSettingsSection := "SocialMediaPoster"
|
||||
|
||||
|
||||
FileInstall, Version.ini, %A_ScriptDir%\Lib\Version.ini, 1
|
||||
IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,Social-Media-Poster, Version, 0.0
|
||||
ScriptName = Freedomain Social Media Poster
|
||||
ScriptAbbreviatedName := "FSMP"
|
||||
FullScriptName := ScriptName . " " . ScriptVersion
|
||||
|
||||
|
||||
|
||||
;---General Info---
|
||||
;------------------------------------------------
|
||||
IniRead, TestingMode, %SettingsIniFilepath%, General, TestingMode, 0
|
||||
@@ -130,7 +133,9 @@ IniRead, TelegramBotToken, %SettingsIniFilepath%, SocialMediaPoster, TelegramBot
|
||||
IniRead, TelegramBotChatID, %SettingsIniFilepath%, SocialMediaPoster, TelegramBotChatID, %A_Space%
|
||||
IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, SocialMediaPoster, DiscordErrorLoggingWebhookBotURL, %A_Space%
|
||||
IniRead, DiscordParlerWebhookURL, %SettingsIniFilepath%, SocialMediaPoster, DiscordParlerWebhookURL, %A_Space%
|
||||
; IniRead, ChromeFilepath, %SettingsIniFilepath%, SocialMediaPoster, ChromeFilepath, %A_Space%
|
||||
IniRead, ChromeFilepath, %SettingsIniFilepath%, SocialMediaPoster, ChromeFilepath, %A_Space%
|
||||
IniRead, ConfirmBeforeSubmit, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit, 1
|
||||
; IniRead, SaveGUIPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, SaveGUIPosition, 1
|
||||
|
||||
|
||||
|
||||
@@ -175,7 +180,7 @@ IniRead, TotalRunTime, %SettingsIniFilepath%, %ScriptSettingsSection%, TotalRunT
|
||||
;------------------------------------------------
|
||||
|
||||
global GitReleasesAPIURL
|
||||
GitReleasesAPIURL =https://git.freedomainplaylists.com/api/v1/repos/yuriy/Freedomain-Social-Media-Poster/releases
|
||||
GitReleasesAPIURL = https://freedomain.dev/api/v1/repos/yuriy/Freedomain-Social-Media-Poster/releases
|
||||
|
||||
; Save filepath of the current script to %SettingsIniFilepath% so it can be read and used by the script updater
|
||||
; Append informatio to ini files for Freedomain Program Updater
|
||||
@@ -216,7 +221,8 @@ if(InStr(ErrorLoggingDirectory,ScriptName) and InStr(ErrorLoggingDirectory,".exe
|
||||
}
|
||||
|
||||
|
||||
if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){ ; if argument was passed in, read contents from that directory
|
||||
; if argument was passed in, read contents from that directory and grab video info for social media post
|
||||
if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
|
||||
; SaveOrPostProgress(Message:="Starting Up: Reading Information from Files",PostType:="Tooltip")
|
||||
|
||||
SkipUpdateCheckThisRun := 1
|
||||
@@ -251,26 +257,35 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
|
||||
; Read video links from video links file
|
||||
IniRead, BitChuteURL, %ErrorLoggingDirectory%,URLs, BitChuteURL, %A_Space%
|
||||
IniRead, RumbleURL, %ErrorLoggingDirectory%,URLs, RumbleURL, %A_Space%
|
||||
IniRead, StreamanityURL, %ErrorLoggingDirectory%,URLs, StreamanityURL, %A_Space%
|
||||
; IniRead, BitChuteURL, %ErrorLoggingDirectory%,URLs, BitChuteURL, %A_Space%
|
||||
IniRead, BrighteonURL, %ErrorLoggingDirectory%,URLs, BrighteonURL, %A_Space%
|
||||
IniRead, BitChuteURL, %ErrorLoggingDirectory%,URLs, BitChuteURL, %A_Space%
|
||||
IniRead, LocalsURL, %ErrorLoggingDirectory%,URLs, LocalsURL, %A_Space%
|
||||
|
||||
IniRead, PodcastNumber, %ErrorLoggingDirectory%,Misc, PodcastNumber, %A_Space%
|
||||
|
||||
|
||||
if(BitChuteURL = ""){
|
||||
if(RumbleURL != "")
|
||||
VideoURL := RumbleURL
|
||||
else,
|
||||
VideoURL := StreamanityURL
|
||||
VideoURL := BrighteonURL
|
||||
}
|
||||
else,
|
||||
VideoURL := BitChuteURL
|
||||
|
||||
if(PodcastNumber != ""){
|
||||
PodcastURL := "https://fdrpodcasts.com/" . PodcastNumber . "`n`n"
|
||||
}
|
||||
|
||||
; Append bitchute url to bottom of description
|
||||
PostBody := PostBody . "`n`n" . VideoURL
|
||||
|
||||
; Msgbox % "PostTitle: " PostTitle
|
||||
; Msgbox % "PostBody: " PostBody
|
||||
|
||||
PostBody := PostBody . "`n`n" . PodcastURL . VideoURL
|
||||
|
||||
Discord := 0
|
||||
Telegram := 0
|
||||
|
||||
; if videos was uploaded to locals, don't SMP announce
|
||||
if(LocalsURL)
|
||||
Locals := 1
|
||||
}
|
||||
else, { ; otherwise passed in from a previous run.
|
||||
|
||||
@@ -283,7 +298,6 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
|
||||
|
||||
ReadWebsiteStatuses() ; Read .ini file of post statuses for each site
|
||||
}
|
||||
; Tooltip
|
||||
}
|
||||
|
||||
|
||||
@@ -293,18 +307,13 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
|
||||
(Telegram != "")?(TelegramCheckStatus := 0) : (TelegramCheckStatus := 1)
|
||||
(Minds != "")?(MindsCheckStatus := 0) : (MindsCheckStatus := 1)
|
||||
(Gab != "")?(GabCheckStatus := 0) : (GabCheckStatus := 1)
|
||||
(MeWe != "")?(MeWeCheckStatus := 0) : (MeWeCheckStatus := 1) ; UNCHECKED ALWAYS as of 2022/04/08
|
||||
(Gettr != "")?(GettrCheckStatus := 0) : (GettrCheckStatus := 1)
|
||||
(MeWe != "")?(MeWeCheckStatus := 0) : (MeWeCheckStatus := 1)
|
||||
(Gettr != "")?(GettrCheckStatus := 0) : (GettrCheckStatus := 0)
|
||||
(Steemit != "")?(SteemitCheckStatus := 0) : (SteemitCheckStatus := 1)
|
||||
(Locals != "")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 1)
|
||||
(LinkedIN != "")?(LinkedINCheckStatus := 0) : (LinkedINCheckStatus := 1)
|
||||
(Twetch != "")?(TwetchCheckStatus := 0) : (TwetchCheckStatus := 1)
|
||||
(ThinkSpot != "")?(ThinkSpotCheckStatus := 0) : (ThinkSpotCheckStatus := 1)
|
||||
; (Flote != "")?(FloteCheckStatus := 0) : (FloteCheckStatus := 0)
|
||||
; (Pintrest != "")?(PintrestCheckStatus := 0) : (PintrestCheckStatus := 1)
|
||||
; (Parler != "")?(ParlerCheckStatus := 0) : (ParlerCheckStatus := 0)
|
||||
(Twetch != "")?(TwetchCheckStatus := 0) : (TwetchCheckStatus := 0)
|
||||
(PocketNet != "")?(PocketNetCheckStatus := 0) : (PocketNetCheckStatus := 1)
|
||||
; (Tumblr != "")?(TumblrCheckStatus := 0) : (TumblrCheckStatus := 1)
|
||||
|
||||
|
||||
|
||||
@@ -320,46 +329,53 @@ if(TestingMode){ ; Easy testing for Yuriy
|
||||
LinkedINCheckStatus := 0
|
||||
MeWeCheckStatus := 0
|
||||
TwetchCheckStatus := 0
|
||||
ThinkSpotCheckStatus := 0
|
||||
PocketNetCheckStatus := 0
|
||||
}
|
||||
|
||||
|
||||
;---GUI Variables---
|
||||
;------------------------------------------------
|
||||
IniRead, XPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, XPosition, 0
|
||||
IniRead, YPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, YPosition, 0
|
||||
|
||||
TooltipXPosition := Round((A_ScreenWidth / 2) - (A_ScreenWidth / 10)) ; Center Tooltip on the screen and a bit to the left
|
||||
|
||||
GuiWidth := 1366
|
||||
GuiFontSize := 10
|
||||
TemplatesGroupBoxWidth := 700
|
||||
MarginSpace = 10
|
||||
MarginSpaceDoubled := MarginSpace * 2
|
||||
MarginSize = 10
|
||||
MarginSizeDoubled := MarginSize * 2
|
||||
EditBoxWidth := 700
|
||||
EditBoxHalfWidths := EditBoxWidth / 2 - (MarginSpace * 1.7)
|
||||
EditBoxThirdsWidth := EditBoxWidth / 3 - (MarginSpace * 1.5)
|
||||
EditBoxHalfWidths := EditBoxWidth / 2 - (MarginSize * 1.7)
|
||||
EditBoxThirdsWidth := EditBoxWidth / 3 - (MarginSize * 1.5)
|
||||
GroupBox_PlatformsWidth := 180
|
||||
ImageSelectionButtonWidth := 100
|
||||
ImageFilepathEditBoxWidth := EditBoxWidth - ImageSelectionButtonWidth - MarginSpace
|
||||
ImageFilepathEditBoxWidth := EditBoxWidth - ImageSelectionButtonWidth - MarginSize
|
||||
SelectFileButtonWidth := 50
|
||||
SelectFileButtonXPos := EditBoxWidth - SelectFileButtonWidth - MarginSpace
|
||||
SelectFileButtonXPos := EditBoxWidth - SelectFileButtonWidth - MarginSize
|
||||
CharCountXPos := EditBoxWidth - 20
|
||||
; FilePathEditBoxWidth := EditBoxWidth - SelectFileButtonWidth - MarginSpace
|
||||
; FilePathEditBoxWidth := EditBoxWidth - SelectFileButtonWidth - MarginSize
|
||||
|
||||
PlatformsGroupBoxXLocation := EditBoxWidth + (MarginSpace * 3)
|
||||
PlatformsGroupBoxXLocation := EditBoxWidth + (MarginSize * 3)
|
||||
; SettingsGroupBoxXLocation := PlatformsGroupBoxXLocation + ActionButtonWidths
|
||||
SettingsGroupBoxXLocation := PlatformsGroupBoxXLocation + GroupBox_PlatformsWidth
|
||||
ActionButtonWidths := 355
|
||||
|
||||
ActionButtonHalfWidths := (ActionButtonWidths / 2) - (MarginSpace / 2)
|
||||
ActionButtonHalfWidths := (ActionButtonWidths / 2) - (MarginSize / 2)
|
||||
|
||||
Gui, Margin, %MarginSpace%, %MarginSpace%
|
||||
Gui, Margin, %MarginSize%, %MarginSize%
|
||||
GUINormalFontSize := 15
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; Create GUI Elements
|
||||
; ------------------------------------------------
|
||||
Gui, Font, s10
|
||||
; Gui, Font, s8
|
||||
if(TestingMode){
|
||||
Gui, Add, Text,cRed yp+0 x%MarginSpace% ,TESTING MODE
|
||||
Gui, Add, Text,cRed yp+0 x%MarginSize% ,TESTING MODE
|
||||
}
|
||||
if(DevMode){
|
||||
Gui, Add, Text,cRed yp+0 x+30 ,DEV MODE
|
||||
@@ -368,28 +384,32 @@ if(DevMode){
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Text, x%Marginspace% y+5 w%EditBoxWidth%, Post Title
|
||||
Gui, Add, Text, x%MarginSize% y+5, Post Title
|
||||
Gui, Font, s8
|
||||
Gui, Add, Checkbox, xp+120 yp+10 vBoldTitleWAPI Checked%BoldTitleCheckStatus% gUpdateVars,Bold Title on Discord/Telegram
|
||||
Gui, Add, Checkbox, xp+220 yp+0 vNewLineBetweenTitle Checked%SpaceBetweenTitleBodyCheckStatus% gUpdateVars,Blank Line Between Title+Body
|
||||
Gui, Font, Normal
|
||||
Gui, Font, s8
|
||||
Gui, Add, Button, x+%MarginSize% gPasteClipboardToEditBox vPasteClipboardToSMPTitle, Paste Clipboard
|
||||
Gui, Add, Checkbox, xp+120 vBoldTitleWAPI Checked%BoldTitleCheckStatus% gUpdateVars,Bold Title on Discord/Telegram
|
||||
Gui, Add, Checkbox, xp+220 vNewLineBetweenTitle Checked%SpaceBetweenTitleBodyCheckStatus% gUpdateVars,Blank Line Between Title+Body
|
||||
Gui, Font, Normal
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Add, Edit, x%MarginSpace% y+3 w%EditBoxWidth% vPostTitle gUpdateCharCount h75, %PostTitle%
|
||||
Gui, Add, Edit, x%MarginSize% y+%MarginSize% w%EditBoxWidth% vPostTitle gUpdateCharCount h50, %PostTitle%
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Text,w%EditBoxWidth%, Post Body
|
||||
Gui, Add, Text,, Post Body
|
||||
Gui, Font, Normal
|
||||
|
||||
Gui, Font, s8
|
||||
Gui, Add, Button, x+%MarginSize% gPasteClipboardToEditBox vPasteClipboardToSMPBody, Paste Clipboard
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Add, Edit, x%MarginSpace% y+2 w%EditBoxWidth% h150 vPostBody gUpdateCharCount, %PostBody%
|
||||
Gui, Add, Edit, x%MarginSize% y+2 w%EditBoxWidth% h200 vPostBody gUpdateCharCount, %PostBody%
|
||||
|
||||
; Gui, font, color, cblack
|
||||
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Text, x%marginspace% y+%MarginSpace% w%EditBoxWidth% ,Tags
|
||||
Gui, Add, Text, x%MarginSize% y+%MarginSize% w%EditBoxWidth% ,Tags
|
||||
Gui, Font, s7
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Text, x65 yp+7, (Required by Steemit, Bastyon, )
|
||||
@@ -400,37 +420,39 @@ Gui, Add, Edit,yp-5 x%CharCountXPos% w30 vCharCount,
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x%MarginSpace% y+10 vPostTags gUpdateVars h33 w%EditBoxWidth%, %PostTags%
|
||||
Gui, Add, Edit, x%MarginSize% y+10 vPostTags gUpdateVars h33 w%EditBoxWidth%, %PostTags%
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Text,x%marginspace% w%EditBoxWidth%, Image Attachment Filepath
|
||||
Gui, Add, Text,x%MarginSize% w%EditBoxWidth%, Image Attachment Filepath
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Edit, x%MarginSpace% y+2 vImageAttachmentFilepath gUpdateVars h33 w%ImageFilepathEditBoxWidth%, %ImageAttachmentFilepath%
|
||||
Gui, Add, Edit, x%MarginSize% y+2 vImageAttachmentFilepath gUpdateVars h33 w%ImageFilepathEditBoxWidth%, %ImageAttachmentFilepath%
|
||||
Gui, Add, Button, gSelectFilepath w%ImageSelectionButtonWidth% x+M yp+0 h33, Select
|
||||
|
||||
Gui, Font, Bold
|
||||
Gui, Add, GroupBox,r2.5 x%MarginSpace% y+20 Center w%TemplatesGroupBoxWidth%, Other
|
||||
Gui, Add, GroupBox,r2.5 x%MarginSize% y+20 Center w%TemplatesGroupBoxWidth%, Other
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Button,xp+%Marginspace% yp+35 w%EditBoxThirdsWidth% h30 gSaveAsTemplate, Save As Template
|
||||
Gui, Add, Button,x+%MarginSpace% w%EditBoxThirdsWidth% h30 gLoadTemplate, Load Template
|
||||
Gui, Add, Button, x+%MarginSpace% w%EditBoxThirdsWidth% h30 gLoadLastPost, Load Last Post
|
||||
Gui, Add, Button,xp+%MarginSize% yp+35 w%EditBoxThirdsWidth% h30 gSaveAsTemplate, Save As Template
|
||||
Gui, Add, Button,x+%MarginSize% w%EditBoxThirdsWidth% h30 gLoadTemplate, Load Template
|
||||
Gui, Add, Button, x+%MarginSize% w%EditBoxThirdsWidth% h30 gLoadLastPost, Load Last Post
|
||||
|
||||
if(UpdateAvailable)
|
||||
Gui, Add, Button, x%MarginSpaceDoubled% y+%MarginSpace% w%EditBoxHalfWidths% h30 gUpdateScript vUpdateAvailable, Update Available: %UpdateVersionNumber%
|
||||
/*if(UpdateAvailable)
|
||||
Gui, Add, Button, x%MarginSizeDoubled% y+%MarginSize% w%EditBoxHalfWidths% h30 gUpdateScript vUpdateAvailable, Update Available: %UpdateVersionNumber%
|
||||
else,
|
||||
Gui, Add, Button, x%MarginSpaceDoubled% y+%MarginSpace% w%EditBoxHalfWidths% h30 gUpdateScript vUpdateAvailable, Poster Up-to-Date
|
||||
|
||||
*/
|
||||
Gui, Add, Button, x%MarginSizeDoubled% y+%MarginSize% w%EditBoxHalfWidths% h30 gUpdateScript vUpdateAvailable, %ScriptAbbreviatedName% Up-to-Date
|
||||
|
||||
/*
|
||||
|
||||
if(ChromeUpdateAvailable)
|
||||
Gui, Add, Button,x+%MarginSpace% yp+0 w%EditBoxHalfWidths% h30 vChromeUpdateAvailable gUpdateChrome, Chrome Update Available!
|
||||
Gui, Add, Button,x+%MarginSize% yp+0 w%EditBoxHalfWidths% h30 vChromeUpdateAvailable gUpdateChrome, Chrome Update Available!
|
||||
else,
|
||||
Gui, Add, Button,x+%MarginSpace% yp+0 w%EditBoxHalfWidths% h30 vChromeUpdateAvailable gUpdateChrome , Chrome Up-to-Date
|
||||
*/
|
||||
Gui, Add, Button,x+%MarginSize% yp+0 w%EditBoxHalfWidths% h30 vChromeUpdateAvailable gUpdateChrome , Chrome Up-to-Date
|
||||
|
||||
|
||||
if(DevMode){
|
||||
Gui, Add, Button, x%MarginSpace% y+10 w%EditBoxThirdsWidth% h30 gOpenErrorLog, OpenErrorLog
|
||||
Gui, Add, Button, x%MarginSize% y+10 w%EditBoxThirdsWidth% h30 gOpenErrorLog, OpenErrorLog
|
||||
|
||||
}
|
||||
|
||||
@@ -452,23 +474,26 @@ Gui, Add, GroupBox,r4 x%PlatformsGroupBoxXLocation% y20 w300, Settings
|
||||
Gui, Font, s11
|
||||
Gui, Font, Normal
|
||||
Gui, Add, Checkbox, xp+10 yp+25 vAutoUpdateCheck Checked%AutoUpdateCheckCheckStatus% gUpdateVars, Auto Update Check
|
||||
Gui, Add, Checkbox, vReuseTabs Checked%ReuseTabsCheckStatus% gUpdateVars, Try to Re-Use Tabs
|
||||
; Gui, Add, Checkbox, vNewChromeWindow Checked%AutoUpdateCheckCheckStatus% gUpdateVars, Create New Chrome Window (WIP)
|
||||
; Gui, Add, Checkbox, vReuseTabs Checked%ReuseTabsCheckStatus% gUpdateVars, Try to Re-Use Tabs
|
||||
Gui, Add, Checkbox,vShowTooltipProgress Checked%ShowTooltipProgressCheckStatus% gUpdateVars, Show Tooltip of Progress
|
||||
; Gui, Add, Checkbox, vAutoUpdateCheck Checked%AutoUpdateCheckCheckStatus% gUpdateVars, Auto Update Check
|
||||
Gui, Add, Checkbox, vSaveTagsBetweenPosts Checked%SaveTagsBetweenPostsCheckStatus% gUpdateVars, Save Tags Between Posts
|
||||
Gui, Add, Checkbox, vPauseBetweenPosts Checked%PauseBetweenPostsCheckCheckStatus% gUpdateVars, Pause Briefly Between Posts
|
||||
Gui, Add, Checkbox, vConfirmBeforeSubmit checked%ConfirmBeforeSubmit%, Confirm Before Submit
|
||||
; Gui, Add, Checkbox, vSaveGUIPosition checked%SaveGUIPosition%, Save GUI Position
|
||||
|
||||
; Gui, Add, Checkbox, vPauseBetweenPosts Checked%PauseBetweenPostsCheckCheckStatus% gUpdateVars, Pause Briefly Between Posts
|
||||
; Gui, Add, Checkbox, vAutoRestartChromeDebug Checked%PauseBetweenPostsCheckCheckStatus% gUpdateVars, Auto Restart Chrome in Debug Mode
|
||||
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
|
||||
@@ -476,26 +501,17 @@ Gui, Add, Checkbox, y+7 vGab Checked%GabCheckStatus% gUpdateVars, Gab
|
||||
Gui, Add, Checkbox, y+7 vLocals Checked%LocalsCheckStatus% gUpdateVars, Locals
|
||||
Gui, Add, Checkbox, y+7 vTwetch Checked%TwetchCheckStatus% gUpdateVars, Twetch
|
||||
|
||||
|
||||
; Second Row
|
||||
; Gui, Add, Checkbox, vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
|
||||
Gui, Add, Checkbox, x+75 yp-180 vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
|
||||
; Gui, Add, Checkbox, y+7 vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
|
||||
Gui, Add, Checkbox, y+7 vThinkspot Checked%ThinkSpotCheckStatus% gUpdateVars, Thinkspot
|
||||
; Gui, Add, Checkbox, y+7 vFlote Checked%FloteCheckStatus% gUpdateVars, Flote
|
||||
; Gui, Add, Checkbox, y+7 vParler Checked%ParlerCheckStatus% gUpdateVars, Parler
|
||||
Gui, Add, Checkbox, x+75 yp-190 vLinkedIn Checked%LinkedINCheckStatus% gUpdateVars, LinkedIn
|
||||
Gui, Add, Checkbox, y+7 vSteemit Checked%SteemitCheckStatus% gUpdateVars, Steemit
|
||||
; Gui, Add, Checkbox, y+7 vPintrest Checked%PintrestCheckStatus% gUpdateVars, Pintrest
|
||||
Gui, Add, Checkbox, y+7 vPocketNet Checked%PocketNetCheckStatus% , Bastyon
|
||||
; Gui, Add, Checkbox, y+7 vTumblr Checked%TumblrCheckStatus% , Tumblr
|
||||
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
|
||||
gui, Font, s15
|
||||
; : Gui, Add, Text, , My Text.
|
||||
; Gui, Font, Color, Red
|
||||
Gui, Add, Button, x%PlatformsGroupBoxXLocation% y485 w300 h113 gPostPost, Publish
|
||||
|
||||
; Gui, Add, Button, x%PlatformsGroupBoxXLocation% y+20 w300 h30 gSchedulePost, Schedule Post
|
||||
@@ -507,23 +523,19 @@ gui, font, normal
|
||||
Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Total Run Time: %TotalRunTime% Seconds |
|
||||
|
||||
; easier to just let the gui size be as needed instead of trying to recalculate the size each time an element is added
|
||||
Gui, Show,,%FullScriptName% ; , w%GuiWidth%, %ScriptName%
|
||||
; if(SaveGUIPosition)
|
||||
Gui, Show, x%XPosition% y%YPosition% ,%FullScriptName% ; , w%GuiWidth%, %ScriptName%
|
||||
; else,
|
||||
; Gui, Show,,%FullScriptName% ; , w%GuiWidth%, %ScriptName%
|
||||
|
||||
; Activate the Post Title input box so user can start instantly typing in their new message
|
||||
ControlFocus, Edit1, %FullScriptName%
|
||||
|
||||
|
||||
; check for updates if the setting is enabled
|
||||
if(AutoUpdateCheck AND !SkipUpdateCheckThisRun){
|
||||
CheckForUpdates(GitReleasesAPIURL)
|
||||
GuiControl,,UpdateAvailable, Uploader Update Available!
|
||||
|
||||
; if(CheckForChromeUpdates(ChromeFilepath))
|
||||
; GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
|
||||
|
||||
if(AutoUpdateCheck AND !UpdateAvailable){
|
||||
SetTimer, CheckForUpdates, -1000
|
||||
}
|
||||
|
||||
|
||||
;---Check for Update---
|
||||
;------------------------------------------------
|
||||
Return
|
||||
|
||||
|
||||
@@ -532,6 +544,9 @@ Return
|
||||
|
||||
;---Misc GoSubs---
|
||||
;------------------------------------------------
|
||||
|
||||
|
||||
|
||||
SaveAsTemplate:
|
||||
TemplateDirectory = %A_ScriptDir%\Lib\Templates
|
||||
if(!FileExist(TemplateDirectory)){
|
||||
@@ -596,42 +611,12 @@ UpdateScript:
|
||||
UpdateScript()
|
||||
Return
|
||||
|
||||
|
||||
UpdateChrome:
|
||||
|
||||
if(CheckForChromeUpdates = "")
|
||||
Status := CheckForChromeUpdates(ChromeFilepath)
|
||||
|
||||
if(!status){
|
||||
OnMessage(0x44, "OnMsgBoxConfirmChromiumOverwrite")
|
||||
MsgBox 0x41, Already Up-to-Date, Yor current Chromium version is already up to date. `nDo you want to download and overwrite it?
|
||||
OnMessage(0x44, "")
|
||||
|
||||
IfMsgBox OK, {
|
||||
Return
|
||||
} Else IfMsgBox Cancel, {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DownloadLatestChromium()
|
||||
|
||||
|
||||
Return
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
CancelPost:
|
||||
GuiClose:
|
||||
; ExitApp
|
||||
Gui, Submit,
|
||||
Return
|
||||
|
||||
OpenErrorLog:
|
||||
run, %ErrorLoggingDirectory%
|
||||
Return
|
||||
|
||||
ToggleTestingMode:
|
||||
ToggleTestingMode()
|
||||
@@ -648,29 +633,28 @@ ToggleDevMode()
|
||||
run, "%A_ScriptFullPath%" "LastPost"
|
||||
Return
|
||||
|
||||
OpenGiteaPage:
|
||||
run, https://git.freedomainplaylists.com/yuriy/Freedomain_Social_Media_Poster
|
||||
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
|
||||
@@ -679,19 +663,12 @@ UpdateCharCount:
|
||||
Gui, Submit, NoHide
|
||||
Count := StrLen(PostBody)
|
||||
|
||||
/*if(Count > 256){
|
||||
GuiControl,, Twetch, 0
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
GuiControl,, CharCount, %Count%
|
||||
Return
|
||||
|
||||
|
||||
|
||||
TryFailedAgain:
|
||||
; msgbox %ErrorLoggingDirectory%
|
||||
run, %A_ScriptFullPath% "LastPost"
|
||||
ExitApp
|
||||
; Return
|
||||
@@ -703,11 +680,10 @@ Gui, Submit
|
||||
Gui, Destroy
|
||||
|
||||
|
||||
|
||||
Gui, Font, Normal
|
||||
Gui, Font, s20
|
||||
Gui, Add, Text, Center w350 x%marginspace%,Time to Post At
|
||||
Gui, Add, DateTime, x%marginspace% vScheduledTime gUpdateVars w350, hh:mm tt
|
||||
Gui, Add, Text, Center w350 x%MarginSize%,Time to Post At
|
||||
Gui, Add, DateTime, x%MarginSize% vScheduledTime gUpdateVars w350, hh:mm tt
|
||||
Gui, Font, s8
|
||||
Gui, Add, Checkbox, vDisplayCountdownTooltip gUpdateVars checked, Display Tooltip with Countdown
|
||||
Gui, Font, s20
|
||||
@@ -718,9 +694,10 @@ Return
|
||||
|
||||
|
||||
PostPost:
|
||||
Gui, Submit
|
||||
Gui, Submit, NoHide
|
||||
|
||||
; Msgbox % "PostTags: " PostTags
|
||||
; Get GUI window position for saving to settings file
|
||||
WinGetPos, XPosition, YPosition, , , A
|
||||
|
||||
if(InStr(PostTags, "http")){
|
||||
Message = Post Tags contain "http". Please edit and remove the url and try again.
|
||||
@@ -732,7 +709,6 @@ if(InStr(PostTags, "http")){
|
||||
|
||||
Gui, Destroy
|
||||
|
||||
; 20211023061711
|
||||
ScheduledTime := SubStr(ScheduledTime, 1, 12) ; pull out time date up to the minute and exclude seconds
|
||||
; Msgbox % "ScheduledTime: " ScheduledTime
|
||||
; clipboard := ScheduledTime
|
||||
@@ -745,7 +721,6 @@ ScheduledTime := SubStr(ScheduledTime, 1, 12) ; pull out time date up to the min
|
||||
; if the argument is an error logging post, we want to continue where it left off and log to the same place
|
||||
|
||||
|
||||
; Msgbox % "ErrorLoggingDirectory: " ErrorLoggingDirectory
|
||||
if(InStr(ErrorLoggingDirectory, "\Templates\") OR ErrorLoggingDirectory = "" OR InStr(ErrorLoggingDirectory, "VideoLinks.ini")){
|
||||
; msgbox, creating new error logging files
|
||||
CreateErrorLoggingFiles()
|
||||
@@ -753,6 +728,10 @@ if(InStr(ErrorLoggingDirectory, "\Templates\") OR ErrorLoggingDirectory = "" OR
|
||||
} ;
|
||||
|
||||
|
||||
; Save Script Settings to File
|
||||
; ------------------------------------------------
|
||||
IniWrite, %XPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, XPosition
|
||||
IniWrite, %YPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, YPosition
|
||||
|
||||
IniWrite, %BoldTitleWAPI%, %SettingsIniFilepath%, SocialMediaPoster, BoldTitleWAPI
|
||||
IniWrite, %NewLineBetweenTitle%, %SettingsIniFilepath%, SocialMediaPoster, NewLineBetweenTitle
|
||||
@@ -763,6 +742,14 @@ IniWrite, %SaveTagsBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, Save
|
||||
IniWrite, %PauseBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, PauseBetweenPosts
|
||||
IniWrite, %ErrorLoggingDirectory%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost
|
||||
|
||||
IniWrite, %ConfirmBeforeSubmit%, %SettingsIniFilepath%, %ScriptSettingsSection%, ConfirmBeforeSubmit
|
||||
; IniWrite, %SaveGUIPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, SaveGUIPosition
|
||||
|
||||
; Used by Post Scheduler, VU, Livestream Scheduler. Filepath changes between script updates
|
||||
IniWrite, %A_ScriptFullPath%, %SettingsIniFilepath%, Filepaths, SocialMediaPosterFilepath
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; Combines two variables together so they can be used as needed later
|
||||
@@ -808,29 +795,20 @@ IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowT
|
||||
(Locals = 1)?(PostedWebsites .= "Locals|") : ()
|
||||
(LinkedIn = 1)?(PostedWebsites .= "LinkedIn|") : ()
|
||||
(Twetch = 1)?(PostedWebsites .= "Twetch|") : ()
|
||||
(ThinkSpot = 1)?(PostedWebsites .= "ThinkSpot|") : ()
|
||||
; (Flote = 1)?(PostedWebsites .= "Flote|") : ()
|
||||
(PocketNet = 1)?(PostedWebsites .= "PocketNet|") : ()
|
||||
(Gettr = 1)?(PostedWebsites .= "Gettr|") : ()
|
||||
; (Parler = 1)?(PostedWebsites .= "Parler|") : ()
|
||||
(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%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
|
||||
if(InStr(PostBody, "www.dlive.tv") AND !InStr(PostBody, "https://www.dlive.tv")){ ; if posting Dlive link, turn it into hyperlink
|
||||
PostBody := StrReplace(PostBody, "www.dlive.tv", "https://www.dlive.tv")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
; Msgbox % "PostTitleAndBody: " PostTitleAndBody
|
||||
; 20211023060415
|
||||
if(ScheduledPost){
|
||||
; CheckSeleniumDriver()
|
||||
; Menu, Tray, Icon, %A_ScriptDir%\Lib\FreedomainShare_Scheduled.ico
|
||||
@@ -883,8 +861,8 @@ Gosub, PostToMeWe
|
||||
if(Twetch)
|
||||
Gosub, PostToTwetch
|
||||
|
||||
if(Thinkspot)
|
||||
Gosub, PostToThinkSpot
|
||||
if(Tumblr)
|
||||
Gosub, PostToTumblr
|
||||
|
||||
if(Locals)
|
||||
Gosub, PostToLocals
|
||||
@@ -927,9 +905,9 @@ WebsiteButtonWidths = 115
|
||||
WebsiteStatusEditWidths = 150
|
||||
|
||||
StatusTextWidth := (WebsiteButtonWidths + WebsiteStatusEditWidths) * 2
|
||||
StatusTextSecondRowXPos := WebsiteStatusEditWidths + WebsiteButtonWidths + (MarginSpace * 4)
|
||||
ErrorSummaryLogXPos := StatusTextSecondRowXPos + WebsiteStatusEditWidths + WebsiteButtonWidths + (MarginSpace * 2)
|
||||
ErrorSummaryLogSplitLineXPos := ErrorSummaryLogXPos - (MarginSpace)
|
||||
StatusTextSecondRowXPos := WebsiteStatusEditWidths + WebsiteButtonWidths + (MarginSize * 4)
|
||||
ErrorSummaryLogXPos := StatusTextSecondRowXPos + WebsiteStatusEditWidths + WebsiteButtonWidths + (MarginSize * 2)
|
||||
ErrorSummaryLogSplitLineXPos := ErrorSummaryLogXPos - (MarginSize)
|
||||
ErrorLogSummaryWidth := 385
|
||||
ErrorLogSummaryHeight := 480
|
||||
ButtonHeights := 30
|
||||
@@ -939,99 +917,104 @@ ButtonHeights := 30
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Font, Bold
|
||||
Gui, Add, Text,w%StatusTextWidth% y%MarginSpace% Center, Status
|
||||
Gui, Add, Text,w%StatusTextWidth% y%MarginSize% Center, Status
|
||||
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% y40 w%WebsiteButtonWidths% Center h%ButtonHeights%, Discord
|
||||
Gui, Add, Button,x%MarginSize% y40 w%WebsiteButtonWidths% Center h%ButtonHeights%, Discord
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Discord%
|
||||
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% Center h%ButtonHeights%, Telegram
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% Center h%ButtonHeights%, Telegram
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Telegram%
|
||||
|
||||
gui, font, s8
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% Center h%ButtonHeights%, SubScribeStar
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% Center h%ButtonHeights%, SubScribeStar
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %SubscribeStar%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Minds
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Minds
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Minds%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Gab
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Gab
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Gab%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Locals
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Locals
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Locals%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Gettr
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Gettr
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Gettr%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths%Center h%ButtonHeights%, Twetch
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths%Center h%ButtonHeights%, Twetch
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Twetch%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, LinkedIn
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, LinkedIn
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %LinkedIn%
|
||||
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, MeWe
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, MeWe
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %MeWe%
|
||||
|
||||
|
||||
Gui, Font, s9
|
||||
Gui, Add, Button, x%MarginSpace% y+20 w165 h50 gCancelPost, Close
|
||||
Gui, Add, Button, x+%Marginspace% w215 h50 gSendErrorLoggingThroughTelegram, Telegram Detailed Errorlog
|
||||
Gui, Add, Button, x+%Marginspace% h50 w165 gTryFailedAgain, Try Failed Again
|
||||
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
|
||||
gui, font, s8
|
||||
Gui, Add, Button,x%StatusTextSecondRowXPos% y40 w%WebsiteButtonWidths%Center h%ButtonHeights%, ThinkSpot
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %ThinkSpot%
|
||||
; gui, font, s8
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y40 w%WebsiteButtonWidths%Center h%ButtonHeights%, ThinkSpot
|
||||
; Gui, Font, s%GUINormalFontSize%
|
||||
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %ThinkSpot%
|
||||
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
; Gui, Font, s%GUINormalFontSize%
|
||||
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Flote
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Flote
|
||||
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Flote%
|
||||
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% gActivateParlerTab Center, Parler
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% gActivateParlerTab Center, Parler
|
||||
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Parler%
|
||||
|
||||
Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Steemit
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Steemit
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Steemit%
|
||||
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Pintrest
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Pintrest
|
||||
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Pintrest%
|
||||
|
||||
Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Bastyon%
|
||||
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Tumblr
|
||||
; Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
|
||||
|
||||
Gui, Font, s8
|
||||
Gui, Add, Button, x%StatusTextSecondRowXPos% y+40 w270 h40 Center gCopyPostToClipboard, Copy Post To Clipboard `nFor Easy Pasting to Other Sites
|
||||
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSpace% w270 h40 Center gCopyImageFilepathToClipboard, Copy Image Filepath To Clipboard
|
||||
Gui, Add, Button,x%MarginSize% w%WebsiteButtonWidths% h%ButtonHeights% Center, Tumblr
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Tumblr%
|
||||
|
||||
|
||||
/*Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, PocketNet
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
|
||||
|
||||
; Gui, Font, s9
|
||||
/*
|
||||
Gui, Add, Button, x%MarginSize% y+20 w165 h50 gCancelPost, Close
|
||||
Gui, Add, Button, x+%MarginSize% w215 h50 gSendErrorLoggingThroughTelegram, Telegram Detailed Errorlog
|
||||
*/
|
||||
|
||||
|
||||
|
||||
Gui, Font, s10
|
||||
Gui, Add, Button, x%StatusTextSecondRowXPos% y40 w270 h40 Center gCopyPostToClipboard, Copy Post To Clipboard
|
||||
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSize% w270 h40 Center gCopyImageFilepathToClipboard, Copy Image Filepath To Clipboard
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSize% w270 h40 gOpenGiteaPage, Report Bug
|
||||
Gui, Add, Button, x%StatusTextSecondRowXPos% y+%MarginSize% w270 h80 gTryFailedAgain, Try Failed Again
|
||||
|
||||
|
||||
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/
|
||||
Gui, Add, Text, x%ErrorSummaryLogXPos% y%MarginSpace% w%ErrorLogSummaryWidth% Center, Error Log Summary
|
||||
Gui, Add, Text, x%ErrorSummaryLogXPos% y%MarginSize% w%ErrorLogSummaryWidth% Center, Error Log Summary
|
||||
|
||||
Gui, Font, Normal
|
||||
Gui, Font, s10
|
||||
Gui, Add, Edit, x%ErrorSummaryLogXPos% y+%MarginSpace% w%ErrorLogSummaryWidth% h%ErrorLogSummaryHeight%, %ErrorLogVar%
|
||||
Gui, Add, Edit, x%ErrorSummaryLogXPos% y+%MarginSize% w%ErrorLogSummaryWidth% h%ErrorLogSummaryHeight%, %ErrorLogVar%
|
||||
Gui, Font, s%GUINormalFontSize%
|
||||
|
||||
gui, font, s6
|
||||
Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Run Time: %ScriptRunTime% Seconds
|
||||
|
||||
Gui, Show,, %FullScriptName% - Post Results
|
||||
; if(SaveGUIPosition)
|
||||
Gui, Show, x%XPosition% y%YPosition%, %FullScriptName% - Post Results
|
||||
; else,
|
||||
; Gui, Show,, %FullScriptName% - Post Results
|
||||
|
||||
|
||||
SaveCurrentChromeVersionToIniFile()
|
||||
@@ -1039,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
|
||||
@@ -1135,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
|
||||
@@ -1169,8 +1110,11 @@ Return
|
||||
|
||||
; Thinkspot
|
||||
;------------------------------------------------
|
||||
#include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
|
||||
; #include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
|
||||
|
||||
; Misc Functions
|
||||
;------------------------------------------------
|
||||
#include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk
|
||||
|
||||
; used by update checker and paste from clipboard
|
||||
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Shared-GoTos.ahk
|
||||
|
||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: 1962743565...4a1d2a5d9d
@@ -27,37 +27,9 @@ 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%
|
||||
}
|
||||
|
||||
; -------------------------------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,26 +100,14 @@ if(Status = ""){
|
||||
|
||||
|
||||
sleep, 2000
|
||||
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
/*
|
||||
*/
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
; Message = Attaching Image
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
|
||||
; 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)
|
||||
@@ -135,72 +123,47 @@ if(Status = ""){
|
||||
|
||||
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% {
|
||||
; 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']
|
||||
driver.FindElementByXPath(Xpath).SendKeys(Tag)
|
||||
driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(Tag)
|
||||
catch e {
|
||||
Message = Failed to input tag: %tag%
|
||||
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
; driver.findElementsByClass("sminput").item[2].click()
|
||||
|
||||
; JsToExecute = document.querySelector("#text[placeholder='Add Categories/Tags']").value = "#%Tag%"
|
||||
; Status := JS_TryToExecute(JsToExecute)
|
||||
;
|
||||
; driver.SendKeys(driver.Keys.SPACE)
|
||||
;
|
||||
; JsToExecute = return document.querySelector("#text[placeholder='Add Categories/Tags']").value
|
||||
; Status := JS_TryToExecute(JsToExecute)
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
|
||||
|
||||
if(A_index = 5)
|
||||
Break
|
||||
}
|
||||
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
/*Tag := TagsArray[A_Index]
|
||||
Tag := StrReplace(Tag, " ", "")
|
||||
; Tag = %Tag%
|
||||
Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=Tag)
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.Space)
|
||||
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
|
||||
}
|
||||
|
||||
*/
|
||||
; if(A_index = 8) ; Steemit only allows 8 tags
|
||||
; Break
|
||||
}
|
||||
; msgbox
|
||||
|
||||
/* Xpath = //div[@class='emojionearea-editor pastable']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=3,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
||||
if(Status){
|
||||
SaveOrPostProgress(Message:="Failed to Input Post",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
|
||||
; Send,
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
; Msgbox,4096,Pause!!,asdf
|
||||
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; CLick the post button
|
||||
Xpath = //button[normalize-space()='Post']
|
||||
loop, 3 {
|
||||
; 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)
|
||||
}
|
||||
; 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")
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -43,7 +43,7 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
loop, 3 {
|
||||
Xpath = (//span[normalize-space()='Start a post'])[1] ; start a post button
|
||||
Xpath = (//span[normalize-space()='Start a post, try writing with AI'])[1] ; start a post button
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
if(!Status)
|
||||
Break
|
||||
@@ -168,7 +168,7 @@ if(ImageAttachmentFilepath != ""){
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 5 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 5000
|
||||
*/
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -200,31 +200,27 @@ 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")){
|
||||
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, {
|
||||
}
|
||||
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){
|
||||
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)
|
||||
|
||||
@@ -235,7 +231,7 @@ loop, 3 {
|
||||
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']
|
||||
|
||||
@@ -2,35 +2,21 @@
|
||||
; -------------------------------Locals-------------------------------
|
||||
PostToLocals:
|
||||
CurrentSite := "Locals"
|
||||
; DevModeMsgBox("clik ok to continue")
|
||||
; @todo: Add auto-login to locals
|
||||
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space%
|
||||
|
||||
if(LocalsURL = ""){
|
||||
Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
Message = LocalsURL from Ini File: %LocalsURL%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
if(!InStr(LocalsURL, "/share/post")){
|
||||
LocalsURL = https://freedomain.locals.com/share/post
|
||||
|
||||
Message = LocalsURL from ini file was incorrect. New URL set to %LocalsURL% and saved to settings.ini
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
IniWrite, %LocalsURL%, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL
|
||||
}
|
||||
|
||||
; LocalsURL := StrReplace(Localsurl, "/share/post", "")
|
||||
; LocalsURL := Localsurl . "/login"
|
||||
; Message = Localsurl: %LocalsURL%
|
||||
; SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging")
|
||||
; /share/post is the legacy new post page.
|
||||
; Starting in 2024 all posts are published through the home page now.
|
||||
LocalsURL := StrReplace(LocalsURL, "/share/post")
|
||||
|
||||
Status := NavigateFromBaseURLTo(LocalsURL)
|
||||
if(Status = "Failed")
|
||||
@@ -58,10 +44,9 @@ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
||||
Message = Inputting Post Content
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
Xpath = //*[@id="body"]
|
||||
Xpath = //input[@id='title']
|
||||
try driver.FindElementByXPath(Xpath).click()
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle)
|
||||
if(Status){
|
||||
Message = Failed to input Title
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
@@ -70,6 +55,22 @@ if(Status){
|
||||
}
|
||||
|
||||
|
||||
Xpath = //*[@id="body"]
|
||||
try driver.FindElementByXPath(Xpath).click()
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostBody)
|
||||
if(Status){
|
||||
Message = Failed to input Body
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
; click the "Hide Links Preview" checkbox to hide previews of hyperlinks
|
||||
if(InStr(PostBody, "https")){
|
||||
Xpath = (//div[@class='hide-switcher-container'])[1]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=100)
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
@@ -95,68 +96,45 @@ 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)
|
||||
try driver.executeScript(js)
|
||||
|
||||
Message = Double checking that post got submitted
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 5000
|
||||
|
||||
|
||||
|
||||
|
||||
/* ; Click the final "post" button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Status := Selenium_LoopToClickName(ElementName:="submitPost",NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Submit Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
; msgbox
|
||||
|
||||
; @todo: add error check into here to check the current page url and after page url
|
||||
; Click Publish post
|
||||
js = document.getElementsByName('submitPost')[0].click(); ; Send content through javascript (Great for getting around emoji chrome limitaitons)
|
||||
try driver.executeScript(js)
|
||||
|
||||
Message = Double checking that post got submitted
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
sleep, 5000
|
||||
|
||||
|
||||
try CurrentTabURL := driver.Url
|
||||
if(InStr(CurrentTabURL, "share/post")) { ; post failed to submit if it's still on the create new post page
|
||||
Message = Error: Post Was Input but Failed to Submit.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
try CurrentTabURL := driver.Url
|
||||
if(InStr(CurrentTabURL, "share/post")) { ; post failed to submit if it's still on the create new post page
|
||||
Message = Error: Post Was Input but Failed to Submit.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
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()
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, Locals
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
PauseBetweenPosts()
|
||||
DevModeMsgBox("done!")
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||
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
|
||||
; -------------------------------/Locals-------------------------------
|
||||
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 {
|
||||
@@ -194,31 +199,33 @@ loop, 3 {
|
||||
|
||||
}
|
||||
|
||||
; msgbox, ork?
|
||||
|
||||
; click submit button
|
||||
js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click();
|
||||
try status := driver.executeScript(js)
|
||||
catch e {
|
||||
Message = Clicking submit button with JS resulted in status: %status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Message = Trying to click the Post button using Xpath
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Xpath = (//span[@class='ng-star-inserted'][normalize-space()='Post'])[2]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Submit Post after 2 different attempts
|
||||
Loop, 5 {
|
||||
if(A_index = 5){
|
||||
Message = Failed to submit after 5 attempts.
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
|
||||
}
|
||||
|
||||
js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click();
|
||||
try status := driver.executeScript(js)
|
||||
|
||||
sleep, 500
|
||||
|
||||
; check if Post button still exists
|
||||
js = return document.querySelector("m-composer__base[ismodal='true'] m-button[data-ref='post-button'] div").innerText
|
||||
try, Status := driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
|
||||
|
||||
if(!Status){
|
||||
; msgbox, successfully submitted after %A_index% attempts
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
sleep, 1000
|
||||
}
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 5 seconds to confirm post got submitted",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
sleep, 5000
|
||||
|
||||
@@ -65,48 +65,36 @@ 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")
|
||||
|
||||
|
||||
|
||||
/* 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()
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
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){
|
||||
; 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){
|
||||
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 != ""){
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
Message = Attaching Thumbnail
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
@@ -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){
|
||||
; 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()
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
|
||||
PauseBetweenPosts()
|
||||
DevModeMsgBox("done!")
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
Return
|
||||
;-----------------------/Steemit-------------------------
|
||||
Return
|
||||
;-----------------------/Steemit-------------------------
|
||||
|
||||
@@ -61,7 +61,29 @@ if(InStr(LoginStatus, "Log In")){ ; need to log in
|
||||
Message = Inputting Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; Click on "Start your post by clicking here"
|
||||
; click the "Create Post" button
|
||||
js = document.querySelector("div[class='new_post'] div[class='flat_button for-new_post']").click(); ; Send content through javascript (Great for getting around emoji chrome limitaitons)
|
||||
try, driver.executeScript(js)
|
||||
|
||||
sleep, 1000
|
||||
|
||||
|
||||
; 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. Failed to click on "Create Post" button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*; Click on "Start your post by clicking here"
|
||||
Xpath = //div[contains(text(),'Create Post')]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
@@ -84,6 +106,7 @@ if(Status){
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
; sleep, 5000
|
||||
; msgbox
|
||||
@@ -102,33 +125,73 @@ if(Status){
|
||||
; Input Text into pop-up edit box
|
||||
SaveOrPostProgress(Message:="Inputting Post Content",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; click on heading format button
|
||||
Xpath = //button[@title='Heading']//i
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||
|
||||
sleep, 500
|
||||
|
||||
|
||||
Xpath = //trix-editor[@role='textbox']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle)
|
||||
if(Status){
|
||||
Message = Failed to Input Post using Direct Xpath. Trying with Relative
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
Message = Failed to input Post Title
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
Xpath = /html/body/div/div[3]/div[2]/div[2]/div/div[1]/form/div[2]/div[1]/trix-editor
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
||||
; driver.FindElementByXPath(Xpath).SendKeys(PostTitle)
|
||||
sleep, 500
|
||||
driver.FindElementByXPath(Xpath).SendKeys("`n`n")
|
||||
sleep, 500
|
||||
|
||||
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 Post using Relative Xpath. Trying with Javascript
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
SubscribeStarJSDescription := FormatTextToJSText(PostTitleAndBody)
|
||||
js = document.querySelector("trix-editor[role='textbox']").value = "%SubscribeStarJSDescription%";
|
||||
try driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
|
||||
catch e {
|
||||
Message = Failed to Input Post Contents (E#8281)
|
||||
Message = Failed to Input Text
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
; msgbox, 3
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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
|
||||
try, Status := driver.executeScript(js)
|
||||
if(!Status){
|
||||
Message = Failed to input Post Content (E#8282)
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
else, { ; if input successfully, post to error log
|
||||
String := SubStr(Status, 1, 30)
|
||||
Message = Post Content that got input: %String% ...
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
}
|
||||
|
||||
|
||||
|
||||
; Attach an image if a filepath was provided
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
@@ -138,32 +201,71 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
; Click the post Button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
; Click the post Button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
Xpath = //button[contains(text(),'Post')]
|
||||
|
||||
; 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")
|
||||
}
|
||||
|
||||
|
||||
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 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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Xpath = //button[contains(text(),'Post')]
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Submit Post
|
||||
@@ -172,6 +274,7 @@ if(ImageAttachmentFilepath != ""){
|
||||
Return
|
||||
}
|
||||
|
||||
*/
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, SubScribeStar
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
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 )
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
|
||||
; -------------------------------ThinkSpot-------------------------------
|
||||
PostToThinkSpot:
|
||||
CurrentSite := "Thinkspot"
|
||||
|
||||
if(PostTags = ""){
|
||||
Message = Skipped: No Post Tags
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
IniWrite, Skipped: No Post Tags, %StatusFileFilePath%, Status, Thinkspot
|
||||
Return
|
||||
}
|
||||
|
||||
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
URLAttempt := NavigateFromBaseURLTo("https://www.thinkspot.com/create/post")
|
||||
if(URLAttempt = "Failed")
|
||||
Return
|
||||
|
||||
Status := CheckCurrentTabForCurrentSite()
|
||||
if(Status){
|
||||
Return
|
||||
}
|
||||
|
||||
Message = Checking Login Status
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
sleep, 1000
|
||||
try CurrentTabURL := driver.Url
|
||||
if(InStr(CurrentTabURL, "/sign_in")){
|
||||
Message = Login Cookies Expired. Trying to Re-Login
|
||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
; SaveDriverURLOFErrorPage()
|
||||
; Return
|
||||
Xpath = //input[@name='commit']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=1,SleepLength:=1000)
|
||||
if(!Status){
|
||||
Message = Logged in Successfully
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Status := NavigateFromBaseURLTo("https://www.thinkspot.com/create/post")
|
||||
(Status)?(Return):()
|
||||
sleep, 2000
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Status := CheckCurrentTabForCurrentSite()
|
||||
if(Status){
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Xpath = //a[@href='/create/post']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Click "Create Post" button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
; CLick into the title box of the new post window
|
||||
Xpath = //div[@id='editorjs']//div[@class='ql-editor ql-blank']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Click Into Titlebox: Check Login Status
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
sleep, 500
|
||||
|
||||
; Input the Post Title
|
||||
SaveOrPostProgress(Message:="Inputting Post Title",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Xpath = //input[@id='title']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostTitle)
|
||||
if(Status){
|
||||
Message = Failed to Input Post Title: Check Login Status
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
; Input post body
|
||||
if(ImageAttachmentFilepath != "")
|
||||
PostBody := PostBody . "`n"
|
||||
SaveOrPostProgress(Message:="Inputting Post Content",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Xpath = //div[@id='editorjs']//p
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=PostBody)
|
||||
if(Status){
|
||||
Message = Failed to Input Post Body: Check Login Status
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
; Input Post Tags
|
||||
Xpath = //span[@role='textbox']
|
||||
TagsArray := StrSplit(PostTags, ",")
|
||||
TagsArrayLength := TagsArray.Length() ; Save total number of items in the array
|
||||
loop, %TagsArrayLength%{
|
||||
Tag := TagsArray[A_Index]
|
||||
|
||||
Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,SendKeysContent:=Tag)
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(ImageAttachmentFilepath != ""){
|
||||
; Click "Image" button
|
||||
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
; Insert image by sending it directly.
|
||||
; elements aren't loaded until the attach image button is pressed though, so defeats the purpose
|
||||
/*Xpath = //input[@class='ql-image']
|
||||
try driver.FindElementByXPath(Xpath).SendKeys(ImageAttachmentFilepath)
|
||||
|
||||
*/
|
||||
|
||||
Xpath = //button[@class='ql-image']
|
||||
Status := Selenium_LoopToClickXpathAndWaitForOpenWindow(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to click "Attach Image" button
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
Xpath = //input[@class='ql-image']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
|
||||
if(Status){
|
||||
Message = Failed to Attach Image (E#7611)
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
}
|
||||
else, {
|
||||
InputStatus := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
|
||||
if(InputStatus = "Failed")
|
||||
{
|
||||
sleep, 2000
|
||||
Xpath = //i[@class='material-icons-outlined'][normalize-space()='image'] ; give it a second try :fingerscrossed:
|
||||
Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
|
||||
InputStatus := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
|
||||
if(InputStatus)
|
||||
{ ; Try sending directly to element
|
||||
Xpath = //input[@class='ql-image']
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
|
||||
if(Status){
|
||||
Message = Failed to Attach Image (E#7612)
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SaveOrPostProgress(Message:="Waiting 10 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
sleep, 10000
|
||||
}
|
||||
|
||||
; Click the Post button
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
Xpath = //button[normalize-space()='Post']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to Submit Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, Thinkspot
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
|
||||
PauseBetweenPosts()
|
||||
|
||||
; dismiss the pop up that appears for some reason
|
||||
; try driver.switchToalert().accept()
|
||||
DevModeMsgBox("done!")
|
||||
|
||||
Message = Post Publish Successful
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
|
||||
|
||||
Return
|
||||
; -------------------------------/ThinkSpot-------------------------------
|
||||
|
||||
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-------------------------------
|
||||
@@ -108,14 +108,29 @@ 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
|
||||
|
||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
Xpath = //button[normalize-space()='Post $0.02']
|
||||
Xpath = //button[@id='composer-post-btn']
|
||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=4,SleepLength:=1000)
|
||||
if(Status){
|
||||
Message = Failed to click on Submit Post Button
|
||||
|
||||
@@ -32,7 +32,7 @@ Automated posting to the following social media platforms, utilizing either the
|
||||
- Open Chrome and type in `about::version` into the URL bar. The very first line will tell you what Chrome version you have
|
||||
- After downloading, extract “chromedriver_win32.zip” and move the extracted chromedriver.exe to: `C:\Program Files\SeleniumBasic\chromedriver.exe`
|
||||
- NOTE: The chromedriver will need to be re-downloaded whenever Chrome updates to keep up with API changes
|
||||
4. [Download the latest .exe of the Poster](https://git.zinchuk.xyz/yuriy/Freedomain-Social-Media-Poster/releases)
|
||||
4. [Download the latest .exe of the Poster](/yuriy/social-media-poster/releases)
|
||||
- When run, the poster will automatically create the folders and files it requires in the directory it's run from.
|
||||
|
||||
# Settings.ini
|
||||
|
||||
BIN
Settings.ini
Normal file
BIN
Settings.ini
Normal file
Binary file not shown.
2
Version.ini
Normal file
2
Version.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[Social-Media-Poster]
|
||||
Version=2.96
|
||||
Reference in New Issue
Block a user