Esempio n. 1
0
        /// <summary>
        /// Safest search.
        /// </summary>
        /// <param name="parameters">Parameters object</param>
        /// <returns></returns>
        public string ArtistSearch(Parameters parameters)
        {
            string artist;

            string urlSuffix = "artist/search?api_key=" + APIKey + parameters.ArtistSearchString() + parameters.ArtistBucketString();
            artist = echo.DownloadString(urlSuffix);
            return artist;
        }
Esempio n. 2
0
        /// <summary>
        /// Overload for ArtistSearch; searches for an artist or ID given parameters. Will throw an exception if artist or id parameter is set on Parameters object.
        /// </summary>
        /// <param name="search">String of artist name or ID</param>
        /// <param name="parameters">Parameters object</param>
        /// <returns></returns>
        public string ArtistSearch(string search, Parameters parameters)
        {

            // TODO: Add exception.
            string artist;

            if (search != parameters.artistSearchParameters.name) { parameters.artistSearchParameters.name = null; }
            string urlSuffix = "artist/search?api_key=" + APIKey + query.NameOrArtistId(search) + parameters.ArtistSearchString() + parameters.ArtistBucketString();
            artist = echo.DownloadString(urlSuffix);

            return artist;
        }
Esempio n. 3
0
 /// <summary>
 /// Gets the top artists for a genre
 /// </summary>
 /// <param name="name">Genre name</param>
 /// <param name="bucket">Artist bucket parameters</param>
 /// <param name="limit">Limit to Rosetta ID.</param>
 /// <returns></returns>
 public string GenreArtists(string name, Parameters bucket, bool limit = false)
 {
     string urlSuffix = "genre/artists?api_key=" + APIKey + "&name=" + name + bucket.ArtistBucketString();
     if (limit == true) { urlSuffix = urlSuffix + "&limit=true"; }
     string json = echo.DownloadString(urlSuffix);
     return json;
 }
Esempio n. 4
0
 public string SongSearch(Parameters parameters)
 {
     string urlSuffix = "song/search?api_key=" + APIKey + parameters.SongSearchString() + parameters.SongBucketString();
     string json = echo.DownloadString(urlSuffix);
     return json;
 }
Esempio n. 5
0
 public string SongProfile(string id, Parameters parameters)
 {
     string urlSuffix = "song/profile?api_key=" + APIKey + query.SongOrTrackId(id)
         + parameters.ArtistBucketString();
     string json = echo.DownloadString(urlSuffix);
     return json;
 }
Esempio n. 6
0
 public string SongSearch(string search, Parameters parameters)
 {
     if (search != parameters.songSearchParameters.artist) { parameters.songSearchParameters.artist = null; }
     string urlSuffix = "song/search?api_key=" + APIKey + query.ArtistOrArtistId(search) + parameters.SongSearchString() + parameters.SongBucketString();
     Console.WriteLine(urlSuffix);
     string json = echo.DownloadString(urlSuffix);
     return json;
 }
Esempio n. 7
0
        /// <summary>
        /// Top Hott for artists
        /// </summary>
        /// <param name="bucket">Parameters object (only bucket options are relevant)</param>
        /// <returns>json string</returns>
        public string ArtistTopHottt(Parameters bucket)
        {
            // todo: implement genre search

            string json;
            Parameters bucketProcess = new Parameters();
            string parameters = bucketProcess.ArtistBucketString();
            string urlSuffix = "artist/top_hottt?api_key=" + APIKey + parameters;
            json = echo.DownloadString(urlSuffix);
            return json;
        }
Esempio n. 8
0
 /// <summary>
 /// Get similar artists
 /// </summary>
 /// <param name="search">string of artist name or ID</param>
 /// <param name="parameters">Parameters object</param>
 /// <param name="results">number of results to get (default = 15)</param>
 /// <returns>json string</returns>
 public string ArtistSimilar(string search, Parameters parameters, int results = 15)
 {
     string json;
     string urlSuffix = "artist/similar?api_key=" + APIKey + query.NameOrArtistId(search);
     if (results != 15) { urlSuffix += "&results=" + results; }
     json = echo.DownloadString(urlSuffix);
     return json;
 }
Esempio n. 9
0
 /// <summary>
 /// Extract any artists from a string
 /// </summary>
 /// <param name="search">String containing artist text</param>
 /// <returns>json string</returns>
 public string ArtistExtract(string search, Parameters parameters, int results = 15)
 {
     string json;
     string urlSuffix = "artist/extract?api_key=" + APIKey + query.NameOrArtistId(search);
     json = echo.DownloadString(urlSuffix);
     return json;
 }
Esempio n. 10
0
        /// <summary>
        /// Gets the artist profile (or most relevant profile)
        /// </summary>
        /// <param name="search">string of artist name or ID</param>
        /// <param name="bucket">Parameters object (only bucket options are relevant)</param>
        /// <returns>json string</returns>
        public string ArtistProfile(string search, Parameters bucket)
        {
            string json;
            Parameters bucketProcess = new Parameters();
            string parameters = bucketProcess.ArtistBucketString();
            string urlSuffix = "artist/profile?api_key=" + APIKey + query.NameOrArtistId(search) + parameters;

            json = echo.DownloadString(urlSuffix);
            return json;
        }