Checking Skype Username

Is there a way to confirm that the Skype username is valid in the web application? (form validation when creating an account)

In fact, I do not mean the use of regular expressions. We easily check whether it is 6-22 characters, starts with a letter, etc. I want to check that either: 1) the username entered actually calls the user who enters it, similar to how we check email by sending an email with a link to check it, or 2) make sure that there is a user in the Skype database with this username.

Thanks!

+6
source share
3 answers

I think you will need to do exactly what you said: β€œit’s like when we check email by sending an email with a link to check it”

I would look into Skype4py , you will find an example of finding someone.

So you can do:

  • some early check by looking for this person
  • by sending him / her a txt message with a key / link to confirm your user.

See: we need a python script that uses skype4py to send an instant message

+1
source

This may not be very reliable, but the following endpoint will give you different answers depending on the availability of the Skype username: https://login.skype.com/json/validator . Here are two examples (at the time of this writing) of an inaccessible and accessible username:

# Request (unavailable): curl -iX POST -H" Application/json" https://login.skype.com/json/validator?new_username=borist # Response: { "status": 406, "status_text": "valid", "data": { "markup": "Skype Name not available", "alternatives": true, "fieldDetails": "<label>Suggestions<\/label><ul><li><label><input class=\"skypeNameSuggestion\" type=\"radio\" name=\"selectSkypeName\" value=\"borist92\"\/>borist92<\/label> <\/li><li><label><input class=\"skypeNameSuggestion\" type=\"radio\" name=\"selectSkypeName\" value=\"borist176\"\/>borist176<\/label> <\/li><li><label><input class=\"skypeNameSuggestion\" type=\"radio\" name=\"selectSkypeName\" value=\"borist417\"\/>borist417<\/label> <\/li><\/ul>" } } # Request (available) curl -iX POST -H" Application/json" https://login.skype.com/json/validator?new_username=boris3294a # Response { "status":200, "status_text":"valid", "data":{"markup":"", "alternatives":false, "fieldDetails":""} } 
+10
source

By creating a pho79 answer, I did the gist . The code simply checks to see if a message has returned that the name is unavailable, which means that it is in use. There are other messages that he sends back for other errors, so this is what I went with.

 import requests def checkName(name): values = { "new_username" : name } r = requests.post("https://login.skype.com/json/validator", values) return "not available" in r.json()[u'data'][u'markup'] 
+1
source

Source: https://habr.com/ru/post/906528/


All Articles