Programming noob here. Just wondering what the best way to extract specific bits of information from a string is with Ruby.
I have some xml from an api that looks like this:
<users>
<user>
<twitter_screen_name>Jason</twitter_screen_name>
<kscore>81.78</kscore>
</user>
</users>
I just want to get the username and kscore out.
Heres what I've got, just wondering if theres a more efficient way?
info = Array.new
username = info[3].split('>')
username = username[1].split('<')
username = username[0]
klout = info[4].split('>')
klout = klout[1].split('<')
klout = klout[0]
Thanks