Compare commits
26 Commits
57ab61167b
...
2.90
| Author | SHA1 | Date | |
|---|---|---|---|
|
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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -39,11 +39,9 @@ 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---
|
||||
;------------------------------------------------
|
||||
@@ -98,7 +96,7 @@ global Locals
|
||||
global LinkedIn
|
||||
global MeWe
|
||||
global Twetch
|
||||
global ThinkSpot
|
||||
; global ThinkSpot
|
||||
; global Flote
|
||||
global PocketNet
|
||||
; global parler
|
||||
@@ -122,6 +120,14 @@ 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
|
||||
FullScriptName := ScriptName . " " . ScriptVersion
|
||||
|
||||
|
||||
|
||||
;---General Info---
|
||||
;------------------------------------------------
|
||||
IniRead, TestingMode, %SettingsIniFilepath%, General, TestingMode, 0
|
||||
@@ -175,7 +181,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 +222,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,19 +258,25 @@ 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, 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
|
||||
PostBody := PostBody . "`n`n" . PodcastURL . VideoURL
|
||||
|
||||
; Msgbox % "PostTitle: " PostTitle
|
||||
; Msgbox % "PostBody: " PostBody
|
||||
@@ -293,13 +306,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)
|
||||
(Twetch != "")?(TwetchCheckStatus := 0) : (TwetchCheckStatus := 0)
|
||||
; (ThinkSpot != "")?(ThinkSpotCheckStatus := 0) : (ThinkSpotCheckStatus := 0)
|
||||
; (Flote != "")?(FloteCheckStatus := 0) : (FloteCheckStatus := 0)
|
||||
; (Pintrest != "")?(PintrestCheckStatus := 0) : (PintrestCheckStatus := 1)
|
||||
; (Parler != "")?(ParlerCheckStatus := 0) : (ParlerCheckStatus := 0)
|
||||
@@ -320,7 +333,7 @@ if(TestingMode){ ; Easy testing for Yuriy
|
||||
LinkedINCheckStatus := 0
|
||||
MeWeCheckStatus := 0
|
||||
TwetchCheckStatus := 0
|
||||
ThinkSpotCheckStatus := 0
|
||||
; ThinkSpotCheckStatus := 0
|
||||
PocketNetCheckStatus := 0
|
||||
}
|
||||
|
||||
@@ -479,9 +492,9 @@ 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, x+75 yp-190 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 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, y+7 vSteemit Checked%SteemitCheckStatus% gUpdateVars, Steemit
|
||||
@@ -512,14 +525,23 @@ ControlFocus, Edit1, %FullScriptName%
|
||||
|
||||
|
||||
; check for updates if the setting is enabled
|
||||
if(AutoUpdateCheck AND !SkipUpdateCheckThisRun){
|
||||
CheckForUpdates(GitReleasesAPIURL)
|
||||
if(AutoUpdateCheck AND !UpdateAvailable){
|
||||
Message = Checking for Updates
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
; DevModeMsgBox("checking for updates")
|
||||
; msgbox, checkin for update
|
||||
; DevModeMsgBox(GitReleasesAPIURL)
|
||||
; UpdateAvailable :=
|
||||
|
||||
if(CheckForUpdates(GitReleasesAPIURL))
|
||||
GuiControl,,UpdateAvailable, Uploader Update Available!
|
||||
|
||||
; if(CheckForChromeUpdates(ChromeFilepath))
|
||||
; GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
|
||||
if(CheckForChromeUpdates(ChromeFilepath)){
|
||||
GuiControl,,ChromeUpdateAvailable, Chrome Update Available!
|
||||
ChromeUpdateAvailable := 1
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;---Check for Update---
|
||||
@@ -615,7 +637,9 @@ if(!status){
|
||||
}
|
||||
|
||||
|
||||
DownloadLatestChromium()
|
||||
Status := DownloadLatestChromium()
|
||||
if(Status)
|
||||
GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat
|
||||
|
||||
|
||||
Return
|
||||
@@ -649,7 +673,7 @@ run, "%A_ScriptFullPath%" "LastPost"
|
||||
Return
|
||||
|
||||
OpenGiteaPage:
|
||||
run, https://git.freedomainplaylists.com/yuriy/Freedomain_Social_Media_Poster
|
||||
run, https://freedomain.dev/yuriy/social-media-poster
|
||||
Return
|
||||
|
||||
CompileScript:
|
||||
@@ -808,7 +832,7 @@ IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowT
|
||||
(Locals = 1)?(PostedWebsites .= "Locals|") : ()
|
||||
(LinkedIn = 1)?(PostedWebsites .= "LinkedIn|") : ()
|
||||
(Twetch = 1)?(PostedWebsites .= "Twetch|") : ()
|
||||
(ThinkSpot = 1)?(PostedWebsites .= "ThinkSpot|") : ()
|
||||
; (ThinkSpot = 0)?(PostedWebsites .= "ThinkSpot|") : ()
|
||||
; (Flote = 1)?(PostedWebsites .= "Flote|") : ()
|
||||
(PocketNet = 1)?(PostedWebsites .= "PocketNet|") : ()
|
||||
(Gettr = 1)?(PostedWebsites .= "Gettr|") : ()
|
||||
@@ -883,8 +907,8 @@ Gosub, PostToMeWe
|
||||
if(Twetch)
|
||||
Gosub, PostToTwetch
|
||||
|
||||
if(Thinkspot)
|
||||
Gosub, PostToThinkSpot
|
||||
; if(Thinkspot)
|
||||
; Gosub, PostToThinkSpot
|
||||
|
||||
if(Locals)
|
||||
Gosub, PostToLocals
|
||||
@@ -976,20 +1000,14 @@ Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center,
|
||||
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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Flote%
|
||||
@@ -997,21 +1015,31 @@ Gui, Font, s%GUINormalFontSize%
|
||||
; Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% 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%MarginSpace% 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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Pintrest%
|
||||
|
||||
Gui, Add, Button,x%StatusTextSecondRowXPos% y+%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
|
||||
Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, Bastyon
|
||||
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
|
||||
|
||||
; 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, s9
|
||||
/*
|
||||
Gui, Add, Button, x%MarginSpace% y+20 w165 h50 gCancelPost, Close
|
||||
Gui, Add, Button, x+%Marginspace% w215 h50 gSendErrorLoggingThroughTelegram, Telegram Detailed Errorlog
|
||||
*/
|
||||
|
||||
|
||||
|
||||
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%StatusTextSecondRowXPos% y40 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%StatusTextSecondRowXPos% y+%marginspace% h50 w270 h80 gTryFailedAgain, Try Failed Again
|
||||
|
||||
|
||||
/*Gui, Add, Button,x%MarginSpace% w%WebsiteButtonWidths% h%ButtonHeights% Center, PocketNet
|
||||
@@ -1169,7 +1197,7 @@ Return
|
||||
|
||||
; Thinkspot
|
||||
;------------------------------------------------
|
||||
#include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
|
||||
; #include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
|
||||
|
||||
; Misc Functions
|
||||
;------------------------------------------------
|
||||
|
||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: 1962743565...e32fe026e9
@@ -148,47 +148,17 @@ if(Status = ""){
|
||||
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
|
||||
|
||||
|
||||
/*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(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")
|
||||
|
||||
|
||||
@@ -8,30 +8,13 @@ SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Toolti
|
||||
|
||||
|
||||
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=
|
||||
if(LocalsURL = "" OR !InStr(LocalsURL, "/share/post")){
|
||||
Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=`n`nURL Needs to end in: /share/post
|
||||
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")
|
||||
|
||||
Status := NavigateFromBaseURLTo(LocalsURL)
|
||||
if(Status = "Failed")
|
||||
Return
|
||||
@@ -58,12 +41,22 @@ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
||||
Message = Inputting Post Content
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
Xpath = //input[@id='title']
|
||||
try driver.FindElementByXPath(Xpath).click()
|
||||
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")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
|
||||
Xpath = //*[@id="body"]
|
||||
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:=PostBody)
|
||||
if(Status){
|
||||
Message = Failed to input Title
|
||||
Message = Failed to input Body
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
@@ -96,23 +89,6 @@ if(ImageAttachmentFilepath != ""){
|
||||
Message = Submitting Post
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
|
||||
|
||||
|
||||
/* ; 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)
|
||||
|
||||
@@ -194,31 +194,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
|
||||
|
||||
@@ -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,50 @@ 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")
|
||||
|
||||
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)
|
||||
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 Post Title
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
; msgbox, 3
|
||||
|
||||
; driver.FindElementByXPath(Xpath).SendKeys(PostTitle)
|
||||
sleep, 500
|
||||
driver.FindElementByXPath(Xpath).SendKeys("`n`n")
|
||||
sleep, 500
|
||||
|
||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostBody)
|
||||
if(Status){
|
||||
Message = Failed to input Post Body
|
||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||
SaveDriverURLOFErrorPage()
|
||||
Return
|
||||
}
|
||||
|
||||
; 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 != ""){
|
||||
@@ -163,7 +203,55 @@ if(ImageAttachmentFilepath != ""){
|
||||
; 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")
|
||||
}
|
||||
|
||||
; 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 +260,7 @@ if(ImageAttachmentFilepath != ""){
|
||||
Return
|
||||
}
|
||||
|
||||
*/
|
||||
IniWrite, Successful, %StatusFileFilePath%, Status, SubScribeStar
|
||||
AddToTotalPostsPostedCount()
|
||||
|
||||
|
||||
@@ -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-------------------------------
|
||||
|
||||
@@ -115,7 +115,7 @@ 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.89
|
||||
Reference in New Issue
Block a user