English > Scripts and Templates
Allmovie Script
Ivek23:
--- Quote from: Ivek23 on February 01, 2011, 03:52:48 pm ---In cahill-us-marshall-commemorative-packaging the Street Date Source code
--- Code: --- <tr>
<td colspan="3" class="artist">
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td><div id="left-sidebar-title"><span>Street Date</span></div></td></tr>
<tr><td><img src="http://images.allmediaguide.com/spacer.gif" height="1" width="1"></td></tr>
<tr><td class="formed-sub">May 22, 2007</td></tr>
</tbody></table>
</td>
</tr>
</tr>
--- End code ---
the script but I have used this code
--- Code: ---//Street Date
AddCustomFieldValueByName('Street Date', HTMLValues(HTML,
'<span>Street Date</span>', '</table>',
'<li>', '</li>',
', ', EndPos));
--- End code ---
or this code
--- Code: ---//Street Date
AddCustomFieldValueByName('Street Date', HTMLValues(HTML,
'<span>Street Date</span>', '</table>',
'<li>', '</li>',
', ', EndPos));
EndPos := PosFrom('class="formed-sub"', HTML, curPos);
--- End code ---
but not one or the other code is not working properly (other data transfers, but not for Street Date).
What did I do wrong?
--- End quote ---
Solution:
The above-mentioned codes I replaced it with this here.
--- Code: ---//Street Date
AddCustomFieldValueByName('Street Date', HTMLValues(HTML,
'<span>Street Date</span>', '</table>',
'<td class="formed-sub">', '</td>',
', ', EndPos));
--- End code ---
Instead, '<li>', '</li>', I switched to this '<td class="formed-sub">', '</td>', and work.
Ivek23:
I found a solution to the AMG Work ID http://www.allmovie.com/work/the-matrix-177524 or AMG DVD ID http://www.allmovie.com/dvd/cahill-us-marshall-commemorative-packaging-161910
Code is added under Description or Features (DVD releases)
--- Code: ---
//Description
curPos := PosFrom('<td align="left" class="title">Plot Synopsis</td>', HTML, EndPos);
TmpStr := TextBetween(HTML, '<td colspan="2"><p>', '</p></td>', True, curPos);
TmpStr1 := StringReplace(TmpStr, ' -- ', '—', True, True, False);
TmpStr2 := StringReplace(TmpStr1, '--', '—', True, True, False);
AddFieldValue(mfDescription, TmpStr2);
//Features (DVD releases)
curPos := PosFrom('<td class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', HTML, EndPos);
TmpStr := TextBetween(HTML, '<td class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', '>View DVD Releases</a></td>', False, curPos);
TmpStr1 := StringReplace(TmpStr, '» <a href=', '', True, True, False);
If TmpStr1 <> '' then
AddCustomFieldValueByName('Feature', '<link url=' + TmpStr1 + '>DVD Releases</link>');
//AMG Work ID
AddCustomFieldValueByName('AMG WID', HTMLValues(HTML,
'<span>AMG Work ID</span>', '</table>',
'<td class="formed-sub"><pre>', '</pre></td>',
', ', EndPos));
end;
--- End code ---
or
--- Code: ---
//AMG DVD ID
AddCustomFieldValueByName('AMG DVD ID', HTMLValues(HTML,
'<span>AMG DVD ID</span>', '</table>',
'<td class="formed-sub"><pre>', '</pre></td>',
', ', EndPos));
--- End code ---
then work script normal elsewhere the script is not working normally.Path data in custom field.
Ivek23:
--- Quote ---
AMG DVD ID
--- End quote ---
http://www.allmovie.com/dvd/cahill-us-marshall-commemorative-packaging-161910
Ivek23:
--- Quote from: Ivek23 on June 20, 2010, 03:53:06 pm ---I have a question:
Would it be possible (if at all possible), how to make the code for Similar Works and Other Related Works for example at this site: http://www.allmovie.com/work/the-matrix-177524
Maybe even both codes in a custom field, for example in the field Awards.
Thanks for the reply and effort in advance.
--- End quote ---
Partly I found the code for the Similar Works and Other Related Works but fails to find a solution so please help.
Here are examples of what the partial results, I came.
Example 1.) :
Code:
--- Code: ---//Features (Similar Works)
curPos := PosFrom('<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', HTML, EndPos);
TmpStr := TextBetween(HTML, '<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', '>Similar Works</td>', False, curPos);
TmpStr1 := StringReplace(TmpStr, '» <a href=', '', True, True, False);
If TmpStr1 <> '' then
AddCustomFieldValueByName('Similar Works', TmpStr1);
//Features (Other Related Works)
curPos := PosFrom('<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', HTML, EndPos);
TmpStr := TextBetween(HTML, '<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', '>Other Related Works</td>', False, curPos);
TmpStr1 := StringReplace(TmpStr, '» <a href=', '', True, True, False);
If TmpStr1 <> '' then
AddCustomFieldValueByName('Other Related Works', TmpStr1);
--- End code ---
Result:
--- Quote ---Links to other sites The dedication to my favorite movie! The Matrix Reloaded The Album The Matrix Community The official website <td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;"
--- End quote ---
or
--- Quote ---Links to other sites The dedication to my favorite movie! The Matrix Reloaded The Album The Matrix Community The official website Similar Works Blade Runner (1982, Ridley Scott) Total Recall (1990, Paul Verhoeven) Logan's Run (1976, Michael Anderson) Johnny Mnemonic (1995, Robert Longo) Dark City (1998, Alex Proyas) 12:01 (1993, Jack Sholder) Demon Seed (1977, Donald Cammell) Metropolis (1927, Fritz Lang) The Aries Computer The Fifth Element (1997, Luc Besson) <td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;"[
--- End quote ---
On this page http://www.allmovie.com/work/the-matrix-177524 so, where is just Similar Works has a score of zero downloads,but where, in addition Similar Works and Other Related Works is the result of only the transfer of Similar Works data in folder Other Related Works.
Example 2.) :
Code:
--- Code: ---//Features (Similar Works)
curPos := PosFrom('<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">Similar Works</td>',HTML, EndPos);
AddCustomFieldValueByName('Similar Works', TextBetween(HTML,'<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', '</td>', True, curPos));
//Features (Other Related Works)
curPos := PosFrom('<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">Other Related Works</td>',HTML, EndPos);
AddCustomFieldValueByName('Other Related Works', TextBetween(HTML,'<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">', '</td>', True, curPos));
end;
--- End code ---
Result:
--- Quote ---Similar Works
--- End quote ---
or
--- Quote ---Other Related Works
--- End quote ---
Example 3.) :
Code:
--- Code: ---//Features (Similar Works)
curPos := PosFrom('<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">Similar Works</td>', HTML, EndPos);
TmpStr := TextBetween(HTML, '<td>', '</td>', False, curPos);
TmpStr1 := StringReplace(TmpStr, '» <a href=', '', True, True, False);
If TmpStr1 <> '' then
AddCustomFieldValueByName('Similar Works', TmpStr1);
//Features (Other Related Works)
curPos := PosFrom('<td colspan="2" class="large-list-title" style="padding-top: 13px; padding-bottom: 1px;">Other Related Works</td>',HTML, EndPos);
TmpStr := TextBetween(HTML, '<td align="right" width="150">', '<td>', False, curPos);
TmpStr1 := TextBetween(HTML, '<td>', '</td>', False, curPos);
TmpStr1 := StringReplace(TmpStr, ' <td align=', '', True, True, False);
TmpStr2 := StringReplace(TmpStr1, '<td>', '', True, True, False);
TmpStr2 := StringReplace(TmpStr1, '» <a href=', '', True, True, False);
If TmpStr2 <> '' then
AddCustomFieldValueByName('Other Related Works', TmpStr2);
--- End code ---
Result:
--- Quote ---Blade Runner (1982, Ridley Scott)
--- End quote ---
or
--- Quote ---Is followed by:
--- End quote ---
Here are transferred only the first type of data.
[attachment deleted by admin]
Ivek23:
Picture Part 2
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version