main.py
def update_slack(submissions):
    """
    Updating Slack with new submissions.
    :param submissions: new submissions
    """

    for submission in submissions:
        submission_date = time.strftime(
            '%H:%M %d/%m', time.gmtime(int(submission.created_utc) + TWO_DAYS)
        )

        message = '*<{}|{}>*\n*Subreddit*: {}\n*Date*: {}\n{}'.format(
            submission.url,
            submission.title,
            submission.subreddit.display_name,
            submission_date,
            '-' * 20,
        )
        
        requests.post(
            config['slack-hook-url'],
            headers={'Content-type': 'application/json'},
            data=json.dumps({'text': message})
        )

    Updating Slack with new submissions.
    :param submissions: new submissions
    
Updating Slack with new submissions.
Updating Slack with new submissions .
def update_slack(submissions):
    for submission in submissions:
        submission_date = time.strftime(
            '%H:%M %d/%m', time.gmtime(int(submission.created_utc) + TWO_DAYS)
        )
        message = '*<{}|{}>*\n*Subreddit*: {}\n*Date*: {}\n{}'.format(
            submission.url,
            submission.title,
            submission.subreddit.display_name,
            submission_date,
            '-' * 20,
        )
        requests.post(
            config['slack-hook-url'],
            headers={'Content-type': 'application/json'},
            data=json.dumps({'text': message})
        )
def update_slack ( submissions ) : for submission in submissions : submission_date = time . strftime ( '%H:%M %d/%m' , time . gmtime ( int ( submission . created_utc ) + TWO_DAYS ) ) message = '*<{}|{}>*\n*Subreddit*: {}\n*Date*: {}\n{}' . format ( submission . url , submission . title , submission . subreddit . display_name , submission_date , '-' * 20 , ) requests . post ( config [ 'slack-hook-url' ] , headers = { 'Content-type' : 'application/json' } , data = json . dumps ( { 'text' : message } ) )
Updating Slack with new submissions.
Updating Slack with new submissions .
"""
    Updating Slack with new submissions.
    :param submissions: new submissions
    """
submissions
None