Checking Facebook username availability - Python
Question: I am currently creating an application which includes checking username
availability for social networks, one being Facebook. Using python how would I
do this? I have already done it for twitter:

    
    
    url = "https://twitter.com/users/username_available?username=" + username
    response = requests.get(url)
    data = json.loads(response.text)
    
    return data.get("reason")
    


Answer: You can use the Graph API from Facebook, I've tried one very simple solution.
Basically I'm just checking the response for predefined string.

    
    
    import requests
    name = input()
    url = "https://graph.facebook.com/" + name
    response = requests.get(url)
    
    if (response.text.find("Some of the aliases you requested do not exist") == -1):
        print("Exist!")
    else:
        print("Don't exist!")
    

