Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mxrch
GitHub Repository: mxrch/GHunt
Path: blob/master/ghunt/parsers/geolocate.py
252 views
1
from ghunt.objects.apis import Parser
2
from ghunt.objects.base import Position
3
4
from typing import *
5
6
7
class GeolocationResponse(Parser):
8
def __init__(self):
9
self.accuracy: int = 0
10
self.location: Position = Position()
11
12
def _scrape(self, base_model_data: dict[str, any]):
13
self.accuracy = base_model_data.get("accuracy")
14
15
location = base_model_data.get("location")
16
self.location.longitude = location.get("lng")
17
self.location.latitude = location.get("lat")
18