import requests


def valid_story(username, singleStory=False):
    """
    Checks if the given username or id
    has a public story
    """
    if singleStory:
        url = "https://story.snapchat.com/s/s:{}"
    else:
        url = "https://story.snapchat.com/s/{}"

    url = url.format(username)
    r = requests.get(url)

    if r.status_code == 200:
        return True

    else:
        return False