Page 1 of 1

ExpandUrl : API service to find redirects

Posted: 29 Mar 2020 16:29
by BoBo
Fellow AHK'er SKAN has provided a script that can be easily 'converted' into an Automagic flow.

a) take URL/URI from {clipboard}
b) validate if it's a URL/URI (regex ! not working properly!! Any (JAVA) regex god to the rescue?)
c) if true - request expandurl.com to convert the URL/URI (if its shortened) and copy its response to {clipboard}
d) if false - display a notification

[SKAN's AHK script]

Re: ExpandUrl : API service to find redirects

Posted: 29 Mar 2020 16:47
by anuraag
Use following code to find url from clipboard

Code: Select all

find = findAll(value, getJavaStaticField("android.util.Patterns", "WEB_URL")); 
url = find[0];

Re: ExpandUrl : API service to find redirects

Posted: 29 Mar 2020 17:33
by BoBo
Thx :) much appreciated (... and for those who struggle with regex like myself: https://www.youtube.com/watch?v=r6I-Ahc ... zqdqHd2HiD)