Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias xbmc {
- ; put the host and port to your XBMC web interface here
- set %xbmc.host 192.168.1.3
- set %xbmc.port 8080
- ; go to the following website and generate your
- ; digest from the credentials you use to access
- ; the xbmc web interface
- ; http://www.motobit.com/util/base64-decoder-encoder.asp
- ; enter username:password
- ; hit Convert
- ; put the result here
- set %xbmc.digest DIGEST HERE
- ; #### NO NEED TO EDIT BELOW THIS LINE ####
- sockopen xbmc.sock %xbmc.host %xbmc.port
- set %xbmc.window $active
- }
- on *:sockopen:xbmc.sock:{
- if ($sockerr) || (!$sock($sockname)) return
- sockwrite -n $sockname GET /xbmcCmds/xbmcHttp?command=getcurrentlyplaying HTTP/1.1
- sockwrite -n $sockname Authorization: Basic %xbmc.digest
- sockwrite -n $sockname $crlf
- }
- on *:sockread:xbmc.sock:{
- var %xbmc.read | sockread %xbmc.read
- ; if (!$1) || ($result == 5) return
- ; For debugging purposes:
- ;echo -s %xbmc.read
- if (<li>Type: isin %xbmc.read) {
- ;echo -s type %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Type:,, %xbmc.type)
- return
- }
- if (<li>Show Title: isin %xbmc.read) {
- ;echo -s show title %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Show Title:,, %xbmc.show)
- return
- }
- if (<li>Title: isin %xbmc.read) {
- ;echo -s Eptitle - %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Title:,, %xbmc.title)
- return
- }
- if (<li>Season: isin %xbmc.read) {
- ;echo -s Season - %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Season:,, %xbmc.season)
- return
- }
- if (<li>Episode: isin %xbmc.read) {
- ;echo -s Episode - %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Episode:,, %xbmc.episode)
- return
- }
- if (<li>Track: isin %xbmc.read) {
- ;echo -s Eptitle - %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Track:,, %xbmc.track)
- return
- }
- if (<li>Artist: isin %xbmc.read) {
- ;echo -s Artist - %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Artist:,, %xbmc.artist)
- return
- }
- if (<li>Album: isin %xbmc.read) {
- ;echo -s Year - %xbmc.read
- noop $regsub(, %xbmc.read, ^\<li\>Album:,, %xbmc.album)
- return
- }
- if (<li>Year: isin %xbmc.read) {
- ;echo -s Year - %xbmc.read
- noop $regsub(, %xbmc.read, ^<li>Year:,, %xbmc.year)
- return
- }
- if (</html> isin %xbmc.read) {
- ;echo -s Type: %xbmc.type
- ;echo -s Show: %xbmc.show
- ;echo -s Title: %xbmc.title
- ;echo -s Season: %xbmc.season
- ;echo -s Episode: %xbmc.episode
- ;echo -s Year: %xbmc.year
- ;echo -s Artist: %xbmc.artist
- ;echo -s Album: %xbmc.album
- ;echo -s Track: %xbmc.track
- if (%xbmc.show != $null) {
- set %xbmc.result Series: %xbmc.show - %xbmc.season $+ x $+ %xbmc.episode - %xbmc.title
- }
- elseif (%xbmc.type == video) {
- set %xbmc.result Movie: %xbmc.title ( $+ %xbmc.year $+ )
- }
- elseif (%xbmc.type == audio) {
- set %xbmc.result Music: %xbmc.artist - %xbmc.title $chr(91) $+ %xbmc.album $chr(40) $+ %xbmc.year $+ $chr(41) $+ $chr(93)
- }
- if (%xbmc.type) describe %xbmc.window np %xbmc.result (via XBMC)
- unset %xbmc.*
- return
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement