Yahoo YQL - list all tracks of a Release - yql

In my current free-time project I am trying to fetch all songs from a given album.
Anyone, in Yahoo YQL, how is it possible to list all tracks of a given Release id?

You can influence what is returned as part of the results of queries to the music.release.id table by specifying a response value. In this case, you want track information for a release, so ask for tracks.
select * from music.release.id where ids="148083" and response="tracks"
Also see the Release Service and
Release List responses documentations.

Related

How to list Watch Later list in APIv3?

Since youtube APIv3 revision on September 15, 2016, the Watch Later list id cannot be found in channels.contentDetails.relatedPlaylists.watchLater as it contains fixed string WL.
The revision states:
...
The channel resource's contentDetails.relatedPlaylists.watchHistory
and contentDetails.relatedPlaylists.watchLater properties now contain
values of HL and WL, respectively, for all channels.
To be clear, these properties are only visible to an authorized user
retrieving data about the user's own channel. The properties always
contain the values HL and WL, even for an authorized user retrieving
data about the user's own channel. Thus, the watch history and watch
later playlist IDs cannot be retrieved via the API.
...
The last part is pretty intriguing since I can't imagine how to obtain my WL id, hence I can't list the videos I've saved for later.
I checked also reddit and other SO questions (one, two, three, four) but without success. They usually suggest v2 or v3 before the mentioned revision.
The question: How can I obtain ids of my watch later videos?
I can only confirm what you already stated. If it is deprecated form API it is not possible to retrieve videos form that particular playlist. It is bound to be some ugly web scraping solution if it is a matter of getting it done no matter the cost.

How to list the deleted contacts by Microsoft Graph API

I want to do a sync action in my client side, so need to know how to get all deleted contact list.
By the api (GET /me/contacts), I could get all contact list
But it wastes much time when the user has large contacts.
This api (GET /me/contacts/{id}) tell us the contact is exist or not.
it is inefficient to check every contacts are deleted or not for me.
Which apis do I use? thanks for your help.
Why not use the delta query preview in the /beta endpoint? That should do what you want.
More efficient way for you to check which contacts were removed is getting just the list of contact ID's and then doing the diff between list of ID's returned by graph, and local list.
You can use query parameters to retrieve just the ID's of the contacts, instead of getting the whole objects.
Method url:
https://graph.microsoft.com/v1.0/me/contacts?$select=id

How to retrieve recording relationship on release browse request on musicbrainz

i'm currently getting needed information from musicbrainz, using the following
browse request, browsing a specific artists releases + recordings.
for example: (coldplay)
http://musicbrainz.org/ws/2/release?artist=cc197bad-dc9c-440d-a5b5-d52ba2e14234&fmt=json&inc=recordings
im interested in getting for each recording its work id.
now i tried adding 'recording-rels' to the includes but it seems only to return relationship between release and recording.
I also tried adding 'recording-level-rels' to includes as mentioned here
where it states that it should return recordings relationships, but when i try using it - i get the following error:
{"error":"recording-level-rels is not a valid inc parameter for the release resource."}
Am I using it wrongly?
To clarify, i'm after the relationship that you get from their site, say from this page, where each release has recording of that contains a link to the musicbrainz work id page.
Any help\advice would be very appreciated,
Thank you.
Well, like you said: What you are doing is a browse request and the relationships you linked only work for release lookups.
So you can't get this information with one request.
The simple solution for this is to use:
http://musicbrainz.org/ws/2/release?artist=cc197bad-dc9c-440d-a5b5-d52ba2e14234
to get all releases (without recordings) and for every release:
http://musicbrainz.org/ws/2/release/bfae6df7-3ee2-4031-ac09-8dc63c6ce6ca?inc=recordings+recording-level-rels+work-rels
to get the associated works.
The above method has the problem that you need one request for every release.
You can do better if you do some matching on your end.
You can get your list(s) of recordings with
http://musicbrainz.org/ws/2/release?artist=cc197bad-dc9c-440d-a5b5-d52ba2e14234&inc=recordings
and the works with:
http://musicbrainz.org/ws/2/work?artist=cc197bad-dc9c-440d-a5b5-d52ba2e14234&inc=recording-rels
Using this information you can then match the works with the recordings on the releases.
Alternatively you can also get all recordings using
http://musicbrainz.org/ws/2/recording?artist=cc197bad-dc9c-440d-a5b5-d52ba2e14234&inc=work-rels
but there are usually more recordings and less works. Meaning there is not always a work attached to every recording.
Note that this method also needs more than 2 requests when you need to use limit/offset to get multiple pages of results.
The link to the API documentation about relationships is for MBID lookups and works only for them. So this here works for example:
http://musicbrainz.org/ws/2/recording/7137bd5b-7f93-40c0-a780-53784a8f6c5d?inc=work-rels
But in a browse query, which you are doing, this relatioship cannot be queried. I guess you have two options:
Query first all recordings by artist, then fetch work relations like
above.
Use something in the lines of http://musicbrainz.org/ws/2/artist/cc197bad-dc9c-440d-a5b5-d52ba2e14234?fmt=json&inc=recording-rels+work-rels and see if you can get the information you want out of that.

In Twitter API How to check a tweet has been deleted on twitter if I check it via a Tweet id saved in my database

I have used Twitter API for fetching the tweets with a particular hash tag and all the data stored in my database.
I am currently working in core PHP.
API is working fine, thanks to Twitter
Now problem comes with the deleted tweets, Actually when a record of 100 latest tweets comes on my ajax file directly I store them in my database with a flag visible="y" . Now I want that if any of tweet stored in my database is being deleted from responsive twitter account automatically set visible = "N" into my database.
I searched a lot on internet but I could not find any respected answer.
Please reply me and ask me if any further information is needed.
Thanks to Stack Overflow for a good community.
The only way to do what you're suggesting, is to run some process that reads the tweets from your database and checks to see if they are still there.
You can call https://api.twitter.com/1.1/statuses/lookup.json and pass it a comma-delimited list of 100 tweets, and then compare the return value to your database to see if the tweets you asked for are still available or not.
You will have to iterate through your database 100 tweets at a time. Depending on how many tweets you are storing, you may run into rate limit issues.
You can make the status lookup call wit map parameter set to true. It will return null for deleted or protected tweets. It is more reliable way when compare to map set to false, because many a times lookup call doesn't return tweets even if it is not deleted (esp. for retweets).

Amazon Product API - How to get items for sale by price?

I have a strage requirement from a client, he needs to display a ramdom selection (100 - 200 items from mixed categories) of products for sale on & shipped by Amazon but ordered by price. The idea is to allow people find gift ideas based a user input price point.
I have been looking through the API docs but cannot see an obvious way to find search by price, I am thinking of writing a script to "copy" large parts of the amazon product catalogue into a local database & have it update every few weeks, then use this for user searches, but this does not feel right / their must be a better way.
Has anyone any experience with this type of problem? Thanks!
You would want to use the Amazon Product Advertising API. Using this API you would want to perform a SearchIndex-ItemSearch query. Possible parameters to ItemSearch are available on the API Docs here
You can see in the docs that you cannot query by MinimumPrice and MaximumPrice on SearchIndex: All. However, if you search specific indexes, it allows you to do a price related search.
I would guess that you can agree with your client which categories should the items be from. Then you can just query them one by one.
Amazon's database changes very often. Hence, caching data for a week without updating may not be desirable.

Resources