pola niestandardowe - pobieranie z filmweb

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
athe
Posts: 170
Joined: 2013-06-01 20:26:24
Location: Poland

pola niestandardowe - pobieranie z filmweb

Post 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
antp
Site Admin
Posts: 9665
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
athe
Posts: 170
Joined: 2013-06-01 20:26:24
Location: Poland

Post 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;
admas
Posts: 90
Joined: 2006-07-23 06:54:31

Post 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.
athe
Posts: 170
Joined: 2013-06-01 20:26:24
Location: Poland

Post 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!
Post Reply