| 875 | == !SetSubscribeUrl == |
| 876 | '''array !SetSubscribeUrl( $token, $url )''' |
| 877 | Set webhook $url. Use HTTP (HTTPS was not tested). Example $url can be 'http://www.opensubtitles.org/addons/webhook-test.php'. To this url will be POSTed results of !SubscribeToHash() |
| 878 | Example output: |
| 879 | {{{ |
| 880 | Array |
| 881 | ( |
| 882 | [status] => 200 OK |
| 883 | [data] => URL for webhook was set: http://www.opensubtitles.org/addons/webhook-test.php |
| 884 | [seconds] => 0.031 |
| 885 | ) |
| 886 | }}} |
| 887 | |
| 888 | '''Fields explanation:''' |
| 889 | All field are self-explained. |
| 890 | |
| 891 | == !SubscribeToHash == |
| 892 | '''array !SubscribeToHash( $token, array ($moviehash, $moviehash, ... ) )''' |
| 893 | Subscribes to $moviehash. Once subtitle is linked to $moviehash, !SearchSubtitles() results are POSTed to $url (set in !SetSubscribeUrl()). This method is implementation of webhook, it is useful, when you got some moviehashes and you don't want to scan OpenSubtitles for subtitles for performance reason. |
| 894 | |
| 895 | Example output: |
| 896 | {{{ |
| 897 | Array |
| 898 | ( |
| 899 | [status] => 200 OK |
| 900 | [data] => Subscribed to 3 moviehashes |
| 901 | [seconds] => 0.033 |
| 902 | ) |
| 903 | }}} |
| 904 | '''Fields explanation:''' |
| 905 | All field are self-explained. |
| 906 | |
| 907 | |