13 Commits
2.88 ... 2.91

Author SHA1 Message Date
Yuriy
845af386c0 fixed locals.com posting, added ability to use custom chrome.exe filepath 2024-01-16 18:59:30 -05:00
d5edbc058c Update 'Modules/Post-To-Bastyon.ahk'
Added error handling to failed tag input
2024-01-15 00:19:08 +00:00
f70498afce add newline after fdrpodcasts URL for post body 2024-01-15 00:18:13 +00:00
Yuriy
a3f16aa6f2 changed back mewe always being unchecked by default 2024-01-12 22:25:59 -05:00
982f857640 add newline after fdrpodcasts URL for post body 2024-01-02 12:33:04 -07:00
Yuriy
0597c90144 Added error handling if freedomain.dev or chrome-for-testing API is not reachable 2023-12-18 23:33:35 -05:00
Yuriy
5703a896ff added automatic version bump when script is compiled, moved version number outside of main script 2023-12-18 23:04:46 -05:00
9b506a8f73 Update 'Modules/Post-To-Bastyon.ahk'
Added error handling to failed tag input
2023-12-19 03:37:20 +00:00
Yuriy
1880170b07 added settings.ini 2023-12-17 22:19:38 -05:00
Yuriy
09c9dbd485 fixed settings.ini 2023-12-17 22:19:17 -05:00
Yuriy
5492130564 removed empty lines from settings.ini 2023-12-17 21:25:28 -05:00
Yuriy
5ba8412f18 added template settings file 2023-12-17 21:24:20 -05:00
Yuriy
7fd46a9913 added template settings.ini 2023-12-17 15:34:42 -05:00
9 changed files with 37 additions and 14373 deletions

1
.gitignore vendored
View File

@@ -27,3 +27,4 @@ Compile Scripts to EXE.ahk
Freedomain Video Uploader.exe Freedomain Video Uploader.exe
Lib/LBRY Process Killer.exe Lib/LBRY Process Killer.exe
Lib/chrome-win64 Lib/chrome-win64
Lib/Version.ini

View File

@@ -14,29 +14,24 @@ CoordMode, Mouse, Screen
;---Notes/Extra Info/#Includes------------------------------------------------------ ;---Notes/Extra Info/#Includes------------------------------------------------------
; msgbox
;---VARIABLES----------------------------------------------------------------------- ;---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--------------------------------------------------------------------- ;---MAIN SCRIPT---------------------------------------------------------------------
AHKFilepath = %A_ScriptDir%\Freedomain Social Media Poster.ahk AHKFilepath = %A_ScriptDir%\Freedomain Social Media Poster.ahk
Exefilepath = %A_ScriptDir%\Freedomain Social Media Poster.exe Exefilepath = %A_ScriptDir%\Freedomain Social Media Poster.exe
icopath = %A_ScriptDir%\Assets\FreedomainSMP.ico 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 ; Kill any active intances of the uploaders so the .exe file can be overwriten by the compilation
process, close, Freedomain Social Media Poster.exe 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%"" run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
; OldNotify(ScriptToCompile,"Compiled Successfully",5)
; sleep, 5000
ExitApp ExitApp

View File

