






"""simple docstring"""
def 				lowercase__		(					lowerCamelCase       ):
				try:
								_SCREAMING_SNAKE_CASE   :		int       		=    float(lowerCamelCase       )
				except ValueError:
								raise ValueError('Please enter a valid number'       )
				_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    decimal - int(lowerCamelCase       )
				if fractional_part == 0:
								return int(lowerCamelCase       ), 1
				else:
								_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    len(str(lowerCamelCase       ).split('.'       )[1]       )
								_SCREAMING_SNAKE_CASE   :		Optional[int]       		=    int(decimal * (10**number_of_frac_digits)       )
								_SCREAMING_SNAKE_CASE   :		int       		=    10**number_of_frac_digits
								_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE   :		List[str]       		=    denominator, numerator
								while True:
												_SCREAMING_SNAKE_CASE   :		List[Any]       		=    dividend % divisor
												if remainder == 0:
																break
												_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    divisor, remainder
								_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    numerator / divisor, denominator / divisor
								return int(lowerCamelCase       ), int(lowerCamelCase       )


if __name__ == "__main__":
			print(F'{decimal_to_fraction(2) = }')
			print(F'{decimal_to_fraction(89.0) = }')
			print(F'{decimal_to_fraction("67") = }')
			print(F'{decimal_to_fraction("45.0") = }')
			print(F'{decimal_to_fraction(1.5) = }')
			print(F'{decimal_to_fraction("6.25") = }')
			print(F'{decimal_to_fraction("78td") = }')









"""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}.')

