Instead of making new code I just took it from github.
Plus side is now I don't need to figure out how to translate the yahoo API call. downside is I need to add a copyright notice in my code