Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 21.07.02 10:34 
Wie kann ich Begriffe, die der User meines Proggis in eine EditBox eintippt in Googel suchen lassen ??

Man muss ide Begriffe irgendwie dem Google Script übergeben, nur ich habe keinen Plan, wie ich z.B. ein Pluszeichen (+) so umwandeln kann, dass Google das kapiert !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Currywurst
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50

Win XP Pro
D3 Pro, D5 Std, D6 Pers
BeitragVerfasst: So 21.07.02 11:35 
wenn die suchbegriffe durch leerzeichen getrennt in edit1 stehen dann z.b. so:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure LinkOeffnen(const Url: string);
//oeffnet eine seite im standardbrowser
begin
  ShellExecute(0, 'open', PChar(Url), nil, nil, SW_SHOWNORMAL);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  LinkOeffnen('http://www.google.de/search?q=' + StringReplace(Edit1.Text, ' ', '+', [rfReplaceAll]));
end;


und wenn du (aus welchen gründen?) ein + selber mit übergeben willst, dann halt wie üblich umwandeln, %2B
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 21.07.02 13:16 
cool danke, aber wie überstezt man alle andresen zeichen wie z.B. einn Punkt oder ein Minus ??

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: So 21.07.02 13:47 
Ganz einfach: Gibt doch mal bei Google diese Zeichen ein. Dann siehste in der URL wie das gemacht werden muss damit Google es versteht!

Gruß
Currywurst
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50

Win XP Pro
D3 Pro, D5 Std, D6 Pers
BeitragVerfasst: So 21.07.02 14:01 
Titel: hab grad langeweile
ohne garantie das es so einwandfrei ist:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function TextZuAnderemTextOderSo(const Text: String): String;
const
  OK = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var
  i: Integer;
begin
  Result:='';
  for i:=1 to Length(Text) do begin
    if Pos(Text[i], OK)>0 then Result:=Result + Text[i] else
     Result:=Result + '%' + IntToHex(Ord(Text[i]), 2);
  end;
end;
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 21.07.02 16:15 
danke :D Ich werde das mal austesten !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
mth
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 34



BeitragVerfasst: Mo 22.07.02 01:42 
matze hat folgendes geschrieben:
Wie kann ich Begriffe, die der User meines Proggis in eine EditBox eintippt in Googel suchen lassen ??


Eine Alternative ist die Google API:
www.google.com/apis/

Beispiele für D6 kursieren im Web.