@@ -39,11 +39,9 @@ global UpdateVersionNumber
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\JSON.ahk #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\RunCMD.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Zip.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.88
FullScriptName := ScriptName . " " . ScriptVersion
;---ToDo--- ;---ToDo---
;------------------------------------------------ ;------------------------------------------------
@@ -122,6 +120,14 @@ ChangelogIniFilepath := A_ScriptDir . "\Lib\FreedomScriptsChangelogINI"
global ScriptSettingsSection global ScriptSettingsSection
ScriptSettingsSection := "SocialMediaPoster" 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--- ;---General Info---
;------------------------------------------------ ;------------------------------------------------
IniRead, TestingMode, %SettingsIniFilepath%, General, TestingMode, 0 IniRead, TestingMode, %SettingsIniFilepath%, General, TestingMode, 0
@@ -130,7 +136,7 @@ IniRead, TelegramBotToken, %SettingsIniFilepath%, SocialMediaPoster, TelegramBot
IniRead, TelegramBotChatID, %SettingsIniFilepath%, SocialMediaPoster, TelegramBotChatID, %A_Space% IniRead, TelegramBotChatID, %SettingsIniFilepath%, SocialMediaPoster, TelegramBotChatID, %A_Space%
IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, SocialMediaPoster, DiscordErrorLoggingWebhookBotURL, %A_Space% IniRead, DiscordErrorLoggingWebhookBotURL, %SettingsIniFilepath%, SocialMediaPoster, DiscordErrorLoggingWebhookBotURL, %A_Space%
IniRead, DiscordParlerWebhookURL, %SettingsIniFilepath%, SocialMediaPoster, DiscordParlerWebhookURL, %A_Space% IniRead, DiscordParlerWebhookURL, %SettingsIniFilepath%, SocialMediaPoster, DiscordParlerWebhookURL, %A_Space%
; IniRead, ChromeFilepath, %SettingsIniFilepath%, SocialMediaPoster, ChromeFilepath, %A_Space% IniRead, ChromeFilepath, %SettingsIniFilepath%, SocialMediaPoster, ChromeFilepath, %A_Space%
@@ -266,7 +272,7 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
VideoURL := BitChuteURL VideoURL := BitChuteURL
if(PodcastNumber != ""){ if(PodcastNumber != ""){
PodcastURL := "https://fdrpodcasts.com/" . PodcastNumber . "`n" PodcastURL := "https://fdrpodcasts.com/" . PodcastNumber . "`n`n"
} }
; Append bitchute url to bottom of description ; Append bitchute url to bottom of description
@@ -300,7 +306,7 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){
(Telegram != "")?(TelegramCheckStatus := 0) : (TelegramCheckStatus := 1) (Telegram != "")?(TelegramCheckStatus := 0) : (TelegramCheckStatus := 1)
(Minds != "")?(MindsCheckStatus := 0) : (MindsCheckStatus := 1) (Minds != "")?(MindsCheckStatus := 0) : (MindsCheckStatus := 1)
(Gab != "")?(GabCheckStatus := 0) : (GabCheckStatus := 1) (Gab != "")?(GabCheckStatus := 0) : (GabCheckStatus := 1)
(MeWe != "")?(MeWeCheckStatus := 0) : (MeWeCheckStatus := 0) ; UNCHECKED ALWAYS as of 2022/04/08 (MeWe != "")?(MeWeCheckStatus := 0) : (MeWeCheckStatus := 1)
(Gettr != "")?(GettrCheckStatus := 0) : (GettrCheckStatus := 0) (Gettr != "")?(GettrCheckStatus := 0) : (GettrCheckStatus := 0)
(Steemit != "")?(SteemitCheckStatus := 0) : (SteemitCheckStatus := 1) (Steemit != "")?(SteemitCheckStatus := 0) : (SteemitCheckStatus := 1)
(Locals != "")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 1) (Locals != "")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 1)

File diff suppressed because one or more lines are too long

View File

@@ -148,47 +148,17 @@ if(Status = ""){
DevModeMsgBox(Tag) DevModeMsgBox(Tag)
; Tag = %Tag% ; Tag = %Tag%
Xpath = //input[@placeholder='Categories and tags'] Xpath = //input[@placeholder='Categories and tags']
driver.FindElementByXPath(Xpath).SendKeys(Tag) try driver.FindElementByXPath(Xpath).SendKeys(Tag)
driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER) catch e {
Message = Failed to input tag: %tag%
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
}
; driver.findElementsByClass("sminput").item[2].click() try driver.FindElementByXPath(Xpath).SendKeys(driver.Keys.ENTER)
; 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)
if(A_index = 5) if(A_index = 5)
Break 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") SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")

View File

@@ -2,18 +2,21 @@
; -------------------------------Locals------------------------------- ; -------------------------------Locals-------------------------------
PostToLocals: PostToLocals:
CurrentSite := "Locals" CurrentSite := "Locals"
; DevModeMsgBox("clik ok to continue")
; @todo: Add auto-login to locals ; @todo: Add auto-login to locals
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space% IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space%
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 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") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
Return Return
} }
; /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) Status := NavigateFromBaseURLTo(LocalsURL)
if(Status = "Failed") if(Status = "Failed")

BIN
Settings.ini Normal file

Binary file not shown.

2
Version.ini Normal file
View File

@@ -0,0 +1,2 @@
[Social-Media-Poster]
Version=2.90