AutoHotkey Webinar: Ground Rules & Script Highlight

AutoHotkey Webinar: Ground Rules & Script Highlight
Slide Note
Embed
Share

In this AutoHotkey webinar held on 5/16/2017, with Joe Glines and Jackie Sztuk, ground rules were established for the 63 registrants, emphasizing mutual respect and asking questions. The script highlighted the process of creating pretty URLs and included API references. The discussion also delved into examples of web service API calls and the growing significance of APIs in businesses since 2005. Learn about web services, APIs, and the main differences between web service/API calls and web browser interactions.

  • AutoHotkey
  • Webinar
  • Web Services
  • API calls
  • Programming

Uploaded on Feb 21, 2025 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. AutoHotkey Webinar 5/16/2017 The Webinar will begin in a few minutes Joe Glines Jackie Sztuk https://jszapp.com http://the-automator.com Joe@the-Automator.com Admin@jszapp.com

  2. Ground Rules Currently 63 Registrants Everyone starts off muted be nice Raise your hand if you have a question & you ll be unmuted in due time Ask your question in the chat If your question is complicated we ll unmute you and you can ask directly

  3. Script Highlight Script Highlight: Text & pretty URL reference #Include <GetActiveBrowserURL> ;by atnbueno #Include <WinClipAPI> ;by Deo #Include <WinClip> ;by Deo RCTRL:: ; B:\the-automator\Webinar\Scripts\Pretty URl and href 2.ahk Browser_Back:: ;************************************************************ clipboard = ; Empty the clipboard SendInput, ^c ;Send control C to copy selected text to clipboard ClipWait, 1 ;Wait up to 1 second for clipboard to have data If ErrorLevel ;Added errorLevel checking { MsgBox, No text was sent to clipboard Return ;Prevent from going forward } ModernBrowsers := "ApplicationFrameWindow,Chrome_WidgetWin_0,Chrome_WidgetWin_1,Maxthon3Cls_MainFrm,MozillaWindowClass,Slimjet_WidgetWin_1" LegacyBrowsers := "IEFrame,OperaWindowClass" URL := GetActiveBrowserURL() ;Get active Browser URL html:="<a href=" . url . " >" . Clipboard WinClip.Clear() WinClip.SetHTML( html ) ;set clipboard to be Hyperlink return . "</a>" ;Build href

  4. What is a Webservice Webservice API API? (A Application P Programming I Interface?) API Call Server Different Server

  5. Examples of Web Service API calls Application / Software querying products for sale on Amazon.com App on your phone getting latest Weather Database pulling updated sales report Using your Tablet to Select movies to watch on Netflix DropBox application syncing files between your computer & cloud Google places search

  6. APIs are becoming increasingly available! Since 2005, we've seen APIs grow from a curiosity, to a trend, and now to the point where APIs are core to many businesses. APIs have provided tremendous value to countless organizations and developers, which is reflected in their continued growth. Source: Programmable Web

  7. Main Differences between Webservice / API call & Web Browser Web Browser call GUI interface Regularly dozens/100 s of API calls per page Collects all types of data but displays in HTML Average size 1024K Handles Authentication through logging-in Billions of web pages are accessible Generally standardized format HTML DOM Document Object Model is map Webservice / API Call No built in GUI Interface One (very specific) call Typical response is JSON or XML Average size 30K Need to provide oAuth Authentication Not every site/service has an API Getting better about standards (but documentation often is inaccurate) RESTful, SOAP, XML-RPC

  8. When to use API verse Web Scraping? Use Webservice / API when You frequently use the service You want specific data (and plan to get a lot of it) The website frequently changes Doing complex process (e.g. Naming and uploading files) Extracting a lot of data You know what you want to extract You need it to work for others/other computers What you want is NOT available from website Use Web Scraping when It is a one-time / one-off need Your need is immediate The website appears stable/unchanging API requires complex Authorization The data you want frequently change (new items of a list come up frequently) The need is only for yourself No API is available!

  9. Some Webservices / APIs Some of the Amazing APIs out there Programmable Web list of thousands of APIs as well as a great, six-part, article reviewing APIs Short-list of APIs open to public on Wikipedia, Google APIs- Over 100 APIs @ Google; Yahoo APIs Social Sites : Twitter, Pinterest, Google+, YouTube, Facebook, LinkedIn, reddit, StumbleUpon, WordPress, Instagram Contact / Business Lookup: ClearBit, Pipl, FullContact, Dunn & Bradstreet , Foursquare, Google Places, Yelp, GeoNames Weather: Weather Underground, Yahoo Weather, World Air Finance: Google Finance, Yahoo Finance, PayPal, Stripe, XigniteRealTime, Ally Invest Government: A bunch of Government APIs, Cloud.Gov, US Census, 18F.gsa.gov Additional: Wikipedia, Amazon Product, email to text, SmartSheet,SurveyGizmo, Bitly, SnapOCR, PasteBin, DropBox, Zoho, Zillow, imugr, Mailgun, MailChimp, Microsoft: Graph, MS Office: Excel Word SharePoint OneNote Outlook Yammer PowerPoint

  10. Break-down of a REST REST API request via COM object Create COM object Open Endpoint (w/ parameters & Authentication if GET request) Set RequestHeader(s) Send (w/ payload & Authentication for POST requests) Get response (body or text)

  11. Main Main differences of oAuth1 verse oAuth2 Unfortunately there is no standard implementation of oAuth1 or oAuth2 however, at a high- level, here are some of the main conceptual differences: oAuth1: Need a Key & Token from Webservice API (typically different than your username and password) You use your Key & Token in your API call oAuth1 is less secure and, generally, being phased out While being phased out often the developers (us) canuse oAuth1 for development of the app oAuth2: Need a Key and Token (same as oAuth1) however you use the Key & Token and some other parameters to perform a handshake which returns a secure token which typically times-out in seconds / minutes/hours Your token is restricted to the level of your account (or what has been authorized) The secure token is what is shared with your actual endpoint. (this allows other Social sites (like LinkedIn, Facebook, etc.) to assist your login but not have your username/password to the endpoint

  12. HTTP and AutoHotkey Resources HTTP Protocol & General Tutorials What is an HTTP Request Intro to REST APIs (Representational State Transfer) vs SOAP APIs (Simple Object Access Protocol) HTTP Headers for Dummies Request Headers ; HTTP Made really easy Types of Requests (GET and POST are by far the most frequent) YouTube discussion comparing Get vs Post 4 YouTube videos on oAuth2 Part 1, Part 2, Part 3, Part 4 ; Good video discussing various Authentication protocols Parse XML DOM, Xpath ,XDOM Properties & Methods, JSON Tools: Fiddler, Wireshark, Postman, Boomerang, SoapUI, F12/Developer tools / Network Traffic AutoHotkey specific AHK API Syntax Writer (not finished yet but close) AHK Functions: WinHttpRequest by tmplinshi HTTPRequest from VxE URLDownloadToVar XMLHTTP Request for Asynchronous downloads Msxml2.XMLHTTP vs WinHttpRequest Multi-part/form data and AHK function to post it (often used when dealing with binary) Parsing: XML: XMLclass JSON: COCO JSON and Jxon AHK_Lib-JSON , VxE: AHK-Lib-JSON_ToObj , AHK-Lib-JSON_FromObj

  13. Lets make some API calls! Weather Underground 1) Dallas forecast in XML 2) Dallas forecast in JSON 3) Using WinHttpRequest 4) Example with browser Yahoo business 1) Pizza restaurants in zip code 75019 in XML 2) Pizza restaurants in zip code 75019 in JSON 3) Using WinHTTPRequest

  14. Additional APIs to play with if time allows 1. Zillow 2. Google Geocode 3. Google Page Speed 4. Google Places 5. Google Translate 6. SmartSheet 7. WordPress

  15. Q & A Q & A This deck will be sent out as well as links to the webinar If you re not signed up to receive notifications you can do so here To sign-up for particular webinars, go here Please share amongst colleagues & people that might be interested

More Related Content