It seems that cURL follows MIT/X license and wget uses GPL. A big difference for me is that there is a C language library version of cURL called libcurl but wget doesn't have anything like that. Although I am a big fan of GPL, GPL is a kind of restrictive than MIT license. Also cURL seems to have support more network protocols. In many ways, cURL is more attractive.
Thus I decided to make another script with cURL, which is not too different from the wget version.
Make sure you have curl installed with a command: sudo apt-get install curl
Create a script file; I named it public_ip_curl.sh. Don't forget to use your own ID and Password.
Note that the script now uses curl instead of wget.
You can get the same result.
*PS: make sure you gave executable permission with a command: chmod a+x public_ip_curl.sh