AutoHotkey PODCASTS with Blackholyman and Joe Glines

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

AutoHotkey PODCASTS with Blackholyman and Joe Glines

05 Apr 2019, 15:11

Greetings fellow AutoHotkey enthusiasts! Jackie Sztuk from jszapp.com and Joe Glines from the-Automator are having weekly AHK podcasts where we (mostly) talk-through various things about automation & AutoHotkey.

For more in-depth dives, check out our AutoHotkey webinars

Most of the AutoHotkey podcasts are designed for listening to however, at times, we do reference things on our screens. Generally speaking the mp3 files should be fine...If you have a particular topic you would like covered, please let us know by posting below

AHK Podcasts
  • 001-mp3 Video Why and what to automate
  • 002-mp3 Video Automating ourselves out of a job?
  • 003-mp3 Video Charging for AutoHotkey work / Advice
  • 004-mp3 Video Using Functions in AutoHotkey
  • 005-mp3 Video Multiple scripts verse single script
  • 006-mp3 Video Why people don’t pick-up AutoHotkey
  • 007-mp3 Video Running scripts on multiple computers
  • 008-mp3 Video Current AutoHotkey forum issues
  • 009-mp3 Video When NOT to use AutoHotkey
  • 010-mp3 Video What AHK IS good for
  • 011-mp3 Video What holds AutoHotkey back? Why is it so niche.
  • 012-mp3 part 1 part 2 Video part 1 part 2 Various AutoHotkey websites & Communities. PowerPoint deck with links
  • 013-mp3 video APIs vs. Web Scraping
  • 014-mp3 video Historical versions of AutoHotkey
  • 015-mp3 video What can be automated
  • 016-mp3 video Most overlooked AHK Functionality
  • 017-mp3 video Thought process BEFORE scripting
  • 018-mp3 video Preferred Order of Technology used for Automation
  • 019-mp3 video Video The future of web scraping with AutoHotkey
  • 020-mp3 video Robotics Process Automation (RPA) & Desktop Automation
  • 021-mp3 video Three Philosophical views of Computer Automation / RPA
Last edited by Joe Glines on 18 Jun 2019, 07:53, edited 4 times in total.
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: AutoHotkey Podcasts with Blackholyman and Joe Glines

06 Apr 2019, 15:25

BTW- Maestrith, author of AHK Studio and I were on a call.  We thought it would be fun to have an AutoHotkey mp3 player.  In about 15 minutes he cranked out this cool AHK gem.  It will dynamically update the below podcasts and play them!

Code: Select all

#SingleInstance,Force
URL:="http://the-automator.com/ahk-podcasts?refresh=" A_Now ;Get current version of page
SplashTextOn,200,50,Downloading Podcast List,Please Wait...
Text:=URLDownloadToVar(URL) ;Store page in URL variable
SplashTextOff
Pos:=1
Dom:=ComObjCreate("HTMLFile") ;Push it into the DOM
Dom.Write(Text)
Gui,Add,ListView,w500 h300 gPlay,Podcast ;Create a listview
All:=Dom.GetElementsByTagName("a") ;Get all a tags (there were several ways we could have done this)
while(aa:=All.Item[A_Index-1]){ ;loop over links
	if(SubStr(aa.href,-3)=".mp3") ;if it ends in .mp3  add it to the listview in the next line
		LV_Add("",RegExReplace(uriDecode(aa.href),"\Qhttp://the-automator.com/\E")) ;remove "http://the-automator.com/" from the view
}
Gui,1:Add,ActiveX,vWMP w500 h264,WMPlayer.OCX ;Create the Windows media player and make if visible in the GUI
Gui,Show,,Podcast ;Display the GUI
return
GuiClose:
ExitApp
return
Play:
LV_GetText(URL,LV_GetNext()) ;Get which line in the listview you're on
if(!InStr(URL,".mp3")) ;If it doesn't have ".mp3" don't try and play it
	return
WMP.URL:="http://the-automator.com/" URL ;tell the Windows Media player object to play the specific file/podcast
return

