I’m learning ruby but am going to need some JS/Jquery for a small project I’m working on with a friend. We’re using the Last.fm api and are trying to build a page where we’re going to call from two different URL’s for Json data.
The main problem I’m running in to is, once I pull out the username, I need to store it as a variable and then insert it inside the ‘&user=rj&’ on get toptoptracks to be able to pull each users top tracks.
is what I have so far (also one for toptracks, reading up on nesting them now), but I’m not sure how to get their user name AND store it as a variable to use inside the top tracks (.each do for JS?).
If I understand the problem correctly, something like this might help get you started:
Note urlWithUser which accepts a user param and is used to generate specific endpoint for you.