In this assignment you are going to construct a python function that implements a music shopping assistant. You will pass the function the name of a recording artist and the function will determine the name of that artist's most recent release, do a web search to find pages that might offer that release for sale, and then return both the name of the recording and a URL to a page that appears to be most likely to be offering that title for sale.
I have written a solution for this assignment, and here are some examples of the results it returns:
recordingURL("Tame Impala")
{'release': 'The Slow Rush', 'url': 'https://www.ebay.com/p/2317114103'}
recordingURL("Robert Hood")
{'release': 'DJ Kicks: Robert Hood',
'url': 'https://k7records.bandcamp.com/album/dj-kicks-robert-hood'}
recordingURL("Flying Lotus")
{'release': 'Flamagra',
'url': 'https://sound-merch.com.au/collections/flying-lotus'}
recordingURL("Underworld (band)")
{'release': 'Barking', 'url': 'https://store.underworldlive.com/'}
Here are the steps your recordingURL() function should do:
To do the Wikipedia search you will use the Langchain WikipediaLoader class. One problem with that class is that it defaults to returning only the first 4000 characters from any query you ask it to do. For many artists it will take more then 4000 characters to get to the part of their Wikipedia page that lists the artist's discography. To overcome this character limitation, add the parameter doc_content_chars_max = 12000 when you are setting up the loader.