Skip to content

Instantly share code, notes, and snippets.

@mrrizal
Created January 9, 2021 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrrizal/bd8ca7caeda11cc1967d20d910ca57f1 to your computer and use it in GitHub Desktop.
Save mrrizal/bd8ca7caeda11cc1967d20d910ca57f1 to your computer and use it in GitHub Desktop.
import requests
class Hello(object):
def greeting(self, name):
return "Hello {}!".format(name)
def get_location(self):
ip_info_url = "https://ipinfo.io/json"
r = requests.get(ip_info_url)
if r.status_code == 200:
return r.status_code, r.json()
return r.status_code, {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment