import requests


def _get_newest_entry(subreddit_name):
    """
    Extracts newest subreddit entry from JSON RSS

    :param str subreddit_name: Subreddit to get entry for
    :return: Extracted rss data
    :rtype: dict
    """

    url = "https://www.reddit.com/r/{}/new/.json".format(subreddit_name)
    headers = {'User-Agent': 'Mozilla/5.0'}

    response = requests.get(url, headers=headers)
    response.raise_for_status()

    rss = response.json()

    return rss['data']['children'][0]['data']