Public feed #891989

Stuff

public text v1 · immutable
Raw Edit
·published 2008-02-05 01:46 UTC
rendered paste body
divnostyle := pos('<div class=g>',s);
        divstyle := pos('<div class=g style=',s);
        if ((divnostyle > -1)
          AND ((divnostyle < divstyle)
          OR (divstyle = 0))) then
             begin
                s :=Str_CIGetAfter(s,'<div class=g>');
                URL := Trim(Str_CIGetBetween(s, 'href="', '"'));
             end
        else if ((divstyle > -1)
          AND ((divstyle < divnostyle)
          OR (divnostyle = 0))) then
            begin
              s :=Str_CIGetAfter(s,'<div class=g style=');
              s :=Str_CIGetAfter(s,'>');
              URL := Trim(Str_CIGetBetween(s, 'href="', '"'));
            end;

This is your code with one change:

The OR statements had to be = 0 rather than = -1 which your original code had.

I was getting 5-6 results but it seemed to STOP after the final divstyle was found.  When setting to = 0, it found them all.  That was frustrating the heck out of me since we originally worked on it.