English > Development
Script for egafd.com
pra15:
For Born,
First Declare variable :
PartBorn : Twidearray;
I : integer
Country, BirhtDay : String;
and after //Born :
--- Code: ---////////BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If partBorn[I] = 'b' then begin
Country := partBorn[I-1];
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
--- End code ---
I have not enough exemples of page with "Notes", but where i try it works.
We haven't day and month of birthday!
pra15:
For more security, in the case where there's text before country :
Declare more :
PartBorn2 : twidearray;
J : integer
--- Code: ---//BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If partBorn[I] = 'b' then begin
ExplodeString(partBorn[I-1], PartBorn2, ' ');
J := High(partBorn2);
Country := partBorn2[J];
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
--- End code ---
This works only with the type Hungarian. b. 1980 !
Ivek23:
If you do not mind tomorrow, now regulated and tests egafd_movie script, how it works, the result will be tomorrow.
pra15:
I have tested it,
two little errors fixed it :
--- Code: ---//BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If partBorn[I] = 'b' then begin
ExplodeString(partBorn[I-1], PartBorn2, ' ');
J := High(partBorn2);
Country := partBorn2[J];
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
If Copy(partBorn[I], length(partBorn[I])-2,3) = ', b' then begin
ExplodeString(partBorn[I], partBorn2, ',');
J := High(partBorn2);
ExplodeString(partBorn2[J-1], partBorn3, ' ');
J := High(partBorn3);
Country := partBorn3[J];
Birthday := '01/01/' + copy(partborn[I+1],0,4);
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
--- End code ---
It's ok for the two solutions!
Ivek23:
--- Quote from: Ivek23 on December 08, 2011, 07:24:05 pm ---If you do not mind tomorrow, now regulated and tests egafd_movie script, how it works, the result will be tomorrow.
--- End quote ---
I worked on tests to about 100 movie, adding a few accessories and made some correctionsso far and with a little delay is here egafd_mod7 script for movie attached.
I'm sorry, my mistake, added to the Cast wrong url code,
This is the right URL codes.
--- Code: ---// get url
UrlPosStart := PosFrom('href="', HTML, EndPos) + 6;
UrlPosEnd := PosFrom('">', HTML, UrlPosStart);
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart, UrlPosEnd - UrlPosStart));
LogMessage(URL);
--- End code ---
ADDED IS NOW ALSO CORRECT egafd_mod7 script for movie attached.
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version