English > Scripts and Templates

Script: TheMovieDB [ES] (Easy API Script)

<< < (3/11) > >>

Ivek23:
Adding a script in English with some additional custom fields.

VVV_Easy_Programing:
 I think I've corrected the mistakes and make some improvements:

v 0.1.4.0   VVV: Clean URL to PVD (now estándar, same that TheMovieDB plugin 0.1.1.3).
                        Language Web info constant LANG_STR (easy adaptation to other languages).
                        Get USA 'contentRating' = MPAA

(Edito: New version down)

Ivek23:
I made a few corrections:

MPAA
1 a.) MPAA code I Fixed
--- Code: ---  //Get ~mpaa~ ~Release Rating~
    //endPos:=curPos;
HTML:=StringReplace(HTML,'-','',True,False,False);
HTML:=StringReplace(HTML,'PG13','PG-13',True,False,False);
    PVDField:='mpaa';                                                                                              //For easy programation
    WebFieldText:='      MPAA:';                                                                                   //Only for Debuging
    WebFieldOpen:='<img src="http://d3a8mw37cqal2z.cloudfront.net/assets/36eefb4c632941c/images/flags/us.png" />'; //WEB_SPECIFIC
    WebFieldBegin:='</span>';                                                              //WEB_SPECIFIC
    WebFieldEnd:='</p>';    //WEB_SPECIFIC
curPos:=GetPVDFieldOneValue(HTML,curPos,PVDField,WebFieldText,WebFieldOpen,WebFieldBegin,WebFieldEnd);

--- End code ---


1 b.) MPAA code I've moved since then more correct data transfer
--- Code: ---  //Get ~Lenght~. (User option GET_LENGTH)
    if GET_LENGTH then begin
      PVDField:='length';                         //For easy programation
      WebFieldText:='      Length:';              //Only for Debuging
      WebFieldOpen:='<strong>Runtime:</strong>';  //Web only one value. WEB_SPECIFIC
      WebFieldBegin:='<span id="runtime">';       //WEB_SPECIFIC
      WebFieldEnd:='</span>';                     //WEB_SPECIFIC
      curPos:=GetPVDFieldOneValue(HTML,curPos,PVDField,WebFieldText,WebFieldOpen,WebFieldBegin,WebFieldEnd);
    end;

  //Get ~mpaa~ ~Release Rating~
    //endPos:=curPos;
HTML:=StringReplace(HTML,'-','',True,False,False);
HTML:=StringReplace(HTML,'PG13','PG-13',True,False,False);
    PVDField:='mpaa';                                                                                              //For easy programation
    WebFieldText:='      MPAA:';                                                                                   //Only for Debuging
    WebFieldOpen:='<img src="http://d3a8mw37cqal2z.cloudfront.net/assets/36eefb4c632941c/images/flags/us.png" />'; //WEB_SPECIFIC
    WebFieldBegin:='</span>';                                                              //WEB_SPECIFIC
    WebFieldEnd:='</p>';    //WEB_SPECIFIC
curPos:=GetPVDFieldOneValue(HTML,curPos,PVDField,WebFieldText,WebFieldOpen,WebFieldBegin,WebFieldEnd);
--- End code ---

2 .) procedure ParseSearchResults I fixed it cleaned URL:

--- Code: ---const
// Web delimiters. Null '' value it's not valid. WEB_SPECIFIC
    WebSearchListOpen = '<ul class="search_results movie">';                    //String which opens the Web Search List data. WEB_SPECIFIC
    WebSearchResultOpen = '<div class="poster">';                               //String which opens the Web Result data. WEB_SPECIFIC
    WebSearchResultPreviewURLOpen = '<a href="';                                  //String which opens the Web Result PreviewURL data. WEB_SPECIFIC
    WebSearchResultPreviewURLBegin = '" src="';                              //String which opens the Web Result PreviewURL text. WEB_SPECIFIC
    WebSearchResultPreviewURLEnd = '" width';                                 //String which closes the Web Result PreviewURL text. WEB_SPECIFIC
    WebSearchResultDataOpen = '<div class="info">';                             //String which opens the Web URL+Title+Year data. WEB_SPECIFIC
    WebSearchResultURLBegin = '<h3><a href="';                                  //String which opens the Web Result URL text. WEB_SPECIFIC
    //WebSearchResultURLEnd = '" t';                                               //String which closes the Web Result URL text. WEB_SPECIFIC
    WebSearchResultURLEnd = '-';                                               //String which closes the Web Result URL text. WEB_SPECIFIC
WebSearchResultTitleBegin = 'itle="';                                      //String which opens the Web Result Title text. WEB_SPECIFIC
    WebSearchResultTitleEnd = '">';                                              //String which closes the Web Result Title text. WEB_SPECIFIC
    WebSearchResultYearBegin = 'span>(';                                       //String which opens the Web Result Year text. WEB_SPECIFIC
    WebSearchResultYearEnd = ')</span>';                                        //String which closes the Web Result Year text. WEB_SPECIFIC
procedure ParseSearchResults(HTML:String);
--- End code ---

Attached to the TheMovieDB_[ES]_2014_mod script.


And yet:

Composers is Composer field in PVD.

--- Code: ---'3_CreditType' composer
--- End code ---

VVV_Easy_Programing:
Thank you very much another time Ivek23. I think I've corrected the mistakes you point me.
CHANGE LOG:
 v 0.1.5.0   VVV: 'Set_CustomField' 'Set' for sagas(Part Of The)
                 Ivek23: MPAA code I've moved since then more correct data transfer (after Length)
                 Ivek23&VVV: MPAA code I Fixed (Now prevents movies not Released in USA or with not MPAA information)
                 Ivek23: Procedure ParseSearchResults I fixed it cleaned URL (End of URL '-')
                 VVV: Detect movies not traslated to LANG_STR.

(Edito: New version down)

Ivek23:
Compliment is a welcome.

I apologize for the delayed response, the fault lies in the extremely bad weather from Thursday onwards, particularly bad weather from Sunday till today [across the country (Slovenia) was a few cm Ice hug and thus remained a lot of people, even without electricity, also with us].

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version