Compare commits
6 Commits
1.0
...
c18e9897ee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c18e9897ee | ||
|
|
075859934a | ||
|
|
88b4b2c119 | ||
|
|
e32fe026e9 | ||
| 981051a9e8 | |||
|
|
f15d3ed2f0 |
@@ -1,10 +1,13 @@
|
||||
;---FUNCTIONS-----------------------------------------------------------------------
|
||||
; Misc Functions that are called by both the Video and Social Media poster
|
||||
|
||||
|
||||
|
||||
; -------------------------------Discord-------------------------------
|
||||
PostToDiscordChannel(Message,WebhookChannel){
|
||||
|
||||
; Don't try to post a message if there is no webhook url
|
||||
if(WebhookChannel = "")
|
||||
Return
|
||||
|
||||
; Msgbox % "Message: " Message
|
||||
; Msgbox % "WebhookChannel: " WebhookChannel
|
||||
|
||||
@@ -28,8 +31,6 @@ PostToDiscordChannel(Message,WebhookChannel){
|
||||
}
|
||||
)
|
||||
|
||||
; Msgbox % "JsonString: " JsonString
|
||||
;
|
||||
try WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
|
||||
try WebRequest.Open("POST", WebhookChannel, false)
|
||||
try WebRequest.SetRequestHeader("Content-Type", "application/json")
|
||||
@@ -50,14 +51,14 @@ TelegramMsgBox(Text:="", TelegramBotToken := "", TelegramBotChatID :=""){
|
||||
|
||||
|
||||
; Replace all forbidden characters - https://www.ascii-code.com/
|
||||
; Text := StrReplace(Text, "`%", "%25") ; percent with
|
||||
|
||||
Text := StrReplace(Text, "`n", "%0A") ; New Line
|
||||
; Text := StrReplace(Text, "`n", "%0A") ; New Line
|
||||
|
||||
; Text := StrReplace(Text, " ", "%23") ; New Line
|
||||
; Text :=
|
||||
; Text := StrReplace(Text, "`n", "%0A") ; New Line
|
||||
|
||||
; Text := StrReplace(Text, "`%", "%25") ; percent with
|
||||
; Msgbox % "Text: " Text
|
||||
|
||||
ErrorLoggingPath = %A_ScriptDir%\Lib\ErrorLogging\check.rups
|
||||
@@ -93,6 +94,7 @@ TelegramMsgBox(Text:="", TelegramBotToken := "", TelegramBotChatID :=""){
|
||||
; -------------------------------/TelegramAPI-------------------------------
|
||||
|
||||
; Telegram Message API
|
||||
; https://core.telegram.org/bots/api
|
||||
;------------------------------------------------
|
||||
SendTelegramMessage(token, chatID, text := "", ParseMode := "MarkdownV2") ; you could add more options; compare the Telegram API docs
|
||||
{
|
||||
@@ -142,6 +144,7 @@ pre-formatted fixed-width code block written in the Python programming language
|
||||
|
||||
; -------------------------------Telegram Image Sending-------------------------------
|
||||
; https://www.autohotkey.com/boards/viewtopic.php?t=68417
|
||||
; https://core.telegram.org/bots/api
|
||||
SendTelegramPhoto(token, chatID, file, caption := "", ParseMode := "MarkdownV2") ; you could add more options; compare the Telegram API docs
|
||||
{
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ DownloadLatestChromium(){
|
||||
ChromeExtractedDirectory = %A_ScriptDir%\Lib\chrome-win64
|
||||
|
||||
ChromeDriverMoverEXEFilepath = %A_ScriptDir%\Lib\Chromedriver-Mover.exe
|
||||
ChromeDriverMoverURL = https://git.freedomainplaylists.com/yuriy/Chromedriver-Mover/releases/download/1.1/Chromedriver-Mover.exe
|
||||
ChromeDriverMoverURL = https://freedomain.dev/attachments/b7b608b6-379a-42bb-a7c4-23fd67a05bb3
|
||||
|
||||
ChromeDriverProgramFilesExeFilepath = C:\Program Files\SeleniumBasic\chromedriver.exe
|
||||
|
||||
|
||||
@@ -35,10 +35,9 @@ SaveOrPostProgress(Message:="",PostType:=""){
|
||||
if(InStr(PostType, "Tooltip")){
|
||||
TooltipThis(Message)
|
||||
}
|
||||
/* if(InStr(PostType, "ErrorLoggingTextFile")){
|
||||
if(InStr(PostType, "ErrorLoggingTextFile")){
|
||||
Func_LogErrorsToTextFile(Message)
|
||||
}
|
||||
*/
|
||||
if(InStr(PostType, "ErrorSummaryVar")){
|
||||
Func_LogErrorsToVar(Message)
|
||||
}
|
||||
@@ -103,6 +102,11 @@ TimedToolTip(Text, x="", y="",RemoveAfterTime:=2000, SetWhichToolTip="") {
|
||||
|
||||
; -------------------------------LogErrorsToTextFile-------------------------------
|
||||
Func_LogErrorsToTextFile(Text){
|
||||
|
||||
; Do not log if we do not have an errorlog filepath
|
||||
if(ErrorLoggingFilePath = "")
|
||||
return
|
||||
|
||||
; ErrorLoggingFile := Filepath
|
||||
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
||||
text =
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Function Libraries used in the following Projects:
|
||||
- [Freedomain Social Media Poster](https://git.freedomainplaylists.com/yuriy/Freedomain-Social-Media-Poster)
|
||||
- [Freedomain Video Uploader](https://git.freedomainplaylists.com/yuriy/Freedomain-Video-Uploader)
|
||||
- [Freedomain Reposter](https://git.freedomainplaylists.com/yuriy/Freedomain-Reposter)
|
||||
- [Freedomain Social Media Poster](https://freedomain.dev/yuriy/social-media-poster)
|
||||
- [Freedomain Video Uploader](https://freedomain.dev/yuriy/video-uploader)
|
||||
@@ -1,11 +1,14 @@
|
||||
URLDownloadToVar(url){
|
||||
|
||||
hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
|
||||
hObject.Open("GET",url)
|
||||
|
||||
try hObject.Send()
|
||||
try {
|
||||
hObject.Send()
|
||||
}
|
||||
catch e {
|
||||
; MsgBox, 4096, Error, Failed to connect to:`n`n%url%`n`nAre you connected to the internet? Or is the website down?`n`nDisable Auto Update Check to disable this message.
|
||||
return ""
|
||||
; msgbox, failed!
|
||||
}
|
||||
|
||||
return hObject.ResponseText
|
||||
|
||||
Reference in New Issue
Block a user