English > Support
Year, Country, Duration for in the movie or people script
(1/1)
Ivek23:
Sorry if already posted the same topic.
I help edit the script (for people), but they are certain problems about data transfer for the year.
I know it helps me a part of this code for example
--- Code: ---if Pos('1978', TmpStr) > 0 then TmpStr1 := TmpStr1 + 'b. 1978';
TmpStr := StringReplace(TmpStr, '1978', '', true, true, true);
--- End code ---
but it is quite time-consuming work by Whereas this piece of code re-need to write at least a hundred times.
It is necessary to insert all years between 1900 and 2000 .
I wonder if this is possible to edit in a different and more simple way.
nostra:
I do not understand the question :/
Do you need to find years in the source code of a web page or do you need to produce years from 1900 to 2000 for some other purpose?
Ivek23:
--- Quote from: nostra on December 15, 2011, 01:30:46 am ---I do not understand the question :/
Do you need to find years in the source code of a web page or do you need to produce years from 1900 to 2000 for some other purpose?
--- End quote ---
For both mentioned.
It would need to function of year for birthday and death fields.
When it appears in the info data for example, such data b. 1911 and d. 1986 then transferred to the above mentioned fields.
Ivek23:
The question of different records for the length of the movies:
Example 1:
The source code the length of the movie the web site:
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">72 mins</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">72 minutes</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">1 hr 12 mins</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">Doll Prod., 72 mins.</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">Doll Prod., 1 hr 12 mins.</td>
--- End code ---
Example 2:
The source code the length of the movie the web site:
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">112 mins</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">112 minutes</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">1 hr 52 mins</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">Video, 112 mins.</td>
--- End code ---
or
--- Code: ---<tr><td valign="top">Notes: </td><td width="100%" class="notes">Video, 1 hr 52 mins.</td>
--- End code ---
This code
--- Code: ---//Duration
curpos := Pos('<td valign="top">Notes: ' , HTML);
LogMessage('getting durations')
EndPos := PosFrom(' min', HTML, curPos);
curPos := EndPos - 2;
Tmp := IntToStr(StrToInt(Copy(HTML, curPos, 2)));
LogMessage('Duration: ' + Tmp);
If Tmp <> '' then AddFieldValue(mfDuration, Tmp);
--- End code ---
in example 1 works only for first source code, the second source code and for the fourth source code, in example 2 works only for first source code, the second source code and for the fourth source code, but there appears only what is in minutes.
I wonder or it may be in one piece of code, if it is of course possible to do.
Navigation
[0] Message Index
Go to full version