English > Development

TITLE UPDATE

<< < (2/2)

Ivek23:

--- Quote from: nika-model on December 09, 2013, 06:06:50 pm ---For Year I need only 4 digits from end and unformated date i save to Custom Field.
--- End quote ---

For Year maybe this help:


--- Code: ---//~mfYear~ or ~Year~

endPos := PosFrom('</span></h1>', HTML, curPos);
curPos := endPos - 5;
TmpStr2 := IntToStr(StrToInt(Copy(HTML, curPos, 4)));

if TmpStr2 = '0' then
TmpStr2 := '';

AddFieldValue(mfYear, TmpStr2);
AddCustomFieldValueByName('Year', TmpStr2);

if TmpStr2 = '' then
TmpStr2 := 'year unknown';

LogMessage(' Parsing: ' + TmpStr1 + '(' + TmpStr2 + ')');
--- End code ---

For Date maybe this help:


--- Code: ---procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, endPos : Integer;
Date, TmpStr, TmpStr1, TmpStr2, TmpStr3, TmpStr4, TmpStr5 : String;
DateParts: TWideArray;
begin

//Date ~Updated~ (choose simple or verbose version)
Date := DateToStr(CurrentDateTime);
if Date <> '' then
  begin
    ExplodeString(Date, DateParts, '-');
Date := DateParts[2] +'.'+ DateParts[1] +'.'+ DateParts[0];
AddCustomFieldValueByName('Updated', Date);  // Simple
  end else
    LogMessage('date not found');
--- End code ---

For the rest a little harder to help.

nika-model:
STOP.
I haven't Problem with another Fields.
ONLY TITLE is my problem. My scripts run well.

ONLY TITLE 

Date was example....

Ivek23:

--- Quote from: nika-model on December 10, 2013, 12:47:10 pm ---ONLY TITLE is my problem. My scripts run well.

ONLY TITLE
--- End quote ---

For TITLE I can not help it.

Navigation

[0] Message Index

[*] Previous page

Go to full version