2017-03-29 12 views
0

私はwhois whmcs apiを使ってドメインの可用性をチェックし、その出力は解析されませんか? 何が間違っていますか? サンプル出力:http://adu.ir/7IaM9私のjson whois apiの出力に何が間違っていますか?

{"result":"success","status":"unavailable","whois":"+---%3Cbr+%2F%3E%0AWhois+Server+Version+2.0%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ADomain+names+in+the+.com+and+.net+domains+can+now+be+registered%3Cbr+%2F%3E%0Awith+many+different+competing+registrars.+Go+to+http%3A%2F%2Fwww.internic.net%3Cbr+%2F%3E%0Afor+detailed+information.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0AEXAMPLE.COM.AU%3Cbr+%2F%3E%0AEXAMPLE.COM.FLORAMEIYUKWONG.COM%3Cbr+%2F%3E%0AEXAMPLE.COM.RAFAELYALUFF.COM%3Cbr+%2F%3E%0AEXAMPLE.COM.ZONE%3Cbr+%2F%3E%0AEXAMPLE.COM%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ATo+single+out+one+record%2C+look+it+up+with+%22xxx%22%2C+where+xxx+is+one+of+the%3Cbr+%2F%3E%0Arecords+displayed+above.+If+the+records+are+the+same%2C+look+them+up%3Cbr+%2F%3E%0Awith+%22%3Dxxx%22+to+receive+a+full+display+for+each+record.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3E%3E%3E+Last+update+of+whois+database%3A+Wed%2C+29+Mar+2017+09%3A50%3A20+GMT+%3C%3C%3C%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0AFor+more+information+on+Whois+status+codes%2C+please+visit+https%3A%2F%2Ficann.org%2Fepp%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ANOTICE%3A+The+expiration+date+displayed+in+this+record+is+the+date+the%3Cbr+%2F%3E%0Aregistrar%27s+sponsorship+of+the+domain+name+registration+in+the+registry+is%3Cbr+%2F%3E%0Acurrently+set+to+expire.+This+date+does+not+necessarily+reflect+the+expiration%3Cbr+%2F%3E%0Adate+of+the+domain+name+registrant%27s+agreement+with+the+sponsoring%3Cbr+%2F%3E%0Aregistrar.++Users+may+consult+the+sponsoring+registrar%27s+Whois+database+to%3Cbr+%2F%3E%0Aview+the+registrar%27s+reported+date+of+expiration+for+this+registration.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ATERMS+OF+USE%3A+You+are+not+authorized+to+access+or+query+our+Whois%3Cbr+%2F%3E%0Adatabase+through+the+use+of+electronic+processes+that+are+high-volume+and%3Cbr+%2F%3E%0Aautomated+except+as+reasonably+necessary+to+register+domain+names+or%3Cbr+%2F%3E%0Amodify+existing+registrations%3B+the+Data+in+VeriSign+Global+Registry%3Cbr+%2F%3E%0AServices%27+%28%22VeriSign%22%29+Whois+database+is+provided+by+VeriSign+for%3Cbr+%2F%3E%0Ainformation+purposes+only%2C+and+to+assist+persons+in+obtaining+information%3Cbr+%2F%3E%0Aabout+or+related+to+a+domain+name+registration+record.+VeriSign+does+not%3Cbr+%2F%3E%0Aguarantee+its+accuracy.+By+submitting+a+Whois+query%2C+you+agree+to+abide%3Cbr+%2F%3E%0Aby+the+following+terms+of+use%3A+You+agree+that+you+may+use+this+Data+only%3Cbr+%2F%3E%0Afor+lawful+purposes+and+that+under+no+circumstances+will+you+use+this+Data%3Cbr+%2F%3E%0Ato%3A+%281%29+allow%2C+enable%2C+or+otherwise+support+the+transmission+of+mass%3Cbr+%2F%3E%0Aunsolicited%2C+commercial+advertising+or+solicitations+via+e-mail%2C+telephone%2C%3Cbr+%2F%3E%0Aor+facsimile%3B+or+%282%29+enable+high+volume%2C+automated%2C+electronic+processes%3Cbr+%2F%3E%0Athat+apply+to+VeriSign+%28or+its+computer+systems%29.+The+compilation%2C%3Cbr+%2F%3E%0Arepackaging%2C+dissemination+or+other+use+of+this+Data+is+expressly%3Cbr+%2F%3E%0Aprohibited+without+the+prior+written+consent+of+VeriSign.+You+agree+not+to%3Cbr+%2F%3E%0Ause+electronic+processes+that+are+automated+and+high-volume+to+access+or%3Cbr+%2F%3E%0Aquery+the+Whois+database+except+as+reasonably+necessary+to+register%3Cbr+%2F%3E%0Adomain+names+or+modify+existing+registrations.+VeriSign+reserves+the+right%3Cbr+%2F%3E%0Ato+restrict+your+access+to+the+Whois+database+in+its+sole+discretion+to+ensure%3Cbr+%2F%3E%0Aoperational+stability.++VeriSign+may+restrict+or+terminate+your+access+to+the%3Cbr+%2F%3E%0AWhois+database+for+failure+to+abide+by+these+terms+of+use.+VeriSign%3Cbr+%2F%3E%0Areserves+the+right+to+modify+these+terms+at+any+time.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0AThe+Registry+database+contains+ONLY+.COM%2C+.NET%2C+.EDU+domains+and%3Cbr+%2F%3E%0ARegistrars.%3Cbr+%2F%3E%0A"} 

