예제 #1
0
        public void MarkAsOver30Seconds()
        {
            RequestData _requestData = new RequestData(Method.markStreamKeyOver30Secs,
                grooveSharp.APIKey, grooveSharp.SessionKey);

            _requestData.AddParameter("streamKey", Key);
            _requestData.AddParameter("streamServerID", ServerID);

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);
        }
예제 #2
0
        public static IEnumerable<Song> searchSong(this GrooveSharp grooveSharp, string query)
        {
            try
            {
                RequestData _requestData = new RequestData(Method.getSongSearchResults, grooveSharp.APIKey);
                _requestData.AddParameter("query", query);
                _requestData.AddParameter("country", grooveSharp.GrooveCountry.ToJsonString());

                string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

                return Song.parseToList(grooveSharp, _response);
            }
            catch (GrooveException)
            {
                throw;
            }
        }
예제 #3
0
        public static IEnumerable<Playlist> searchPlaylist(this GrooveSharp grooveSharp, string query)
        {
            RequestData _requestData = new RequestData(Method.getPlaylistSearchResults, grooveSharp.APIKey);
            _requestData.AddParameter("query", query);

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

            return Playlist.parseToList(grooveSharp, _response);
        }
예제 #4
0
        public static string getAlbumSongs(this GrooveSharp grooveSharp, int albumID)
        {
            RequestData _requestData = new RequestData(Method.getAlbumSongs, grooveSharp.APIKey);

            _requestData.AddParameter("albumID", albumID);

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

            return _response;
        }
예제 #5
0
        public static string getSongURLFromSongID(this GrooveSharp grooveSharp, int songID)
        {
            RequestData _requestData = new RequestData(Method.getSongURLFromSongID,
                grooveSharp.APIKey, grooveSharp.SessionKey);

            _requestData.AddParameter("songID", songID);

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

            return _response;
        }
예제 #6
0
        public static IEnumerable<ISong> getSongsInfo(this GrooveSharp grooveSharp, IEnumerable<int> songID)
        {
            RequestData _requestData = new RequestData(Method.getSongsInfo,
                grooveSharp.APIKey, grooveSharp.SessionKey);

            _requestData.AddParameter("songIDs", songID.ToArray());

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

            return Song.parseToList(grooveSharp, _response);
        }
예제 #7
0
        public IEnumerable<ISong> GetSongs()
        {
            List<Song> _songs = new List<Song>();

            RequestData _requestData = new RequestData(Method.getPlaylistSongs, grooveSharp.APIKey);
            _requestData.AddParameter("playlistID", ID);

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

            return Song.parseToList(grooveSharp, _response);
        }
예제 #8
0
        public static IEnumerable<Album> searchAlbum(this GrooveSharp grooveSharp, string query)
        {
            try
            {
                RequestData _requestData = new RequestData(Method.getAlbumSearchResults, grooveSharp.APIKey);

                _requestData.AddParameter("query", query);

                string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

                return Album.getListOfAlbums(grooveSharp, _response);
            }
            catch (GrooveException)
            {
                throw;
            }
        }
예제 #9
0
        public ISubStream GetSubscriberStream()
        {
            RequestData _requestData = new RequestData(Method.getSubscriberStreamKey,
                grooveSharp.APIKey, grooveSharp.SessionKey);

            _requestData.AddParameter("songID", ID);
            _requestData.AddParameter("country", grooveSharp.GrooveCountry);

            string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

            return SubStream.parse(_response, grooveSharp);
        }
예제 #10
0
        public static User login(this GrooveSharp grooveSharp, string username, string md5Password)
        {
            try
            {
                RequestData _requestData = new RequestData(Method.authenticate,
                    grooveSharp.APIKey, grooveSharp.SessionKey);

                _requestData.AddParameter("login", username);
                _requestData.AddParameter("password", md5Password);

                string _response = grooveSharp.getResponse(grooveSharp.getUrl(_requestData), _requestData);

                if (_response.Contains("\"UserID\":0"))
                    throw new GrooveException("User not found!");

                User _user = User.Parse(grooveSharp, _response);

                return _user;
            }
            catch (GrooveException)
            {
                throw;
            }
        }