问题描述
如何在Instagram中检查用户名是否可用,我尝试使用get request and Catch 404错误,有时剂量不起作用,还有另一种方法吗?一个可靠的?
我尝试使用对象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中,但我找不到它,我无法向用户注册,它说用户不可用!
是否有Instagram API函数可以使用它来检查用户是否可用? 我意识到有些帐户已关闭!如何区分它是否关闭,接收或可用?
更新
我认为这可能是答案,但是我不确定如何在Delphi中使用它,推荐答案 这很脏.使用这些说明自己完成代码 获取此URL(获取cookie) 再次发布到此URL 使用这些值
帖子值
- email = ...一些随机电子邮件,这些电子邮件在Instagram上不存在...
- 密码= ...一些强密码...
- 用户名= ...您的名字...
- first_name = ...空
如果可以创建帐户,您将获得这样的结果
{..." status":" ok"," username_suggestions":[" ..."]," account_created":false}
或此(如果不是)
{..." status":" ok"," username_suggestions":[" ..."],"错误":{" username":[对不起,该用户名已被拿走. account_created":false}
其他推荐答案
您的API呼叫示例包含错误.
当我尝试
时https://api.instagram.com/v1/users/search?q=rn0&access_token=xxxxxxxxxxxxxx
服务器答案
{"meta": {"error_type": "OAuthAccessTokenException", "code": 400, "error_message": "The access_token provided is invalid."}}
由于我没有access_token,我不能测试的更多,但是也许它可以让您开始
问题描述
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?
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;
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!
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 ?
UPDATE
i think maybe this could be answer, but im not sure how to use it in delphi, 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
GET this url (to get cookies)
POST to this url again
with these values
- referer: https://www.instagram.com/
- new (custom) header named "x-csrftoken", value copy from cookie "csrftoken" which you received from GET
POST values
- email=... some random e-mail which does not exist on instagram ...
- password=... some strong password ...
- username=... your name ...
- first_name=... empty
You will get result like this if account can be created
{... "status": "ok", "username_suggestions": ["..."], "account_created": false}
or this if not
{..."status": "ok", "username_suggestions": ["..."], "errors": {"username": ["Sorry, that username is taken."]}, "account_created": false}
其他推荐答案
Your API call example contains errors.
When I try
https://api.instagram.com/v1/users/search?q=rn0&access_token=xxxxxxxxxxxxxx
the server answers
{"meta": {"error_type": "OAuthAccessTokenException", "code": 400, "error_message": "The access_token provided is invalid."}}
As I do not have a access_token, I can't test more than this, but maybe it gets you started