lambda_function.py
def lambda_handler(event, context):
    """This function call in AWS Lambda
    """
    res_list = []

    # daily news notify(weekday only)
    if datetime.now().weekday() in [0, 1, 2, 3, 4]:
        res = notify_daily_news()
        res_list.append(res)

    # Monday Morning special
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 0:
        text, attachments = get_github_trends()
        res = notify_slack(text, attachments)
        res_list.append(res)

    # Tuseday Morning special
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 1:
        text, attachments = get_amazon_trends()
        res = notify_slack(text, attachments)
        res_list.append(res)

    # Wednesday Morning special
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 2:
        text, attachments = get_hacker_news_trends()
        res = notify_slack(text, attachments)
        res_list.append(res)

    # Thursday Morning special
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 3:
        text, attachments = get_ivents()
        res = notify_slack(text, attachments)
        res_list.append(res)

    # Friday Morning special
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 4:
        text, attachments = get_arxiv_papers()
        res = notify_slack(text, attachments)
        res_list.append(res)

    return str(res_list)
This function call in AWS Lambda
    
This function call in AWS Lambda
This function call in AWS Lambda
def lambda_handler(event, context):
    res_list = []
    if datetime.now().weekday() in [0, 1, 2, 3, 4]:
        res = notify_daily_news()
        res_list.append(res)
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 0:
        text, attachments = get_github_trends()
        res = notify_slack(text, attachments)
        res_list.append(res)
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 1:
        text, attachments = get_amazon_trends()
        res = notify_slack(text, attachments)
        res_list.append(res)
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 2:
        text, attachments = get_hacker_news_trends()
        res = notify_slack(text, attachments)
        res_list.append(res)
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 3:
        text, attachments = get_ivents()
        res = notify_slack(text, attachments)
        res_list.append(res)
    if datetime.now().strftime('%H') == "00" and datetime.now().weekday() == 4:
        text, attachments = get_arxiv_papers()
        res = notify_slack(text, attachments)
        res_list.append(res)
    return str(res_list)
def lambda_handler ( event , context ) : res_list = [ ] if datetime . now ( ) . weekday ( ) in [ 0 , 1 , 2 , 3 , 4 ] : res = notify_daily_news ( ) res_list . append ( res ) if datetime . now ( ) . strftime ( '%H' ) == "00" and datetime . now ( ) . weekday ( ) == 0 : text , attachments = get_github_trends ( ) res = notify_slack ( text , attachments ) res_list . append ( res ) if datetime . now ( ) . strftime ( '%H' ) == "00" and datetime . now ( ) . weekday ( ) == 1 : text , attachments = get_amazon_trends ( ) res = notify_slack ( text , attachments ) res_list . append ( res ) if datetime . now ( ) . strftime ( '%H' ) == "00" and datetime . now ( ) . weekday ( ) == 2 : text , attachments = get_hacker_news_trends ( ) res = notify_slack ( text , attachments ) res_list . append ( res ) if datetime . now ( ) . strftime ( '%H' ) == "00" and datetime . now ( ) . weekday ( ) == 3 : text , attachments = get_ivents ( ) res = notify_slack ( text , attachments ) res_list . append ( res ) if datetime . now ( ) . strftime ( '%H' ) == "00" and datetime . now ( ) . weekday ( ) == 4 : text , attachments = get_arxiv_papers ( ) res = notify_slack ( text , attachments ) res_list . append ( res ) return str ( res_list )
This function call in AWS Lambda
This function call in AWS Lambda
"""This function call in AWS Lambda
    """ # daily news notify(weekday only) # Monday Morning special # Tuseday Morning special # Wednesday Morning special # Thursday Morning special # Friday Morning special
event
context