Need help.

I figured out what I need to do , but I have no idea how to again. I went to many other forums asking for help , including people I know , and other Q&A websites. None of them were able to help. I really hope you guys can.
I'll try to explain the best I can, so if something isn't understandable please let me know.
1)Read from database , from xf_user , column name steam_auth_id.
2)Define a variable with the data that it took from the database. ( Let's say $var )
3)Put the $var in the link. ( http://steamrep.com/api/beta/reputation/$var(or add ?json=1 at the end to make it json (Working example of the link: http://steamrep.com/api/beta/reputation/76561197971691194)
4)Get the XML or JSON contents , save it to the database under the same line ( user ) which it took $var from , but under the column named steam_rep

Few things:
I have complete rights to my database.
I have no control over the link, it's external.
Database MySQL
I need it done for every user in my database , and any future ones.