You won’t be able to do this in a plain snippet, but it should be straightforward to make a simple plugin to either “insert external IP here” as a TextCommand, or insert a predefined snippet and populate a placeholder with the external IP address. Two pieces of the jigsaw you’ll need:
- How to get external IP address
You need a site that’ll serve it up plain on a GET request. Here’s one:
http://ipecho.net/plain
- How to perform a GET request from python (assuming python 3, ie. ST3)
import urllib.request
...
urllib.request.urlopen("http://ipecho.net/plain").read()
The rest requires a little knowledge of Python but it’ll be very simple. Take a look at some simple plugins on Github and you should be able to figure this out in 10-15 mins. Then you can post your working plugin in the “Plugin” forum