You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
social-media-poster/Freedomain Social Media Pos...

1199 lines
40 KiB
Plaintext

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
#SingleInstance, Force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
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
}
ErrorLoggingDirectory = %1%
; Add menus to the toolbar icon
Menu, tray, NoStandard ; remove standard tray
Menu, Tray, Add, Exit, KillScript
Menu, Tray, Add, Pause, PauseScript
Menu, Tray, Add, Start New Post, ReloadScript
Menu, Tray, Add, Reload wLast Post, LoadLastPost
Menu, Tray, Default, Reload wLast Post
global ScriptName
global ScriptVersion
global FullScriptName
global UpdateAvailable
global UpdateVersionNumber
;---Notes/Extra Info/#Includes------------------------------------------------------
#include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\StdOutToVar.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\General-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Selenium-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Chrome-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\Gitea-Functions.ahk
#Include %A_ScriptDir%\Lib\Freedomain-Posters-Shared-Functions\API-Functions.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\Zip.ahk
ScriptName = Freedomain Social Media Poster
ScriptVersion = 2.87
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
; 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---
;------------------------------------------------
global Driver
global DriverStatus
global CurrentSite
global DiscordParlerWebhookURL
global DiscordErrorLoggingWebhookBotURL
global TooltipXPosition
global ShowTooltipProgress
global ErrorLoggingDirectory
global ErrorLoggingFilePath
global StatusFileFilePath
global PostTitleFilePath
global PostBodyFilePath
global ErrorLogVar
global PostTitle
global PostBody
global PostTitleAndBody
global PostTags
global ImageAttachmentFilepath
global ReuseTabs
global WindowTitle ; Tab title of already existing window of each site
global PauseBetweenPosts ; pause for a couple of seconds between posts so user has a chance to visually see confirmation
global PauseTimeBetweenPosts
global TimeBetweenpostsInMiliseconds
global DevMode
global ScriptRunTime
global URLOfLastErrorPage
; Website Post Statuses
global Discord
global SubScribeStar
global Telegram
global Minds
global Gab
global Locals
global LinkedIn
global MeWe
global Twetch
; global ThinkSpot
; global Flote
global PocketNet
; global parler
global Gettr
global steemit
; global Pintrest
; global Tumblr
; Check if Lib folder exists and create it if not
LibFolder := A_ScriptDir . "\Lib"
ErrorLoggingFolder := A_ScriptDir . "\Lib\ErrorLogging"
FileCreateDir, %ErrorLoggingFolder%
; Set filepaths for different files and folders
global SettingsIniFilepath
SettingsIniFilepath := A_ScriptDir . "\Settings.ini"
global ChangelogIniFilepath
ChangelogIniFilepath := A_ScriptDir . "\Lib\FreedomScriptsChangelogINI"
global ScriptSettingsSection
ScriptSettingsSection := "SocialMediaPoster"
;---General Info---
;------------------------------------------------
IniRead, TestingMode, %SettingsIniFilepath%, General, TestingMode, 0
IniRead, DevMode, %SettingsIniFilepath%, General, DevMode, 0
IniRead, TelegramBotToken, %SettingsIniFilepath%, SocialMediaPoster, TelegramBotToken, %A_Space%
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%
;---Checkbox Settings---
;------------------------------------------------
IniRead, BoldTitleWAPI, %SettingsIniFilepath%, SocialMediaPoster, BoldTitleWAPI, 1
(BoldTitleWAPI)?(BoldTitleCheckStatus := 1) : (BoldTitleCheckStatus := 0)
IniRead, NewLineBetweenTitle, %SettingsIniFilepath%, SocialMediaPoster, NewLineBetweenTitle, 1
(NewLineBetweenTitle)?(SpaceBetweenTitleBodyCheckStatus := 1) : (SpaceBetweenTitleBodyCheckStatus := 0)
IniRead, ShowTooltipProgress, %SettingsIniFilepath%, SocialMediaPoster, ShowTooltipProgress, 1
(ShowTooltipProgress)?(ShowTooltipProgressCheckStatus := 1) : (ShowTooltipProgressCheckStatus := 0)
IniRead, ReuseTabs, %SettingsIniFilepath%, SocialMediaPoster, ReuseTabs, 1
(ReuseTabs)?(ReuseTabsCheckStatus := 1) : (ReuseTabsCheckStatus := 0)
IniRead, AutoUpdateCheck, %SettingsIniFilepath%, SocialMediaPoster, AutoUpdateCheck, 1
(AutoUpdateCheck)?(AutoUpdateCheckCheckStatus := 1) : (AutoUpdateCheckCheckStatus := 0)
IniRead, SaveTagsBetweenPosts, %SettingsIniFilepath%, SocialMediaPoster, SaveTagsBetweenPosts, 1
(SaveTagsBetweenPosts)?(SaveTagsBetweenPostsCheckStatus := 1) : (SaveTagsBetweenPostsCheckStatus := 0)
if(SaveTagsBetweenPosts)
IniRead, PostTags, %SettingsIniFilepath%, SocialMediaPoster, PostTags, %A_Space%
IniRead, PauseBetweenPosts, %SettingsIniFilepath%, SocialMediaPoster, PauseBetweenPosts, 0
(PauseBetweenPosts)?(PauseBetweenPostsCheckCheckStatus := 1) : (PauseBetweenPostsCheckCheckStatus := 0)
if(PauseBetweenPosts){
IniRead, PauseTimeBetweenPosts, %SettingsIniFilepath%, SocialMediaPoster, PauseTimeBetweenPosts, 3
TimeBetweenpostsInMiliseconds := PauseTimeBetweenPosts * 1000
}
; IniRead, UpdateAvailable, %SettingsIniFilepath%, %ScriptSettingsSection%, UpdateAvailable, %A_Space%
IniRead, TotalPostsPosted, %SettingsIniFilepath%, %ScriptSettingsSection%, TotalPostsPosted,0
IniRead, TotalRunTime, %SettingsIniFilepath%, %ScriptSettingsSection%, TotalRunTime, 0
;---Auto Updater Settings---
;------------------------------------------------
global GitReleasesAPIURL
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
ProgramExeFilepath := A_ScriptFullPath
ProgramExeFilepath := StrReplace(ProgramExeFilepath, ".ahk", ".exe")
IniWrite, %ProgramExeFilepath%, %SettingsIniFilepath%, %ScriptSettingsSection%, Filepath
IniWrite, %ScriptVersion%, %SettingsIniFilepath%, %ScriptSettingsSection%, ScriptVersion
;------Run Actions on Passed in Arguments-------
;------------------------------------------------
if(ErrorLoggingDirectory = "LastPost"){
IniRead, ErrorLoggingDirectory, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space%
}
; if passed argument is .exe file, then script has just been udpated and we need to move the old version
if(InStr(ErrorLoggingDirectory,ScriptName) and InStr(ErrorLoggingDirectory,".exe")){
; create backups folder if it doesn't exist
BackupsFolder = %LibFolder%\Backups\
; Msgbox % "BackupsFolder: " BackupsFolder
if(!FileExist(BackupsFolder)){
FileCreateDir, %BackupsFolder%
}
; move old version to backups folder, overwrite if name conflict
FileMove, %ErrorLoggingDirectory%, %BackupsFolder%\*, 1
if(ErrorLevel){ ; most likely because the old version hasn't finished exiting yet
SaveOrPostProgress(Message:="Starting Up: Moving Old Version",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
sleep, 2000
FileMove, %ErrorLoggingDirectory%, %BackupsFolder%\*, 1
if(ErrorLevel){
MsgBox,,Update Successful, Update was successful`, but unable to move old version to the Backups folder.`nPlease move it or delete it manually.
}
ToolTip
}
}
; 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
if(InStr(ErrorLoggingDirectory, "VideoLinks.ini")){ ;PASSED IN FROM VIDEO UPLOADER
VideoLinksFilepath = %ErrorLoggingDirectory%
SplitPath, VideoLinksFilepath, OutFileName, VideoLinksDir, OutExtension, OutNameNoExt, OutDrive
PostTitleFilepath := VideoLinksDir . "\title.txt"
FileRead, PostTitle, %PostTitleFilepath%
; Msgbox % "PostTitle: " PostTitle
; Read the post body from the text file adn then
; SPlit it and remove the repeating text bit at the bottom
PostBodyFilepath := VideoLinksDir . "\body.txt"
FileRead, Postbody, %PostBodyFilepath%
SplitText = Free Documentaries:
Postbody := StrSplit(Postbody, SplitText)
Postbody := Postbody[1]
; Read post tags from text file
PostTagsFilepath := VideoLinksDir . "\keywords.txt"
FileRead, PostTags, %PostTagsFilepath%
; Msgbox % "PostTags: " PostTags
; Read thumbnail filepath from video links file
IniRead, ImageAttachmentFilepath, %ErrorLoggingDirectory%,Misc, VideoThumbFilepath, %A_Space%
; Read video links from video links file
IniRead, BitChuteURL, %ErrorLoggingDirectory%,URLs, BitChuteURL, %A_Space%
IniRead, RumbleURL, %ErrorLoggingDirectory%,URLs, RumbleURL, %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 := BrighteonURL
}
else,
VideoURL := BitChuteURL
if(PodcastNumber != ""){
PodcastURL := "https://fdrpodcasts.com/" . PodcastNumber . "`n"
}
; Append bitchute url to bottom of description
PostBody := PostBody . "`n`n" . PodcastURL . VideoURL
; Msgbox % "PostTitle: " PostTitle
; Msgbox % "PostBody: " PostBody
Discord := 0
Telegram := 0
}
else, { ; otherwise passed in from a previous run.
StatusFileFilePath := ErrorLoggingDirectory . "\" . "PostStatus.ini"
ErrorLoggingFilePath := ErrorLoggingDirectory . "\" . "ErrorLogging.txt"
FileRead, PostTitle, %ErrorLoggingDirectory%\PostTitle.txt
FileRead, PostBody, %ErrorLoggingDirectory%\PostBody.txt
IniRead, PostTags, %StatusFileFilePath%, General, PostTags, %A_Space%
IniRead, ImageAttachmentFilepath, %StatusFileFilePath%, General, ImageAttachmentFilepath, %A_Space%
ReadWebsiteStatuses() ; Read .ini file of post statuses for each site
}
; Tooltip
}
; Set checked status for each checkbox depending on each website's status
(Discord != "")?(DiscordCheckStatus := 0) : (DiscordCheckStatus := 1 )
(SubScribeStar != "")?(SubScribeStarCheckStatus := 0) : (SubScribeStarCheckStatus := 1)
(Telegram != "")?(TelegramCheckStatus := 0) : (TelegramCheckStatus := 1)
(Minds != "")?(MindsCheckStatus := 0) : (MindsCheckStatus := 1)
(Gab != "")?(GabCheckStatus := 0) : (GabCheckStatus := 1)
(MeWe != "")?(MeWeCheckStatus := 0) : (MeWeCheckStatus := 0) ; UNCHECKED ALWAYS as of 2022/04/08
(Gettr != "")?(GettrCheckStatus := 0) : (GettrCheckStatus := 0)
(Steemit != "")?(SteemitCheckStatus := 0) : (SteemitCheckStatus := 1)
(Locals != "")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 1)
(LinkedIN != "")?(LinkedINCheckStatus := 0) : (LinkedINCheckStatus := 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)
(PocketNet != "")?(PocketNetCheckStatus := 0) : (PocketNetCheckStatus := 1)
; (Tumblr != "")?(TumblrCheckStatus := 0) : (TumblrCheckStatus := 1)
if(TestingMode){ ; Easy testing for Yuriy
DiscordCheckStatus := 0
TelegramCheckStatus := 0
SubScribeStarCheckStatus := 0
MindsCheckStatus := 0
LocalsCheckStatus := 0
GettrCheckStatus := 0
SteemitCheckStatus := 0
GabCheckStatus := 0
LinkedINCheckStatus := 0
MeWeCheckStatus := 0
TwetchCheckStatus := 0
; ThinkSpotCheckStatus := 0
PocketNetCheckStatus := 0
}
;---GUI Variables---
;------------------------------------------------
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
EditBoxWidth := 700
EditBoxHalfWidths := EditBoxWidth / 2 - (MarginSpace * 1.7)
EditBoxThirdsWidth := EditBoxWidth / 3 - (MarginSpace * 1.5)
GroupBox_PlatformsWidth := 180
ImageSelectionButtonWidth := 100
ImageFilepathEditBoxWidth := EditBoxWidth - ImageSelectionButtonWidth - MarginSpace
SelectFileButtonWidth := 50
SelectFileButtonXPos := EditBoxWidth - SelectFileButtonWidth - MarginSpace
CharCountXPos := EditBoxWidth - 20
; FilePathEditBoxWidth := EditBoxWidth - SelectFileButtonWidth - MarginSpace
PlatformsGroupBoxXLocation := EditBoxWidth + (MarginSpace * 3)
; SettingsGroupBoxXLocation := PlatformsGroupBoxXLocation + ActionButtonWidths
SettingsGroupBoxXLocation := PlatformsGroupBoxXLocation + GroupBox_PlatformsWidth
ActionButtonWidths := 355
ActionButtonHalfWidths := (ActionButtonWidths / 2) - (MarginSpace / 2)
Gui, Margin, %MarginSpace%, %MarginSpace%
GUINormalFontSize := 15
Gui, Font, s10
; Gui, Font, s8
if(TestingMode){
Gui, Add, Text,cRed yp+0 x%MarginSpace% ,TESTING MODE
}
if(DevMode){
Gui, Add, Text,cRed yp+0 x+30 ,DEV MODE
}
Gui, Font, s%GUINormalFontSize%
Gui, Font, Bold
Gui, Add, Text, x%Marginspace% y+5 w%EditBoxWidth%, 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, s%GUINormalFontSize%
Gui, Add, Edit, x%MarginSpace% y+3 w%EditBoxWidth% vPostTitle gUpdateCharCount h75, %PostTitle%
Gui, Font, Bold
Gui, Add, Text,w%EditBoxWidth%, Post Body
Gui, Font, Normal
Gui, Font, s%GUINormalFontSize%
Gui, Add, Edit, x%MarginSpace% y+2 w%EditBoxWidth% h150 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, Font, s7
Gui, Font, Normal
Gui, Add, Text, x65 yp+7, (Required by Steemit, Bastyon, )
; Gui, font, color, cRed
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, Font, s%GUINormalFontSize%
Gui, Font, Bold
Gui, Add, Text,x%marginspace% w%EditBoxWidth%, Image Attachment Filepath
Gui, Font, Normal
Gui, Add, Edit, x%MarginSpace% 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, 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
if(UpdateAvailable)
Gui, Add, Button, x%MarginSpaceDoubled% y+%MarginSpace% 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
if(ChromeUpdateAvailable)
Gui, Add, Button,x+%MarginSpace% 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
if(DevMode){
Gui, Add, Button, x%MarginSpace% y+10 w%EditBoxThirdsWidth% h30 gOpenErrorLog, OpenErrorLog
}
Gui, Font, Normal
gui, Font, s5
; Miscellaneous Settings
DevModToggleButton := PlatformsGroupBoxXLocation + 80
Gui, Add, Button, x%DevModToggleButton% y5 w50 h10 gToggleDevMode, DevMode
Gui, Add, Button, x+5 yp+0 w50 h10 gToggleTestingMode, Testing Mode
Gui, Add, Button, x+5 yp+0 w50 h10 gToggleManualSubmit, Man. Submit
Gui, Add, Button, x+5 yp+0 w50 h10 gOpenGiteaPage, Gitea
Gui, Font, Bold
Gui, Font, s%GUINormalFontSize%
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,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, 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, Normal
Gui, Add, Checkbox, xp+10 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
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-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 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
; 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, 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
; Gui, Font, s%GUINormalFontSize%g
gui, font, s6
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%
ControlFocus, Edit1, %FullScriptName%
; check for updates if the setting is enabled
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!
ChromeUpdateAvailable := 1
}
}
;---Check for Update---
;------------------------------------------------
Return
;---Misc GoSubs---
;------------------------------------------------
SaveAsTemplate:
TemplateDirectory = %A_ScriptDir%\Lib\Templates
if(!FileExist(TemplateDirectory)){
FileCreateDir, %TemplateDirectory%
}
InputBox, TemplateName, Input Name, Please Input Name for the Template:
if(ErrorLevel)
Return
TemplateDirectory = %A_ScriptDir%\Lib\Templates\%TemplateName%
CreateErrorLoggingFiles(TemplateDirectory)
FileAppend, %PostTitle%, %PostTitleFilePath% ; save post content to txt file
FileAppend, %PostBody%, %PostBodyFilePath% ; save post content to txt file
IniWrite, %ImageAttachmentFilepath%, %StatusFileFilePath%, General, ImageAttachmentFilepath
IniWrite, %PostTags%, %StatusFileFilePath%, General, PostTags
Return
LoadTemplate:
Message = Loading Template
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,DiscordErrorLogging")
ErrorLoggingDirectory = %A_ScriptDir%\Lib\Templates\
FileSelectFolder, ErrorLoggingDirectory, %ErrorLoggingDirectory%
if(ErrorLevel){
Tooltip
Return
}
run, "%A_ScriptFullPath%" "%ErrorLoggingDirectory%"
ExitApp
ReloadScript:
Reload
Return
KillScript:
ExitApp
Return
PauseScript:
Pause, Toggle
Return
LoadLastPost:
; IniWrite, %ErrorLoggingDirectory%, %SettingsIniFilepath%, SocialMediaPoster, LastPost
; IniRead, ErrorLoggingDirectory, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost, %A_Space%
; Msgbox % "SettingsIniFilepath: " SettingsIniFilepath
; Msgbox % "ErrorLoggingDirectory: " ErrorLoggingDirectory
; msgbox, 4096, Sorry, Sorry this doesn't do anything yet.
run, "%A_ScriptFullPath%" "LastPost"
ExitApp
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, {
}
}
Status := DownloadLatestChromium()
if(Status)
GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat
Return
/*
*/
CancelPost:
GuiClose:
; ExitApp
Gui, Submit,
Return
OpenErrorLog:
run, %ErrorLoggingDirectory%
Return
ToggleTestingMode:
ToggleTestingMode()
run, %A_ScriptFullPath% "LastPost"
Return
ToggleManualSubmit:
ToggleManualSubmit()
run, %A_ScriptFullPath% "LastPost"
Return
ToggleDevMode:
ToggleDevMode()
run, "%A_ScriptFullPath%" "LastPost"
Return
OpenGiteaPage:
run, https://freedomain.dev/yuriy/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
UpdateVars:
Gui, Submit, NoHide
Return
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
SchedulePost:
ScheduledPost := 1
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, Font, s8
Gui, Add, Checkbox, vDisplayCountdownTooltip gUpdateVars checked, Display Tooltip with Countdown
Gui, Font, s20
Gui, Add, Button,gPostPost w350, Schedule Post Time
gui, show, w370
Return
PostPost:
Gui, Submit
; Msgbox % "PostTags: " PostTags
if(InStr(PostTags, "http")){
Message = Post Tags contain "http". Please edit and remove the url and try again.
Msgbox, 4096, Error, %Message%
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar")
Return
}
Gui, Destroy
; 20211023061711
ScheduledTime := SubStr(ScheduledTime, 1, 12) ; pull out time date up to the minute and exclude seconds
; Msgbox % "ScheduledTime: " ScheduledTime
; clipboard := ScheduledTime
; Msgbox % "ScheduledTime: " ScheduledTime
; DevModeMsgBox("stop")
; if argument is passed to the script we want to do the following:
; If the argument is a template post, we want to create a new ErrorLogging directory for it
; 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()
} ;
IniWrite, %BoldTitleWAPI%, %SettingsIniFilepath%, SocialMediaPoster, BoldTitleWAPI
IniWrite, %NewLineBetweenTitle%, %SettingsIniFilepath%, SocialMediaPoster, NewLineBetweenTitle
IniWrite, %ReuseTabs%, %SettingsIniFilepath%, SocialMediaPoster, ReuseTabs
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowTooltipProgress
IniWrite, %AutoUpdateCheck%, %SettingsIniFilepath%, SocialMediaPoster, AutoUpdateCheck
IniWrite, %SaveTagsBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, SaveTagsBetweenPosts
IniWrite, %PauseBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, PauseBetweenPosts
IniWrite, %ErrorLoggingDirectory%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost
; Combines two variables together so they can be used as needed later
if(NewLineBetweenTitle)
PostTitleAndBody := PostTitle . "`n`n" . PostBody
else,
PostTitleAndBody := PostTitle . "`n" . PostBody
if(PostBody = ""){
PostTitleAndBody := PostTitle
}
if(PostTitle = ""){
PostTitleAndBody := PostBody
}
; Format text to javascript
JSPostTitleAndBody := FormatTextToJSText(PostTitleAndBody)
JSPostTitle := FormatTextToJSText(PostTitle)
JSPostBody := FormatTextToJSText(PostBody)
FileAppend, %PostTitle%, %PostTitleFilePath% ; save post content to txt file
FileAppend, %PostBody%, %PostBodyFilePath% ; save post content to txt file
IniWrite, %ImageAttachmentFilepath%, %StatusFileFilePath%, General, ImageAttachmentFilepath
IniWrite, %PostTags%, %StatusFileFilePath%, General, PostTags
IniWrite, %PostTags%, %SettingsIniFilepath%, SocialMediaPoster, PostTags
IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowTooltipProgress
; TimeBetweenPosts := 5000 ; 5 seconds
; TimeBetweenpostsInSeconds := round(TimeBetweenPosts/1000)
; Msgbox % "TimeBetweenpostsInSeconds: " TimeBetweenpostsInSeconds
; Create a list of websites that are going to get psoted to for error logging purposes
(Discord = 1)?(PostedWebsites .= "Discord|") : ()
(Telegram = 1)?(PostedWebsites .= "Telegram|") : ()
(SubScribeStar = 1)?(PostedWebsites .= "SubScribeStar|") : ()
(Minds = 1)?(PostedWebsites .= "Minds|") : ()
(Gab = 1)?(PostedWebsites .= "Gab|") : ()
(MeWe = 1)?(PostedWebsites .= "MeWe|") : ()
(Locals = 1)?(PostedWebsites .= "Locals|") : ()
(LinkedIn = 1)?(PostedWebsites .= "LinkedIn|") : ()
(Twetch = 1)?(PostedWebsites .= "Twetch|") : ()
; (ThinkSpot = 0)?(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
Loop, {
FormatTime, CurrentTime, YYYYMMDDHH24MISS, yyyyMMddhhmm
; FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
EnvSub, CurrentTime, ScheduledTime, Minutes
TimeLeft := StrReplace(CurrentTime, "-", "")
if(TimeLeft = 0)
break
if(DisplayCountdownTooltip){
Message = Minutes Until SMP: %TimeLeft%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
}
sleep, 15000 ; 15 seconds
}
}
StartTime := A_TickCount
if(Discord)
Gosub, PostToDiscord
if(Telegram)
Gosub, PostToTelegram
if(SubscribeStar)
Gosub, PostToSubscribeStar
if(Minds)
Gosub, PostToMinds
if(Gab)
Gosub, PostToGab
if(LinkedIN)
Gosub, PostToLinkedIN
if(MeWe)
Gosub, PostToMeWe
if(Twetch)
Gosub, PostToTwetch
; if(Thinkspot)
; Gosub, PostToThinkSpot
if(Locals)
Gosub, PostToLocals
if(Steemit)
Gosub, PostToSteemit
if(Pocketnet)
Gosub, PostToPocketNet
if(Gettr)
Gosub, PostToGettr
CurrentSite :=
Message = Social Media Posting Complete
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
ScriptRunTime := round(((A_TickCount - StartTime) / 1000), 2)
; DevModeMsgBox(URLOfLastErrorPage)
if(URLOfLastErrorPage != ""){
Message = Activating Tab of last failed post.
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
; DevModeMsgBox("pause")
; message = URLOfLastErrorPage: %URLOfLastErrorPage%
; DevModeMsgBox(URLOfLastErrorPage)
; FindAndActivateTab(URLOfLastErrorPage)
}
ReadWebsiteStatuses() ; Read .ini file of post statuses for each site
; Gui,Destroy
ToolTip
WebsiteButtonWidths = 115
WebsiteStatusEditWidths = 150
StatusTextWidth := (WebsiteButtonWidths + WebsiteStatusEditWidths) * 2
StatusTextSecondRowXPos := WebsiteStatusEditWidths + WebsiteButtonWidths + (MarginSpace * 4)
ErrorSummaryLogXPos := StatusTextSecondRowXPos + WebsiteStatusEditWidths + WebsiteButtonWidths + (MarginSpace * 2)
ErrorSummaryLogSplitLineXPos := ErrorSummaryLogXPos - (MarginSpace)
ErrorLogSummaryWidth := 385
ErrorLogSummaryHeight := 480
ButtonHeights := 30
Gui, Font, s%GUINormalFontSize%
Gui, Font, Bold
Gui, Add, Text,w%StatusTextWidth% y%MarginSpace% Center, Status
Gui, Add, Button,x%MarginSpace% 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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Telegram%
gui, font, s8
Gui, Add, Button,x%MarginSpace% 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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Minds%
Gui, Add, Button,x%MarginSpace% 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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Locals%
Gui, Add, Button,x%MarginSpace% 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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %Twetch%
Gui, Add, Button,x%MarginSpace% 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, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %MeWe%
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, 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%
; 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%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%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% 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
Gui, Add, Edit, x+5 w%WebsiteStatusEditWidths% h%ButtonHeights%, %PocketNet%
*/
Gui, Font, s%GUINormalFontSize%
Gui, Font, Bold
; gui, add, text, x%ErrorSummaryLogSplitLineXPos% y20 h200 0x11 ; 0x11 is a "line" ; refer to here: https://autohotkey.com/board/topic/50910-draw-line-gui/
Gui, Add, Text, x%ErrorSummaryLogXPos% y%MarginSpace% 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, Font, s%GUINormalFontSize%
gui, font, s6
Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Run Time: %ScriptRunTime% Seconds
Gui, Show,, %FullScriptName% - Post Results
SaveCurrentChromeVersionToIniFile()
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
Clipboard := ErrorLoggingFilePath
msgbox,,Copied to Clipboard, The Filepath for the errorlogging file was copied to your clipboard:`n`n%ErrorLoggingFilePath%
Return
SaveDriverTitle(){
Message := "Driver.Title: " . driver.title
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
}
CopyPostToClipboard:
clipboard := PostTitleAndBody
Message = Post Title and Body Copied to Clipboard
; ToolTip, Post Title and Body Copied to Clipboard, 850, 0
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
sleep, 2000
Tooltip
Return
CopyImageFilepathToClipboard:
clipboard := ImageAttachmentFilepath
Message = Image Filepath Copied to Clipboard
; ToolTip, Post Title and Body Copied to Clipboard, 850, 0
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
sleep, 2000
Tooltip
Return
; Discord
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Discord.ahk
; Telegram
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Telegram.ahk
; Subscribestar
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Subscribestar.ahk
; LinkedIn
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-LinkedIn.ahk
; Minds
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Minds.ahk
; Locals
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Locals.ahk
; Bastyon
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Bastyon.ahk
; Steemit
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Steemit.ahk
; Gab
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Gab.ahk
; Gettr
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Gettr.ahk
; MeWe
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-MeWe.ahk
; Twetch
;------------------------------------------------
#include %A_ScriptDir%\Modules\Post-To-Twetch.ahk
; Thinkspot
;------------------------------------------------
; #include %A_ScriptDir%\Modules\Post-To-Thinkspot.ahk
; Misc Functions
;------------------------------------------------
#include %A_ScriptDir%\Modules\Miscellaneous-Functions.ahk