Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Spotify Now Playing by Mr. Ree <MrRee@6697.co.uk>
- * Support @ irc.6697.co.uk #6697
- * This will build an executable that outputs the title of the now playing track in your Windows Spotify player.
- * It can be used with just about any IRC client by using `/exec -o C:\path\to\SpotifyNowPlaying.exe`
- */
- using System;
- using System.Diagnostics;
- namespace SpotifyNowPlaying
- {
- class Program
- {
- static void Main( string[] args )
- {
- Process[] processlist = Process.GetProcesses();
- foreach ( Process process in processlist )
- {
- if ( !String.IsNullOrEmpty( process.MainWindowTitle ) )
- {
- if( process.ProcessName == "Spotify" )
- {
- string title = process.MainWindowTitle;
- Console.WriteLine( "NP: " + title );
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment