alexchantastic / alfred-ip-address-workflow Goto Github PK
View Code? Open in Web Editor NEWAlfred 5 workflow for getting your local and external IP addresses.
License: MIT License
Alfred 5 workflow for getting your local and external IP addresses.
License: MIT License
It would also be great to display the IP location, maybe in the line below the IP. Some services offer the location back. Here is one example: http://ip-api.com/json
It would be great to see which network interface is associated with each IP.
In terms of formatting, I'm thinking something like:
Local IPv4 (en0): 192.168.0.1
If the computer has multiple IP's (in my case because of virtual machines running on my computer) the workflow just fails. I've fixed it in a quite hacky way for now by replacing the local ipv4 line with
ifconfig | grep 'inet ' | grep -Fv 127.0.0.1 | head -n 1 | awk '{print $2}'
When I get time i'll get on doing a nicer fix and creating a pull request if no one bets me to it :)
I have multiple local addresses, the debug console gives me this:
[2018-08-20 13:20:24][ERROR: input.scriptfilter] JSON error: Unescaped control character around character 54. in JSON:
{"items": [
{
"title": "Local IPv4: 192.168.141.91
192.168.143.155
169.254.241.90",
"subtitle": "Press enter to paste or ⌘C to copy",
"arg": "192.168.141.91
192.168.143.155
169.254.241.90"
},
{
"title": "External IPv4: xxx.xxx.xxx.xxx",
"subtitle": "Press enter to paste or ⌘C to copy",
"arg": "xxx.xxx.xxx.xxx"
},
{
"title": "Local IPv6: fe80::c6f:4428:7e31:5e23",
"subtitle": "Press enter to paste or ⌘C to copy",
"arg": "fe80::c6f:4428:7e31:5e23"
},
{
"title": "External IPv6: xxx.xxx.xxx.xxx",
"subtitle": "Press enter to paste or ⌘C to copy",
"arg": "xxx.xxx.xxx.xxx"
}
]}
Probably need to replace \r\n
with ,
?
ifconfig.co isnt working, i recommend change to ifconfig.me/ip ...
For as long as I can recall (a year or more), the workflow doesn’t return my correct external IP.
It comes back with the following:
I am located in New Zealand. That IP address is from a broadband connection on the COX network, in the USA.
https://www.ip-tracker.org/lookup.php?ip=184.189.4.152
Any suggestions as to why it doesn’t come back with my correct external IP?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.