I am working with mp3s and metadata. I have used Python to edit and add metadata to each file, but I cannot seem to get genres to work. I have used Pygn, a gracenote module that seems to be doing its job well. The problem is with the gracenote data itself. When I request data for, say daft punk, pygn.search(clientID=clientid, userID=userid, artist="Daft Punk", album="Random Access Memories")
I am returned a JSON as expected. The problem is that the genre key gives me a text anwser, and a number such as 45720. I was wondering if maybe there is some Dewey decimal-like system in place here. Do you know what system this is? Do you have an official gracenote genre list?
Gracenote does not provide genre list. But you can get the top level genre list of 25 genres through Rhythm API. Check out the fieldvalues API call on Gracenote Developer Program website.
Related
I'm trying to build an Alexa skill that mimics the functionality of the NPR skill. For example, assuming that the invocation name is "NPR", the dialogue would look something like this:
User: Alexa, open NPR
Alexa: 'Welcome, please tell me a ZIP code or city'
User: 44691
Alexa: In that ZIP code, there are two radio stations: radio1 and radio2 (example radio stations). Which one would you like to play?
User: radio1
(At this point, Alexa plays radio1)
So far, I have two slots {zip} and {city}. I have also made an intent named "ZiporCityIntent" that is supposed to catch the ZIP code or city that the user says. However, I am lost at this point and am not sure how to proceed. My goal is as follows:
To have Alexa take in the ZIP code or city input
To have Alexa look up the available radio stations at that ZIP code or city and list them to the user
To play the radio station specified by the user (from the available radio stations)
I would appreciate any advice or guidance. Thank you for your time.
I'll try to answer each of your questions separately.
Zip code may be hard to model as a custom slot. There isn't a built-in slot for that. You'd probably have to use the AMAZON.NUMBER slot type and create an intent with utterances that had multiple slots in them with that time. Painful to do I suspect and tough to ensure it'll be an accurate experience for your users. https://developer.amazon.com/en-US/docs/alexa/custom-skills/slot-type-reference.html#numbers-dates-times
As an alternative to asking for zip code, you could use location services to fetch the user's device's location. You will have to get permission from the user though. https://developer.amazon.com/en-US/docs/alexa/custom-skills/location-services-for-alexa-skills.html
There is a slot type, however, for cities. (See AMAZON.US_CITY https://developer.amazon.com/en-US/docs/alexa/custom-skills/slot-type-reference.html#list-types)
Is there an API you can use that takes in a zip code or city and gives you back a list of radio stations (an object with name and streaming URL, I imagine)? If not, perhaps you can go the simple route of define this mapping in your code. If it's not a super large data set, I could storing this as a JSON file.
Look into the AudioPlayer interface. Make sure the media format is compatible. https://developer.amazon.com/en-US/docs/alexa/custom-skills/audioplayer-interface-reference.html
I am trying to use the marketing developer platform api to pull reports for my campaigns.
I want to be able to break down my reports by campaign and then by creative name.
In the LinkedIn documentation (https://learn.microsoft.com/en-gb/linkedin/marketing/integrations/ads-reporting/ads-reporting#statistics-finder) they give examples of the statistics finder and say that it can pull up to 3 pivots.
This is the example they give:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=statistics&pivots[0]=CAMPAIGN&dateRange.start.day=1&dateRange.start.month=1&dateRange.start.year=2017&timeGranularity=DAILY&campaigns[0]=urn:li:sponsoredCampaign:1234567
I can't seem to get it to work for more than 1 pivot.
Another issue that I am facing is that I am not sure how to pull creative names - I can only seem to get creative ids in my api calls.
I am using the examples from to get campaign name:
https://learn.microsoft.com/en-gb/linkedin/shared/references/v2/ads/adcampaigns?context=linkedin/marketing/context
Looking at the creative name equivalent:
https://learn.microsoft.com/en-gb/linkedin/shared/references/v2/ads/adcreatives?context=linkedin/marketing/context
I cannot seem to find name for creatives here. Am I looking in the wrong place?
The magic sequence to get multiple pivots is:
...q=statistics&pivots[0]=ACCOUNT&pivots[1]=CAMPAIGN&pivots[2]=CREATIVE&...
As for creative names, they do not 'simply' exist. There are different fields (variables/data) for each type of creative, and what you would see in the UI depends on the type of campaign/creative displayed. For a simple Text Ad, it would be variables.data.title and variables.data.text. For the rest, you need to use projection to get specific fields from the urn's referenced.
I want to create a recommendation system of sorts, and I'm trying to find playlists with a given song in them to see what other songs people listen alongside that. Is there a way to do that using the Spotify API in Python?
Nope, there isn't. You could however use the endpoint https://api.spotify.com/v1/recommendationsto get related songs to a song. You give a song, artist and genre to Spotify and they give a playlist with similar songs back to you. That could allow you to achieve what you're trying to do.
I believe this is an example of a similar system in action
Playlist Miner
From the documentation i see that companies has only 'main' and don't have 'filmography' unlike persons, but are there a way to fetch movies for the chosen company? Maybe it's possible to see the list of 'Films in Production' and 'Past Film & Video'?
I try to populate the data for the company with related movies somehow, but 'main' stays an empty list.
I don't want to go through all the movies in the db in order to check if the company present there, as it seems to be very inefficient. I use 'http' access, as i don't need a data base copy locally.
my_company = ia.search_company('Walt Disney Pictures [US]')[0]
id = my_company.companyID
ia.get_company(id) # the only info i can get!
ia.update(my_company)
ia.get_company_infoset()
my_company.infoset2keys
Unfortunately, the IMDb web site changed the information on a company page, and right now IMDbPY is no longer able to collect other information beside the company's name and country.
I have opened an issue to describe the problem: https://github.com/alberanid/imdbpy/issues/198
I was searching for an already answered question about this but couldn't find one so please forgive me if I somehow missed it.
I'm using Google Books API and I know I can search a book by specific category.
My question is, how can I get all the available categories from the API?
I looked in the API documentation but couldn't find any mention of this.
The Google books api does not have an end point for returning Categories that are not associated with a book itself.
The Google Books api is only there to list books. You can
search and browse through the list of books that match a given query.
view information about a book, including metadata, availability and price, links to the preview page.
manage your own bookshelves.
You can see the category of a book you can not get a list of available categories in the whole system
You may be interested to know this has been on their todo list since 2012 category list
We have numerous requests for this and we're investigating how we can properly provide the data. One issue is Google does not own all the category information. "New York Times Bestsellers" is one obvious example. We need to first identify what we can publish through the API.
work around
i worked around it by implementing my own category list mechanism so i can pull all categories that exists in my app's database.
(unfortunately, the newly announced ScriptDb deprecation means my whole system will go to waste in a couple of monthes anyway... but that's another story)
https://support.google.com/books/partner/answer/3237055?hl=en
Scroll down to subject/genres and you will see this link.
https://bisg.org/page/bisacedition
This list is apparently a list of subjects AKA categories for North American Books. I am making various GET requests with an API testing tool and getting for the most part, perfect matches (you may have to drop a word from the query string. ex: "criticism" instead of "literary criticism") for whatever subject I choose from the BISG subjects list, and what comes back in the json response under the "categories" key.
Ex: GET https://www.googleapis.com/books/v1/volumes?q=business+subject:juvenile+fiction
Long story short, the BISG link is where I'm pretty sure Google got all the options for their "categories" key from.