





"""simple docstring"""


import requests




def 					lowercase__    (					lowercase_		,lowercase_			)					->		Optional[int]:




      """simple docstring"""

      _UpperCamelCase      :	Optional[Any]						=       {"Content-Type": "application/json"}
      _UpperCamelCase      :	List[str]						=       requests.post(_lowerCAmelCase		,json={"text": message_body}		,headers=_lowerCAmelCase			)
      if response.status_code != 200:
            _UpperCamelCase      :	Any						=       (
                "Request to slack returned an error "
                F'''{response.status_code}, the response is:\n{response.text}'''
            )
            raise ValueError(_lowerCAmelCase			)


if __name__ == "__main__":
  # Set the slack url to the one provided by Slack when you create the webhook at
  # https://my.slack.com/services/new/incoming-webhook/
  send_slack_message("<YOUR MESSAGE BODY>", "<SLACK CHANNEL URL>")







"""simple docstring"""


from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
  lowerCamelCase__				  =   input("Enter image url: ").strip()
  print(f"""Downloading image from {url} ...""")
  lowerCamelCase__				  =   BeautifulSoup(requests.get(url).content, "html.parser")
  # The image URL is in the content field of the first meta tag with property og:image
  lowerCamelCase__				  =   soup.find("meta", {"property": "og:image"})["content"]
  lowerCamelCase__				  =   requests.get(image_url).content
  lowerCamelCase__				  =   f"""{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg"""
  with open(file_name, "wb") as fp:
    fp.write(image_data)
  print(f"""Done. Image saved to disk as {file_name}.""")
