Ever wanted to access your public IP within a script?

I use canhazip.com for this and I need it pretty often.
It is pretty basic but thats the benefit.