Пример #1
0
 def _get_position(self, body):
     try:
         elements = SteemMarkdown(body).find_elements(POSITION_TAG_SELECTOR)
         if elements and len(elements) > 0:
             position = elements[0].get("position")
             return int(position)
     except:
         logger.error("Failed when getting position tag.\nError: {}".format(traceback.format_exc()))
     return DEFAULT_POSITION
Пример #2
0
 def get_pic_url(
     self,
     regex=False,
     default_img='https://cdn.steemitimages.com/DQmNUYttPwL2nEhCGRXSxp3WnEt4W63d9jwYKXLHiPGinPM/image.png'
 ):
     body = self.get_comment().body
     image_url = SteemMarkdown(body).get_top_image(regex)
     if image_url == None:
         image_url = default_img
     return image_url
Пример #3
0
 def get_compatible_markdown(self):
     body = self.get_comment().body
     return SteemMarkdown(body).get_steem_markdown()
Пример #4
0
 def get_text_body(self):
     body = self.get_comment().body
     return SteemMarkdown(body).get_rendered_text()
Пример #5
0
 def get_pic_url(self, regex=False, default_img = 'https://steemitimages.com/0x0/https://i.ibb.co/q5zvPfj/720c17602a67.png'):
     body = self.get_comment().body
     image_url = SteemMarkdown(body).get_top_image(regex)
     if image_url == None:
         image_url = default_img
     return image_url
Пример #6
0
 def get_pic_url(self, regex=False):
     body = self.get_comment().body
     return SteemMarkdown(body).get_top_image(regex)