| 1 | |
| 2 | [[PageOutline(3-4, Sections)]] |
| 3 | |
| 4 | == SearchMoviesOnIMDB == |
| 5 | |
| 6 | search for a movie |
| 7 | |
| 8 | === Intro === |
| 9 | |
| 10 | |
| 11 | ---- |
| 12 | === Description === |
| 13 | |
| 14 | '''struct SearchMoviesOnIMDB(string $token, string $query)''' |
| 15 | |
| 16 | Searches for movies matching given movie title $query. |
| 17 | |
| 18 | Returns array of movies ''data'' found on IMDb.com and in internal server movie database. |
| 19 | |
| 20 | Manually added movies can be identified by ID starting at 10000000. |
| 21 | |
| 22 | |
| 23 | ---- |
| 24 | === Parameters === |
| 25 | |
| 26 | {{{ |
| 27 | struct( |
| 28 | (string) [token], |
| 29 | (string) [query] |
| 30 | ) |
| 31 | }}} |
| 32 | |
| 33 | ''token (required)'':: |
| 34 | token string identifying user's session, taken from [wiki:XmlRpcLogIn LogIn] output structure. |
| 35 | ''query (required)'':: |
| 36 | movie title user is searching for, this is cleaned-up a bit (remove ''dvdrip'', etc.) before searching |
| 37 | |
| 38 | |
| 39 | ---- |
| 40 | === Return Values === |
| 41 | |
| 42 | Output is returned in this structure: |
| 43 | {{{ |
| 44 | struct( |
| 45 | (string) [status], |
| 46 | array( |
| 47 | struct( |
| 48 | (string) [id], |
| 49 | (string) [title] |
| 50 | ) [movie], |
| 51 | struct( |
| 52 | (string) [id], |
| 53 | (string) [title] |
| 54 | ) [movie], |
| 55 | |
| 56 | ... more movie matches go here (if any) ... |
| 57 | |
| 58 | ) [data], |
| 59 | (double) [seconds] |
| 60 | ) |
| 61 | }}} |
| 62 | |
| 63 | and contains these elements: |
| 64 | ''status'':: |
| 65 | function result code, see [wiki:XmlRpcStatusCode list of status codes] |
| 66 | ''data'':: |
| 67 | array containing information about movies matching given title $query |
| 68 | ''movie'':: |
| 69 | structure holding movie information: |
| 70 | * ''id'': movie's ID on IMDb |
| 71 | * ''title'': movie title |
| 72 | ''seconds'':: |
| 73 | time taken to execute this command on server |
| 74 | |
| 75 | |
| 76 | ---- |
| 77 | === Implementations === |
| 78 | |
| 79 | There are currently no available sample implementations. |
| 80 | |
| 81 | |
| 82 | ---- |
| 83 | === Changelog === |
| 84 | |
| 85 | Version 1: created this function |
| 86 | |
| 87 | |
| 88 | ---- |
| 89 | === Examples === |
| 90 | |
| 91 | |
| 92 | ==== Input ==== |
| 93 | |
| 94 | {{{ |
| 95 | #!xml |
| 96 | <methodCall> |
| 97 | <methodName>SearchMoviesOnIMDB</methodName> |
| 98 | <params> |
| 99 | <param> |
| 100 | <value><string>tjr2fesccqriijpoc6bjda8d94</string></value> |
| 101 | </param> |
| 102 | <param> |
| 103 | <value><string>back to the future</string></value> |
| 104 | </param> |
| 105 | </params> |
| 106 | </methodCall> |
| 107 | }}} |
| 108 | |
| 109 | |
| 110 | ==== Output ==== |
| 111 | |
| 112 | {{{ |
| 113 | #!xml |
| 114 | <methodResponse> |
| 115 | <params> |
| 116 | <param> |
| 117 | <value> |
| 118 | <struct> |
| 119 | <member> |
| 120 | <name>status</name> |
| 121 | <value><string>200 OK</string></value> |
| 122 | </member> |
| 123 | <member> |
| 124 | <name>data</name> |
| 125 | <value> |
| 126 | <array> |
| 127 | <data> |
| 128 | <value> |
| 129 | <struct> |
| 130 | <member> |
| 131 | <name>id</name> |
| 132 | <value><string>0088763</string></value> |
| 133 | </member> |
| 134 | <member> |
| 135 | <name>title</name> |
| 136 | <value><string>Back to the Future (1985)</string></value> |
| 137 | </member> |
| 138 | </struct> |
| 139 | </value> |
| 140 | <value> |
| 141 | <struct> |
| 142 | <member> |
| 143 | <name>id</name> |
| 144 | <value><string>0096874</string></value> |
| 145 | </member> |
| 146 | <member> |
| 147 | <name>title</name> |
| 148 | <value><string>Back to the Future Part II (1989)</string></value> |
| 149 | </member> |
| 150 | </struct> |
| 151 | </value> |
| 152 | |
| 153 | ... more movie matches go here (if any) ... |
| 154 | |
| 155 | </data> |
| 156 | </array> |
| 157 | </value> |
| 158 | </member> |
| 159 | <member> |
| 160 | <name>seconds</name> |
| 161 | <value> |
| 162 | <double>0.622</double> |
| 163 | </value> |
| 164 | </member> |
| 165 | </struct> |
| 166 | </value> |
| 167 | </param> |
| 168 | </params> |
| 169 | </methodResponse> |
| 170 | }}} |
| 171 | |
| 172 | |
| 173 | ---- |
| 174 | === Notes === |
| 175 | |
| 176 | none yet |
| 177 | |
| 178 | |
| 179 | ---- |
| 180 | === See also === |
| 181 | |
| 182 | * [wiki:XmlRpcInsertMovie InsertMovie()] |
| 183 | |
| 184 | |
| 185 | ---- |
| 186 | === Comments === |
| 187 | |
| 188 | add your comments, hints and suggestions here if you like ... |
| 189 | |
| 190 | |
| 191 | -------- |
| 192 | [Prev] [wiki:XmlRpcIntro Home] [Next] |