opkg update
opkg install python-openssl #adds ssl support to python
opkg install distribute #it contains the easy_install command line tool (this can take some time)
easy_install pip #installs pip  (this can take some time)
pip install requests
nano ipinfo.py
import json
import requests

def getipinfo():
        result = requests.get('http://ipinfo.io/json/')
        json_result = json.loads(result.text)
        for key, value in json_result.items():
        return  tmpstr[:-1]

print getipinfo()
chmod 755 ipinfo.py
"39.0437,-77.4875","Ashburn","US","Virginia","ec2-54-211-19-103.compute-1.amazonaws.com","","AS14618 Amazon.com, Inc.","20147"