English > Support

AllMovie Url in custom items

<< < (2/2)

Ivek23:
Now I found a partially correct code for AllMovie Url:

This code
--- Code: ---//Get URL
 EndPos := Pos('">Overview</a>', HTML);
 if EndPos > 0 then begin
  curPos := PrevPos('<a href="', HTML, EndPos);
    AddFieldValue(mfURL, Copy(HTML, curPos + 9, EndPos - curPos - 9));
 end else

  //AddFieldValue(mfURL, MovieURL); // Changed to:
AddCustomFieldValueByName('Url', '<link url="' + MovieURL + '">Url For Movie</link>');
--- End code ---
works properly but can not display AllMovie Url.

This code
--- Code: ---//Get URL
 EndPos := Pos('">Overview</a>', HTML);
 if EndPos > 0 then begin
  curPos := PrevPos('<a href="', HTML, EndPos);
    AddFieldValue(mfURL, Copy(HTML, curPos + 9, EndPos - curPos - 9));
 end else

  //AddFieldValue(mfURL, MovieURL); // Changed to:
AddCustomFieldValueByName('Url', '<link url="' + MovieURL + '">' + MovieURL + '</link>');
--- End code ---
is working properly and it appears that AllMovie Url.

Attached are pictures to prove it is indeed shown AllMovie Url.
I apologize for the first scan picture Before AllMovie Url logo can be seen as Portable Appz so I added an additional figure.


--- Quote from: rick.ca on June 08, 2010, 10:45:15 pm ---If you remove AddFieldValue(mfURL, MovieURL);, the URL will not be added to the URL field and the script will not be able to update the record without searching for it again. I suppose you could modify the script to use the new field, but I don't have a clue how to do that.

To display a URL as a hyperlink, use a memo field.

--- End quote ---

Rick.ca here is a partial answer to the second part of the reply(quote).

--- Quote ---I suppose you could modify the script to use the new field, but I don't have a clue how to do that.
--- End quote ---

In the first part still attached to the reply(quote).

--- Quote ---If you remove AddFieldValue(mfURL, MovieURL);, the URL will not be added to the URL field and the script will not be able to update the record without searching for it again.
--- End quote ---

--- Quote ---To display a URL as a hyperlink, use a memo field.
--- End quote ---
Only by hand not automatically.

[attachment deleted by admin]

Ivek23:
Final solution:
--- Code: ---//Get URL
 EndPos := Pos('">Overview</a>', HTML);
 if EndPos > 0 then begin
  curPos := PrevPos('<a href="', HTML, EndPos);
  AddFieldValue(mfURL, Copy(HTML, curPos + 9, EndPos - curPos - 9));
 end else
  AddFieldValue(mfURL, MovieURL);

//Get URL
 EndPos := Pos('">Overview</a>', HTML);
 if EndPos > 0 then begin
  curPos := PrevPos('<a href="', HTML, EndPos);
    AddFieldValue(mfURL, Copy(HTML, curPos + 9, EndPos - curPos - 9));
 end else

  //AddFieldValue(mfURL, MovieURL); // Changed to:
AddCustomFieldValueByName('Url', '<link url="' + MovieURL + '">' + MovieURL + '</link>');

--- End code ---

The first part of the code is changed back to original

--- Code: ---AddFieldValue(mfURL, MovieURL); // Changed to:
AddCustomFieldValueByName('AMG Url', MovieURL);
--- End code ---
changed to original
--- Code: ---AddFieldValue(mfURL, MovieURL);
--- End code ---

another piece of code is added to the new.
--- Code: ---//Get URL
 EndPos := Pos('">Overview</a>', HTML);
 if EndPos > 0 then begin
  curPos := PrevPos('<a href="', HTML, EndPos);
    AddFieldValue(mfURL, Copy(HTML, curPos + 9, EndPos - curPos - 9));
 end else

  //AddFieldValue(mfURL, MovieURL); // Changed to:
AddCustomFieldValueByName('Url', '<link url="' + MovieURL + '">' + MovieURL + '</link>');
--- End code ---


--- Quote ---If you remove AddFieldValue(mfURL, MovieURL);, the URL will not be added to the URL field and the script will not be able to update the record without searching for it again.
--- End quote ---

Now, the record be updated without a new search.

Ivek23:
A better and simple solution:
The URL is added to the url field as well as the custom field.


--- Code: ---//Get URL
 EndPos := Pos('">Overview</a>', HTML);
 if EndPos > 0 then begin
  curPos := PrevPos('<a href="', HTML, EndPos);
  AddFieldValue(mfURL, Copy(HTML, curPos + 9, EndPos - curPos - 9));
 end else
  AddFieldValue(mfURL, MovieURL);
 AddCustomFieldValueByName('Url', '<link url="' + MovieURL + '">' + MovieURL + '</link>');
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version