




'''simple docstring'''







import requests





def 		snake_case_							(_a			:							str					,     _a			:							str  ):
    UpperCAmelCase     =	{'''Content-Type''': '''application/json'''}
    UpperCAmelCase     =	requests.post(_a					,     json={'''text''': message_body}					,     headers=_a  )
    if response.status_code != 2_0_0:
        UpperCAmelCase     =	(
            '''Request to slack returned an error '''
            F"{response.status_code}, the response is:\n{response.text}"
        )
        raise ValueError(_a  )


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 __future__ import annotations

import requests





def 		snake_case_							(_a			:							str  ):
    UpperCAmelCase     =	F"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
    return requests.get(_a  ).json()





def 		snake_case_							(_a			:							int = 1_0  ):
    UpperCAmelCase     =	'''https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty'''
    UpperCAmelCase     =	requests.get(_a  ).json()[:max_stories]
    return [get_hackernews_story(_a  ) for story_id in story_ids]





def 		snake_case_							(_a			:							int = 1_0  ):
    UpperCAmelCase     =	hackernews_top_stories(_a  )
    return "\n".join('''* [{title}]({url})'''.format(**_a  ) for story in stories  )


if __name__ == "__main__":
   print(hackernews_top_stories_as_markdown())




