Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;~ Project name: NowPlaying
- ;~ Description: Simple application that fetches current track from Spotify and dumps it into a txt-file that Xsplit Broadcaster can read to automatically update your stream.
- ;~ Project started: 2012-05-11
- ;~ Last update: 2012-07-21 see changelog.txt
- ;~ Author: Fredrik Ivanov (numrii@gmail.com)
- ;~ License: Use freely but please give credit where credit is due!
- ; Sets the location of the config file so you can change some stuff!
- Local $conf = IniRead("config.ini", "Settings", "key", "Somethings wrong with config.ini, restore your backup and try again!")
- TrayTip("Success!", "NowPlaying is now loaded.", 3)
- While 1
- ; Fetch Title of Spotify window and remove "Spotify - " from the title
- Local $title = StringTrimLeft(WinGetTitle("Spotify"), 10)
- ; Replace the weird "-" from spotify with a proper dash to separate Artist - Track
- Local $final = StringReplace($title, " รขโฌโ ", " - ", 0, 0)
- ; Open File in overwrite mode - Place the spotify.txt in the same directory as this script.
- Local $file = FileOpen("spotify.txt", 2)
- ; Check if file opened for writing OK
- If $file = -1 Then
- MsgBox(0, "Error", "Unable to open file.")
- Exit
- EndIf
- ; Write current track to file spotify.txt
- FileWriteLine($file, $conf & $final)
- ; Close file
- FileClose($file)
- ; Sleep for 10 seconds
- Sleep(10000)
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement