Similar to the preceding example, use 'HTTP: // clients1.google.cn/complete/search? & Q = '+ "keyword" to obtain the Google Keyword search ranking.
The result obtained by using Delphi as the keyword is:
Window. google. AC. H (["Delphi", [["Delphi tutorial", "375,000 results", "0"], ["Delphi box", "74,900 results", "1"], ["Delphi download", "1,580,000 results", "2"], ["Delphi7 download", "1,600,000 results", "3"], ["What is Delphi ", "497,000 results", "4"], ["Delphi string function", "352,000 results", "5"], ["Delphi7 serial number", "302,000 results ", "6"], ["delphi2009 download", "20,600 results", "7"], ["Delphi7", "1,330,000 results", "8"], ["delphi2009 official Version Download", "5,710 results", "9"])
The preceding result is in window. google. AC. H (...) the following operation is to give isuperobject a name named "window. google. AC. h.
Run:
Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) memo1: tmemo; edit1: tedit; button1: tbutton; Procedure button1click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} uses MSXML, superobject; function toutf8encode (STR: string): string; var B: byte; begin for B in bytesof (utf8encode (STR) do r Esult: = format ('% S %. 2x ', [result,' % ', B]); end; Procedure proc (const this, Params: isuperobject; var result: isuperobject); var JO: isuperobject; begin form1.memo1. clear; for Jo In Params ['1'] Do With form1.memo1. lines do form1.memo1. lines. add (Jo. format ('% 2%: % 0%-% 1%'); end; Procedure tform1.button1click (Sender: tobject); const u = 'HTTP: // clients1.google.cn/complete/search? & Q = '; var JO: isuperobject; Req: ixmlhttprequest; Url: widestring; begin JO: = So; Jo. M ['window. google. AC. h']: = @ proc; Url: = u + toutf8encode (edit1.text); Req: = coxmlhttp. create; req. open ('get', URL, false, emptyparam, emptyparam); req. send (emptyparam); JO [req. responsetext]; end.