private void WriteFiles(RecentlyPlayedResponse response)
        {
            var formattedString = UserSettings.Format.Replace("$song", response.Song)
                                  .Replace("$artist", response.Artist).Replace("$album", response.Album);

            File.WriteAllText(UserSettings.OutputDirectory + "\\" + UserSettings.OutputFileName,
                              formattedString);
            File.WriteAllText(UserSettings.OutputDirectory + "\\" + "artist.txt",
                              response.Artist);
            File.WriteAllText(UserSettings.OutputDirectory + "\\" + "song.txt",
                              response.Song);
            File.WriteAllText(UserSettings.OutputDirectory + "\\" + "album.txt",
                              response.Album);
        }
        public void GetAndWriteFormattedString()
        {
            while (true)
            {
                while (IsPaused)
                {
                    Thread.Sleep(3000);
                }

                if (UserSettings.Username != null)
                {
                    try
                    {
                        var response = LastFmClient.GetRecentlyPlayedResponse(UserSettings.Username);
                        if (recentlyPlayed == response)
                        {
                            return;
                        }
                        WriteFiles(response);
                        recentlyPlayed = response;
                    }
                    catch (WebException ex)
                    {
                        var response = (HttpWebResponse)ex.Response;
                        switch (response.StatusCode)
                        {
                        case HttpStatusCode.NotFound:
                            var result =
                                MessageBox.Show(@"We couldn't find your user in Last.fm! Please check it!");
                            break;

                        default:
                            throw new ArgumentOutOfRangeException();
                        }
                    }
                    catch (IOException _)
                    {
                        MessageBox.Show(@"Couldn't write the file! Do you have permission to write to: " +
                                        UserSettings.OutputDirectory + @"\\" + UserSettings.OutputFileName);
                    }
                }

                Thread.Sleep(5000);
            }
        }