如何检查Instagram用户名的可用性 [英] How to check Instagram username availability
问题描述
如何检查用户名是否在Instagram中可用,我尝试使用Get请求并捕获404错误,有时无法正常工作,还有另一种方法吗?一个可靠的?
how to check if the username is available or not in Instagram, i tried using Get request and catch 404 error, it dose not work sometimes, is there another way ? a reliable one?
我尝试使用对象pascal
i tried using object pascal
try
lHTTP.Get('http://instagram.com/'+lPath, TStream(nil));
except
on E: EIdHTTPProtocolException do
begin
if E.ErrorCode = 404 then
begin
TThread.Synchronize(nil,
procedure
begin
Form1.Memo2.Lines.Add(lPath);
Label2.Text:= IntTosTr(Memo2.Lines.Count);
end
);
end;
Exit;
end;
end;
但是有时,当它返回404时,我去检查instagram中是否存在用户,但是我找不到它,也无法向用户注册,它说用户不可用!
but sometimes, when it returns 404 i go and check if user exist in instagram, but i cant find it and i cant register with the user, it says user is unavailable!
我是否可以使用instagram api函数检查用户是否可用? 我意识到有些帐户已关闭!如何区分其关闭,使用或可用?
is there instagram api function that i can use it to check if user is available ? i realised that some accounts are closed! how to differentiate if its closed or taken or available ?
更新
i think maybe this could be answer, but im not sure how to use it in delp How do I check if a username is taken with parse.com when all User ACL:Public read/write is disable?
推荐答案
这很脏.按照这些说明自行完成代码
This is very dirty. Complete the code on your own using these instructions
获取此网址(以获取Cookie)
GET this url (to get cookies)
再次发布到该网址
具有这些值
- 引荐来源: https://www.instagram.com/
- 名为"x-csrftoken"的新(自定义)标头,它是从GET收到的cookie"csrftoken"中的值副本
POST值
- email = ... instagram上不存在的一些随机电子邮件...
- password = ...一些强密码...
- 用户名= ...您的名字...
- first_name = ...空
如果可以创建帐户,您将得到类似的结果
You will get result like this if account can be created
{...状态":确定",用户名建议":["..."],帐户创建":false}
{... "status": "ok", "username_suggestions": ["..."], "account_created": false}
或者如果不是这样的话
{...状态":确定",用户名建议":["..."],错误":{用户名":[对不起,该用户名已被使用."]},"account_created:false}
{..."status": "ok", "username_suggestions": ["..."], "errors": {"username": ["Sorry, that username is taken."]}, "account_created": false}
这篇关于如何检查Instagram用户名的可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!