如何检查 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?
我尝试使用对象帕斯卡
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 ?
更新
我认为这可能是答案,但我不确定如何在 delphi 中使用它,当所有用户 ACL:公共读/写禁用时,如何检查用户名是否被 parse.com 使用?
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/accounts/web_create_ajax/attempt/
再次发布到这个网址
https://www.instagram.com/accounts/web_create_ajax/attempt/
具有这些值
- 推荐人:https://www.instagram.com/
- 名为x-csrftoken"的新(自定义)标头,来自您从 GET 收到的 cookiecsrftoken"的值副本
POST 值
- email=... instagram 上不存在的一些随机电子邮件...
- password=...一些强密码...
- username=...你的名字...
- first_name=... 空
如果可以创建帐户,您将得到这样的结果
You will get result like this if account can be created
{... "status": "ok", "username_suggestions": ["..."], "account_created": false}
{... "status": "ok", "username_suggestions": ["..."], "account_created": false}
否则就这样
{..."status": "ok", "username_suggestions": ["..."], "errors": {"username": ["对不起,该用户名已被占用."]}, "account_created": false}
{..."status": "ok", "username_suggestions": ["..."], "errors": {"username": ["Sorry, that username is taken."]}, "account_created": false}
这篇关于如何检查 Instagram 用户名的可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!