Would be great to fetch movies plot keywords from IMDb. In this example: http://www.imdb.com/title/tt0211915/keywords
There are 145 plot Keywords that would make browsing for a movie more accurate.
Looking into its html code, it's a matter of finding 'data-item-keyword' term. I'd love to know how to do it. In fact I could try for a while but having it made by someone who already know how to do it (and updating IMDb script for everyone) would be better.
In general it could be stored in Description field. I would change it here manually to write it in a custom field.
[REQ] Fetch IMDb Plot Keywords
-
- Posts: 17
- Joined: 2011-05-08 19:18:08
- Location: Brasil
- Contact:
-
- Posts: 17
- Joined: 2011-05-08 19:18:08
- Location: Brasil
- Contact:
I ended up doing it:
However, that code saves into a must-create-CustomField named Keywords[/code]
Code: Select all
// Keywords
begin
sleep(50);
Value := MovieUrl;
FullValue := ConvertToASCII(GetPage(Value+'/keywords'));
Value := TextBetween(FullValue, 'soda sodavote','</table>');
FullValue := '';
Value2 := StringReplace(TextBetween(Value, 'data-item-keyword="','">'),'-',' ');
while Value2 <> '' do
begin
Value := RemainingText;
if FullValue <> '' then
FullValue := FullValue + ', ';
FullValue := FullValue + Value2;
Value2 := StringReplace(TextBetween(Value, 'data-item-keyword="','">'),'-',' ');
end;
HTMLDecode(FullValue);
SetCustomField('Keywords', FullValue);
end;
// Trivia