Einzelnen Beitrag anzeigen

Gandalfus

Registriert seit: 19. Apr 2003
407 Beiträge
 
Delphi 2006 Professional
 
#17

Re: Der DP-Wettbewerb: Die Sieger stehen fest.

  Alt 26. Mai 2004, 11:44
Was ich allgeimein schade fand war, dass es mehr ein Designwettbewerb als ein Programmierwetbewerb war.

wenns ein Interessiert eine Lösung ohne XML Komponenten:
Delphi-Quellcode:
procedure update;
var
  AngeforderteSeite: String;
  ErstellerName: string;
  ProfilLink: string;
  Zeit: string;
  Nachricht: string;
  index,count: integer;
begin
  AngeforderteSeite := IdHTTP.Get('http://www.delphipraxis.net/rdf.php?shoutbox=1');
  while Pos('<shout>', AngeforderteSeite) > 0 do
  begin
    index := pos('<username>', AngeforderteSeite)+length('<username>');
    count := pos('</username>', AngeforderteSeite)-index;
    ErstellerName := copy(AngeforderteSeite,index,count);
    index := pos('<profile>', AngeforderteSeite)+length('<profile>');
    count := pos('</profile>', AngeforderteSeite)-index;
    ProfilLink := copy(AngeforderteSeite,index,count);
    index := pos('<timestamp>', AngeforderteSeite)+length('<timestamp>');
    count := pos('</timestamp>', AngeforderteSeite)-index;
    Zeit := copy(AngeforderteSeite,index,count);
    index := pos('<![CDATA[ ', AngeforderteSeite)+length('<![CDATA[ ');
    count := pos(']]> ', AngeforderteSeite)-index;
    Nachricht := copy(AngeforderteSeite,index,count);
    delete(AngeforderteSeite,1,index+count);

    //Mache was mit ErstellerName,ProfilLink,Zeit,Nachricht
  end;
end;
  Mit Zitat antworten Zitat