Quantcast
Channel: The Echo Nest Developer Forum
Viewing all articles
Browse latest Browse all 1582

Artist Biographies truncated: true

$
0
0

Hi, not sure if you are still having a problem with this but here is a solution:

Return all of the biographies. Iterate through each biographies and see if it contains the string/symbol/key "truncated." If not, push it into an array. You now have an array full of bios that are not truncated. Here is an example of my ruby code using parsed JSON.

The code works, but I am new to programming, so if the code is sloppy, suggestions are welcome.

bios = body['response']['artists'][0]['biographies']
full_bios = []
bios.each do |bio|
  if !(bio.include? "truncated")
    full_bios.push(bio)
  end
end
self.biography = full_bios[0]['text'] + "Source: " + full_bios[0]['url']

Viewing all articles
Browse latest Browse all 1582

Trending Articles