私はそれが「+」に「スペース」文字を置き換えると思うし、それが正常ではないのです。 助けてください?

+0

データは、URLエンコードされています。あなたはそれを解読する必要があります –

+0

jsonlint.com:Valid JSON –

+0

私はそれをecho json_encode($ results); –

答えて

0

問題はありません。単にwhoisプロパティのデータがURLエンコードされているだけです。あなたはこのように、decodeURIComponent()を使用して、それをデコードすることができます

var response = { 
 
    "result": "success", 
 
    "status": "unavailable", 
 
    "whois": "+---%3Cbr+%2F%3E%0AWhois+Server+Version+2.0%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ADomain+names+in+the+.com+and+.net+domains+can+now+be+registered%3Cbr+%2F%3E%0Awith+many+different+competing+registrars.+Go+to+http%3A%2F%2Fwww.internic.net%3Cbr+%2F%3E%0Afor+detailed+information.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0AAborting+search+50+records+found+.....%3Cbr+%2F%3E%0AGOOGLE.COM.ACKNOWLEDGES.NON-FREE.COM%3Cbr+%2F%3E%0AGOOGLE.COM.AFRICANBATS.ORG%3Cbr+%2F%3E%0AGOOGLE.COM.ANGRYPIRATES.COM%3Cbr+%2F%3E%0AGOOGLE.COM.AR%3Cbr+%2F%3E%0AGOOGLE.COM.AU%3Cbr+%2F%3E%0AGOOGLE.COM.B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E.COM.PE%3Cbr+%2F%3E%0AGOOGLE.COM.PK%3Cbr+%2F%3E%0AGOOGLE.COM.SA%3Cbr+%2F%3E%0AGOOGLE.COM.SG%3Cbr+%2F%3E%0AGOOGLE.COM.SHQIPERIA.COM%3Cbr+%2F%3E%0AGOOGLE.COM.SOUTHBEACHNEEDLEARTISTRY.COM%3Cbr+%2F%3E%0AGOOGLE.COM.SPAMMING.IS.UNETHICAL.PLEASE.STOP.THEM.HUAXUEERBAN.COM%3Cbr+%2F%3E%0AGOOGLE.COM.SPROSIUYANDEKSA.RU%3Cbr+%2F%3E%0AGOOGLE.COM.SUCKS.FIND.CRACKZ.WITH.SEARCH.GULLI.COM%3Cbr+%2F%3E%0AGOOGLE.COM.TESTZZZZ.3000-RI.COM.DELETE-DNS.COM%3Cbr+%2F%3E%0AGOOGLE.COM.TR%3Cbr+%2F%3E%0AGOOGLE.COM.TW%3Cbr+%2F%3E%0AGOOGLE.COM.UA%3Cbr+%2F%3E%0AGOOGLE.COM.UK%3Cbr+%2F%3E%0AGOOGLE.COM.UY%3Cbr+%2F%3E%0AGOOGLE.COM.VABDAYOFF.COM%3Cbr+%2F%3E%0AGOOGLE.COM.VN%3Cbr+%2F%3E%0AGOOGLE.COM.YUCEHOCA.COM%3Cbr+%2F%3E%0AGOOGLE.COM%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ATo+single+out+one+record%2C+look+it+up+with+%22xxx%22%2C+where+xxx+is+one+of+the%3Cbr+%2F%3E%0Arecords+displayed+above.+If+the+records+are+the+same%2C+look+them+up%3Cbr+%2F%3E%0Awith+%22%3Dxxx%22+to+receive+a+full+display+for+each+record.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3E%3E%3E+Last+update+of+whois+database%3A+Wed%2C+29+Mar+2017+09%3A49%3A20+GMT+%3C%3C%3C%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0AFor+more+information+on+Whois+status+codes%2C+please+visit+https%3A%2F%2Ficann.org%2Fepp%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ANOTICE%3A+The+expiration+date+displayed+in+this+record+is+the+date+the%3Cbr+%2F%3E%0Aregistrar%27s+sponsorship+of+the+domain+name+registration+in+the+registry+is%3Cbr+%2F%3E%0Acurrently+set+to+expire.+This+date+does+not+necessarily+reflect+the+expiration%3Cbr+%2F%3E%0Adate+of+the+domain+name+registrant%27s+agreement+with+the+sponsoring%3Cbr+%2F%3E%0Aregistrar.++Users+may+consult+the+sponsoring+registrar%27s+Whois+database+to%3Cbr+%2F%3E%0Aview+the+registrar%27s+reported+date+of+expiration+for+this+registration.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0ATERMS+OF+USE%3A+You+are+not+authorized+to+access+or+query+our+Whois%3Cbr+%2F%3E%0Adatabase+through+the+use+of+electronic+processes+that+are+high-volume+and%3Cbr+%2F%3E%0Aautomated+except+as+reasonably+necessary+to+register+domain+names+or%3Cbr+%2F%3E%0Amodify+existing+registrations%3B+the+Data+in+VeriSign+Global+Registry%3Cbr+%2F%3E%0AServices%27+%28%22VeriSign%22%29+Whois+database+is+provided+by+VeriSign+for%3Cbr+%2F%3E%0Ainformation+purposes+only%2C+and+to+assist+persons+in+obtaining+information%3Cbr+%2F%3E%0Aabout+or+related+to+a+domain+name+registration+record.+VeriSign+does+not%3Cbr+%2F%3E%0Aguarantee+its+accuracy.+By+submitting+a+Whois+query%2C+you+agree+to+abide%3Cbr+%2F%3E%0Aby+the+following+terms+of+use%3A+You+agree+that+you+may+use+this+Data+only%3Cbr+%2F%3E%0Afor+lawful+purposes+and+that+under+no+circumstances+will+you+use+this+Data%3Cbr+%2F%3E%0Ato%3A+%281%29+allow%2C+enable%2C+or+otherwise+support+the+transmission+of+mass%3Cbr+%2F%3E%0Aunsolicited%2C+commercial+advertising+or+solicitations+via+e-mail%2C+telephone%2C%3Cbr+%2F%3E%0Aor+facsimile%3B+or+%282%29+enable+high+volume%2C+automated%2C+electronic+processes%3Cbr+%2F%3E%0Athat+apply+to+VeriSign+%28or+its+computer+systems%29.+The+compilation%2C%3Cbr+%2F%3E%0Arepackaging%2C+dissemination+or+other+use+of+this+Data+is+expressly%3Cbr+%2F%3E%0Aprohibited+without+the+prior+written+consent+of+VeriSign.+You+agree+not+to%3Cbr+%2F%3E%0Ause+electronic+processes+that+are+automated+and+high-volume+to+access+or%3Cbr+%2F%3E%0Aquery+the+Whois+database+except+as+reasonably+necessary+to+register%3Cbr+%2F%3E%0Adomain+names+or+modify+existing+registrations.+VeriSign+reserves+the+right%3Cbr+%2F%3E%0Ato+restrict+your+access+to+the+Whois+database+in+its+sole+discretion+to+ensure%3Cbr+%2F%3E%0Aoperational+stability.++VeriSign+may+restrict+or+terminate+your+access+to+the%3Cbr+%2F%3E%0AWhois+database+for+failure+to+abide+by+these+terms+of+use.+VeriSign%3Cbr+%2F%3E%0Areserves+the+right+to+modify+these+terms+at+any+time.%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0AThe+Registry+database+contains+ONLY+.COM%2C+.NET%2C+.EDU+domains+and%3Cbr+%2F%3E%0ARegistrars.%3Cbr+%2F%3E%0A" 
 
} 
 

 
console.log(decodeURIComponent(response.whois).replace(/\+/g, ' '));

+0

ありがとうございますが、 "+"を指定しないで有効なjsonに出力したいのですが... –

+0

この場合、サーバーからの戻り値を変更する必要があります。 JSはそれに影響を与えることはできません。私はあなたのPHPコードを含む、それに関する新しい質問を開始することをお勧めします。 –

関連する問題