;********************URL download to VAR function***********************************
URLDownloadToVar(URL){
	http:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
	if(proxy:=Settings.SSN("//proxy").text)
		http.SetProxy(2,proxy)
	http.Open("GET",URL,1)
	http.SetRequestHeader("Pragma","no-cache")
	http.SetRequestHeader("Cache-Control","no-cache")
	http.Send(),http.WaitForResponse
	return (http.Status=200?http.ResponseText:"Error")
}
;********************Decode the URL***********************************
uriDecode(str){
	Loop
		If RegExMatch(str, "i)(?<=%)[\da-f]{1,2}", hex)
			StringReplace, str, str, `%%hex%, % Chr("0x" . hex), All
	Else Break
		Return, str
}
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: AutoHotkey Podcasts with Blackholyman and Joe Glines

01 May 2019, 06:58

Going through these right now!
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
User avatar
rediffusion
Posts: 58
Joined: 15 Mar 2019, 05:16

Re: AutoHotkey PODCASTS with Blackholyman and Joe Glines

24 Nov 2019, 11:26

@Joe Glines

AHK mp3 player ··· no more valid!

This is issue:

Code: Select all

---------------------------
AHK mp3 player.ahk
---------------------------
Error:  0x800401F3 - Impermissible row with class indication

	Line#
	002: URL := "http://the-automator.com/ahk-podcasts?refresh=" A_Now
	003: SplashTextOn,200,50,Downloading Podcast List,Please Wait...
	004: Text := URLDownloadToVar(URL)
	005: SplashTextOff
	006: Pos := 1
--->	007: Dom := ComObjCreate("HTMLFile")
	008: Dom.Write(Text)  
	009: Gui,Add,ListView,w500 h300 gPlay,Podcast
	010: All := Dom.GetElementsByTagName("a")
	011: While,(aa:=All.Item[A_Index-1])
	011: {
	012: if (SubStr(aa.href,-3)=".mp3")  
	013: LV_Add("",RegExReplace(uriDecode(aa.href),"\Qhttp://the-automator.com/\E"))  

Continue running the script?
---------------------------
Да   Нет   
---------------------------
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: AutoHotkey PODCASTS with Blackholyman and Joe Glines

01 Dec 2019, 19:53

@rediffusion I just ran it and it ran fine for me.

Code: Select all

#SingleInstance,Force
URL:="http://the-automator.com/ahk-podcasts?refresh=" A_Now ;Get current version of page
SplashTextOn,200,50,Downloading Podcast List,Please Wait...
Text:=URLDownloadToVar(URL) ;Store page in URL variable
SplashTextOff
Pos:=1
Dom:=ComObjCreate("HTMLFile") ;Push it into the DOM
Dom.Write(Text)
Gui,Add,ListView,w500 h300 gPlay,Podcast ;Create a listview
All:=Dom.GetElementsByTagName("a") ;Get all a tags (there were several ways we could have done this)
while(aa:=All.Item[A_Index-1]){ ;loop over links
	if(SubStr(aa.href,-3)=".mp3") ;if it ends in .mp3  add it to the listview in the next line
		LV_Add("",RegExReplace(uriDecode(aa.href),"\Qhttp://the-automator.com/\E")) ;remove "http://the-automator.com/" from the view
}
Gui,1:Add,ActiveX,vWMP w500 h264,WMPlayer.OCX ;Create the Windows media player and make if visible in the GUI
Gui,Show,,Podcast ;Display the GUI
return
GuiClose:
ExitApp
return
Play:
LV_GetText(URL,LV_GetNext()) ;Get which line in the listview you're on
if(!InStr(URL,".mp3")) ;If it doesn't have ".mp3" don't try and play it
	return
WMP.URL:="http://the-automator.com/" URL ;tell the Windows Media player object to play the specific file/podcast
return

;********************URL download to VAR function***********************************
URLDownloadToVar(URL){
	http:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
	if(proxy:=Settings.SSN("//proxy").text)
		http.SetProxy(2,proxy)
	http.Open("GET",URL,1)
	http.SetRequestHeader("Pragma","no-cache")
	http.SetRequestHeader("Cache-Control","no-cache")
	http.Send(),http.WaitForResponse
	return (http.Status=200?http.ResponseText:"Error")
}
;********************Decode the URL***********************************
uriDecode(str){
	Loop
		If RegExMatch(str, "i)(?<=%)[\da-f]{1,2}", hex)
			StringReplace, str, str, `%%hex%, % Chr("0x" . hex), All
	Else Break
		Return, str
}
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests