Page 1 of 1

pola niestandardowe - pobieranie z filmweb

Posted: 2013-06-01 20:32:58
by athe
jak pobrać dane z filmweb.pl do pól niestandardowych, może ktoś podpowiedzieć?
how to take info from filmweb to non standard fields? Sorry for my english

Posted: 2013-06-01 20:45:56
by antp
If you want to store an info into another field than what the script uses you can search for the SetField calls in the script and replace them by SetCustomField (see the help for the right syntax).
But if you want to import extra info not yet imported by the script, it will require bigger changes.

Posted: 2013-06-01 21:15:05
by athe
Thank You for fast reply, antp. I wonna take info from actorsfield. They are info about screenwriter, music, cinematographer, etc. I make new non standard fields for these info. This is parts of a filmweb script:

Code: Select all

Value := '';

	if GetOption('CzyDodDaneWPoluAktorzy') >= 2 then
  begin
 	// Scenariusz (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-screenwriter');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Scenariusz: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Trim(Value));
    end;

	// Muzyka (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-music');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Muzyka: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Value);
    end;

	// Zdjęcia (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-cinematographer');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Zdjęcia: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Value);
    end;

	// Montaż (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-montage');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Montaż: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Value);
    end;

	// Scenografia (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-productionDesigner');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Scenografia: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Value);
    end;

	// Kostiumy (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-costumeDesigner');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Kostiumy: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Value);
    end;

	// Dźwięk (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-sound');
    if (Length(Value) > 0) then
    begin
      Value := GetField(fieldActors) + #13#10 + 'Dźwięk: ' + Trim(Value) + '; ';
    	SetField(fieldActors, Value);
    end;
  end;

	Page.Free;
	ActorsPage.Free;
end;
when i replace SetField with SetCustomField i have error.

Code: Select all

Value := '';

	if GetOption('CzyDodDaneWPoluAktorzy') >= 2 then
  begin
 	// Scenariusz (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-screenwriter');
    if (Length(Value) > 0) then
    //begin
   //   Value := GetField(fieldActors) + #13#10 + 'Scenariusz: ' + Trim(Value) + '; ';
    	SetCustomField(fieldScenariusz, Trim(Value));
   // end;

Posted: 2013-06-02 06:34:13
by admas
Zamień linie w skrypcie na poniższe

Code: Select all

 	// Scenariusz (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-screenwriter');
	if (Length(Value) > 0) then
  	SetField(fieldWriter, Trim(Value));

	// Muzyka (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-music');
	if (Length(Value) > 0) then
  	SetField(fieldComposer, Trim(Value));
Pobiera bezpośrednio do nowych pól, a nie do pola obsada

Code: Select all

	// Zdjęcia (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-cinematographer');
	if (Length(Value) > 0) then
  	SetCustomField('Cinematographer', Trim(Value));

	// Montaż (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-montage');
	if (Length(Value) > 0) then
  	SetCustomField('Editor', Trim(Value));

	// Scenografia (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-productionDesigner');
	if (Length(Value) > 0) then
  	SetCustomField('ProductionDesigner', Trim(Value));

	// Kostiumy (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-costumeDesigner');
	if (Length(Value) > 0) then
  	SetCustomField('CostumeDesigner', Trim(Value));

	// Dźwięk (2009-02-17 by jlatk)
  	Value := GetMaterials(Page, 'role-sound');
	if (Length(Value) > 0) then
  	SetCustomField('Sound', Trim(Value));
    end;
Musisz mieć pola niestandardowe z tagami: Cinematographer, Editor, ProductionDesigner, CostumeDesigner, Sound, aby pobrać do nich wartości, a nie do pola obsada.

Posted: 2013-06-02 08:15:37
by athe
Pięknie dziękuję za odpowiedź. Zmiana (change)

Code: Select all

SetCustomField(fieldEditor, Trim(Value));
na (to)

Code: Select all

SetCustomField('Editor', Trim(Value));
pięknie załatwiła sprawę. Wielkie dzięki! Working perfectly, thank you very much!