예제 #1
0
 def status(self, instance: str, api: API) -> bool:
     try:
         api.base_url = self.base_url.format(instance)
         stats = api.add("statistics").get()
         return True if stats else False
     except RequestException:
         return False
예제 #2
0
 def domains(self, instance: str, api: API) -> Optional[int]:
     api.base_url = self.base_url.format(instance)
     instance_info = api.add("instance").get()
     return get(instance_info, "stats.domain_count")
예제 #3
0
 def likes(self, instance: str, api: API) -> Optional[int]:
     api.base_url = self.base_url.format(instance)
     stats = api.add("statistics").get()
     return stats.get("like_count")