-
Notifications
You must be signed in to change notification settings - Fork 18
Taste Profile API Methods
Creates a taste profile.
Echowrap.taste_profile_create(:name => 'My new playlist', :type => 'song') =>
<Echowrap::TasteProfile:0x007fba29a48b58
@attrs={:status=>{:version=>"4.2", :code=>0, :message=>"Success"},
:type=>"general", :name=>"Tim's new profile", :id=>"CAUCTMD1404B479E02"}>
Methods on Echowrap::TasteProfile
Updates (adds or deletes) items from a taste profile. The body of the post should include an item block that describes modifications to the taste profile.
When a taste profile is updated, the contents of the taste profile are resolved to Echo Nest IDs. This resolving process happens asynchronously to the call. The update method returns a 'ticket' that can be used with the catalog/status call to check on the status of the update.
Echowrap.taste_profile_update(:id => 'CAUCTMD1404B479E02', :data=> data) =>
<Echowrap::TasteProfile:0x007fe5229b39a8
@attrs={:status=>{:version=>"4.2", :code=>0,
:message=>"Success"}, :ticket=>"CAUCTMD1404B479E023314231A25E348"}>
Methods on Echowrap::TasteProfile
Retrieve the catalog-level key/values that are stored in the Taste Profile
Echowrap.taste_profile_keyvalues(:id => 'CAUCTMD1404B479E02') =>
<Echowrap::TasteProfile:0x007fba2a1df7e0
@attrs={:status=>{:version=>"4.2", :code=>0, :message=>"Success"},
:type=>"song", :name=>"My new playlist", :id=>"CAOFJWE1404B479F94"}>
Methods on Echowrap::TasteProfile
Increment the playcount for the given items by the given count
Echowrap.taste_profile_play(:id => 'CAUCTMD1404B479E02', :item => 'NewCat-SOYRTFI1374C384A00') =>
true
Increment the skip count for the given items by the given count
Echowrap.taste_profile_skip(:id => 'CAUCTMD1404B479E02', :item => 'NewCat-SOYRTFI1374C384A00', :skips => 5) =>
true
Indicates that the given items have been favorited or unfavorited.
Echowrap.taste_profile_favorite(:id => 'CAUCTMD1404B479E02', :item => 'NewCat-SOYRTFI1374C384A00') =>
true
Indicates that the given items have been banned or unbanned.
Echowrap.taste_profile_ban(:id => 'CAUCTMD1404B479E02', :item => 'NewCat-SOYRTFI1374C384A00') =>
true
Apply the given rating to the given items
Echowrap.taste_profile_rate(:id => 'CAUCTMD1404B479E02', :item => 'NewCat-SOYRTFI1374C384A00', :rating => 7) =>
true
Checks the status of a taste profile update.
Echowrap.taste_profile_status(:ticket => 'CAUCTMD1404B479E023314231A25E348') =>
<Echowrap::Status:0x007fb9a4288768
@attrs={:status=>{:version=>"4.2", :code=>0, :message=>"Success"},
:total_items=>1, :items_updated=>1, :percent_complete=>100.0,
:ticket_status=>"complete", :update_info=>[]}>
Get basic information on a taste profile
Echowrap.taste_profile_profile(:id => 'CAUCTMD1404B479E02') =>
<Echowrap::TasteProfile:0x007fb03c1e2118
@attrs={:resolved=>1, :pending_tickets=>[], :name=>"Tim's new profile",
:created=>"2013-08-04T21:41:59Z", :total=>1, :type=>"general",
:id=>"CAUCTMD1404B479E02"}>
Methods on Echowrap::TasteProfile
Returns data stored in the taste profile. Also returns Echo Nest IDs for items that have been resolved to Echo Nest IDs along with information requested via bucket. If item_id is not set, all items (subject to the limits of the start and results parameters) are returned, otherwise, only the items explicitly specified by item_id are returned.
Echowrap.taste_profile_read(:id => 'CAUCTMD1404B479E02', :item_id => 'NewCat-SOYRTFI1374C384A00') =>
<Echowrap::TasteProfile:0x007ff1739c6280
@attrs={:items=>[], :type=>"general",
:id=>"CAUCTMD1404B479E02", :name=>"Tim's new profile"}>
Methods on Echowrap::TasteProfile
Returns feeds based on the artists in a taste profile. Unlike catalog/read method, the catalog/feed method interleaves items and sorts them by date.
Echowrap.taste_profile_feed(:id => 'CAUCTMD1404B479E02') =>
[#<Echowrap::Feed:0x007fddf1206fd0
@attrs={:name=>"Freddie Mercury and Michael Jackson Duets Set For Release",
:url=>
"http://www.antimusic.com/news/13/July/30Freddie_Mercury_and_Michael_Jackson_Duets_Set_For_Release.shtml",
:summary=> content too long to print here see the Echowrap::Feed object for it's return values>]
Deletes the entire taste profile. Only the API key used to create a taste profile can be used to delete that taste profile.
Echowrap.taste_profile_delete(:id => 'CAUCTMD1404B479E02') =>
Echowrap::TasteProfile:0x007ffa52201710
@attrs={:status=>{:version=>"4.2", :code=>0, :message=>"Success"},
:id=>"CAUCTMD1404B479E02"}>
Methods on Echowrap::TasteProfile
Returns a list of all taste profiles created on this key
Echowrap.taste_profile_list =>
[<Echowrap::TasteProfile:0x007fc57c2368f8
@attrs={:name=>"My new playlist", :created=>"2013-08-04T21:41:59Z",
:last_modified=>"2013-08-04T21:41:59Z", :total=>0, :type=>"song",
:id=>"CAOFJWE1404B479F94"}>, <Echowrap::TasteProfile:0x007fc57c2368d0
@attrs={:name=>"Tim's Second Test Profile", :created=>"2013-05-20T01:06:19Z",
:last_modified=>"2013-05-20T01:08:41Z", :total=>5, :type=>"song",
:id=>"CAUMJHW13EBF7904AE"}>, <Echowrap::TasteProfile:0x007fc57c2368a8
@attrs={:name=>"Tim's Test Profile", :created=>"2013-05-19T17:36:29Z",
:last_modified=>"2013-05-19T17:57:29Z", :total=>5, :type=>"song",
:id=>"CAVSCUQ13EBDDD2DB9"}>, <Echowrap::TasteProfile:0x007fc57c236880
@attrs={:name=>"Tim's new profile", :created=>"2013-08-04T21:41:59Z",
:last_modified=>"2013-08-04T21:45:58Z", :total=>1, :type=>"general",
:id=>"CAUCTMD1404B479E02"}>]
Methods on Echowrap::TasteProfile
Returns a list of all taste profiles that are similar to the given set of taste profiles. This method returns similar taste profiles of the given use type. Similarity search is restricted to taste profiles that were created with the caller's API key.
Echowrap.taste_profile_similar(:id => 'CAUCTMD1404B479E02') =>
[<Echowrap::TasteProfile:0x007fd762ada3e0
@attrs={:name=>"Tim's Second Test Profile", :created=>"2013-05-20T01:06:19Z",
:last_modified=>"2013-05-20T01:06:19Z", :score=>0.007013859,
:total=>5, :type=>"song", :id=>"CAUMJHW13EBF7904AE"}>,
<Echowrap::TasteProfile:0x007fd762ada3b8 @attrs={:name=>"Tim's Test Profile",
:created=>"2013-05-19T17:36:29Z", :last_modified=>"2013-05-19T17:36:29Z",
:score=>0.006766811, :total=>5, :type=>"song", :id=>"CAVSCUQ13EBDDD2DB9"}>]
Methods on Echowrap::TasteProfile
Access the taste profile attributes.
Taste Profile Attributes are scores and summaries that can help developers more easily leverage the capabilities of Echo Nest Taste Profiles. These attributes are calculated for each individual Taste Profile, and are based on the musical characteristics we've seen that help describe a listener musically. In this alpha release, we are making the following attributes available:
- Diversity - measures the overall diversity of a listener’s taste by mapping the "distance" between musical styles present in the Taste Profile.
- Mainstreamness - measures the overall familiarity of a user’s listening activity to determine preference for either mainstream or more obscure music.
- Freshness - measures listening habits to determine how much a user cares about new album releases vs. sticking with older music.
- Adventurouness - measures how open the listener is to music outside of his or her musical comfort zone.
In addition, the method allows you to access helpful histogram buckets across a listener's Taste Profile:
- Top styles - a list of the styles that appear in a taste profile, and counts of the occurrence of each.
- Top years - a list of start years for the artists in a taste profile, and counts for each year.
- Audio features - bucketed breakdowns of the energy, danceability, loudness, and tempo bands of the songs that appear in a taste profile, and counts for each bucket. (This category requires a song-based profile.)
Echowrap.taste_profile_predict(:id => 'CAUCTMD1404B479E02', :category => 'adventurousness') =>
<Echowrap::TasteProfile:0x007fc3309c96e0
@attrs={:name=>"Tim's new profile", :type=>"general",
:id=>"CAUCTMD1404B479E02", :predictions=>{:adventurousness=>0.7290806063847874}}>
Methods on Echowrap::TasteProfile