How to retrieve recording relationship on release browse request on musicbrainz - 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.

Related

Trying to get analytics on Microsoft teams calls

I am trying to put together analytics on Microsoft teams calls. I would like to get hold times, number of transfers, call time, etc. I came across this call https://graph.microsoft.com/beta/communications/callRecords and it gives me a list of calls with call times, but I can't find a way to get hold times, what line it came in on, etc. Greatly appreciate any pointers.
First of all, this end point https://graph.microsoft.com/beta/communications/callRecords only allows you to query a single call record using its ID, it does not support querying a list of call records for the whole tenant or for a specific user.
The only way currently to find this ID to query the call record is by setting up a web hook to receive change notifications. Refer to the following documentation for more info on change notifications.
To directly address your question, i am not one hundred percent sure but i believe the information you're looking for could be found inside the list of sessions and segments inside a call record.

Get new emails with microsoft graph

I am trying to get only new emails with microsoft graph.
Iam doing this by checking date like
GET https://graph.microsoft.com/v1.0/me/messages?$filter=receivedDateTime+gt+2016-06-06T08:08:08Z
Is there any possibility to build query to get new messages but base on id instead of receivedDateTime? Something like: get messeges until you find id=....?
I think the delta query solution is pretty good (as suggested in a different answer). However, for my purposes, there were two major drawbacks: 1) it's in preview (beta) right now, so it makes it less than ideal for production code and 2) it doesn't seem to support the monitoring of all messages, just those in a particular folder.
I actually prefer the solution you're working with. The timestamp in the header of the response can be used to reset the time field in you query, so that if you have "receivedDateTime gt 12:00:00" and get back the server time of 12:01:00 for your request, you can use "receivedDateTime gt 12:01:00" next time.
The scenario you're looking for is specifically what the new Delta query is designed to support. Deltas allow you to retrieve changes to a given folder (i.e. Inbox) since you last polled that folder. Message IDs not static or consecutive so they're not a suitable property for determining new vs. old messages.

How do I get a realtime list of all seminars in a given room, filtered by time period, via Adobe Connect's API?

We are attempting to build free/busy calendars on our website for our Adobe Connect seminar rooms using data provided by the Adobe Connect API.
Our first attempt used sco-session-seminar-list. This returned data in the expected format and seemed to work perfectly. However, upon review we found that many existing sessions were not being returned. Some of the rooms do not have the API user setup as a host or presenter, so I suspect that may be causing a problem, though the user can see these sessions in the admin which indicates to me that they should have access.
We then tried report-bulk-objects. This did return all seminars as desired. However, it hits the reporting database which means that seminars created in the last 24 hours may not appear. Worse, it does not appear that there is any way to filter by room (or parent sco-id) using this method.
I cannot find any other relevant methods in the API documentation that would work better than the above two for our needs. However, it seems like a free/busy calendar should be a relatively common use of the API.
We finally found a non-intuitively named function that worked for this sort of information:
url="http://#AdobeConnectUrl#/api/xml
name="action" value="sco-expanded-contents">
name="sco-id" value="#roomID#">
name="filter-gte-date-begin" value="2015-01-01">
name="filter-lte-date-begin" value="2015-01-08">
This function will also work for a more informational calendar as it returns details other than just the start and end times (such as the seminar name). It pulls all sessions that occur under the sco-id requested, including those in subfolders. It also runs in real-time.

Twitter - public Stream handling deletion notices

I am using the Twitter public stream API to search for some keywords. I am writing my script in Java and therefore I use twitter4j. Now I stumbled over the information about status deletion notices:
Status deletion notices (delete)
These messages indicate that a given Tweet has been deleted. Client
code must honor these messages by clearing the referenced Tweet from
memory and any storage or archive, even in the rare case where a
deletion message arrives earlier in the stream that the Tweet it
references.
https://dev.twitter.com/docs/streaming-apis/messages#Status_deletion_notices_delete
So I created methods to remove records from my database when such a notice occurs. Unfortunately such a notice never occurs. I searched to find out what I am doing wrong and found some posts in the twitter developer section concerning the same problem:
https://dev.twitter.com/discussions/17393
https://dev.twitter.com/discussions/19943
https://dev.twitter.com/issues/1355
https://dev.twitter.com/discussions/12836
but unfortunately all these discussions got no answer. So for me it seems like I did no mistake with my code but twitter4j never sends me an deletion notice.
I want to respect the privacy of the twitter users - at least for legal reasons. So my question is:
What can I do to respect the privacy of the users ?
What do I have to do to satisfy my legal duties ?
One alternative seems to be to periodically iterate through all saved Tweets in my Database and request them from twitter to see whether I get a result back or not (so they were deleted). But this doesn't seem to be a practicable way because the data will get more and more and therefore at some point of time I will have limitations (in time, allowed twitter requests, ...). So what should I do?
Thanks in advance! Your help is greatly appreciated.
Ludwig
twitter4j v.3.0.6
Given the nature of the volume of tweets, it's unreasonable to assume that you would check to see if all the tweets are still there. You should make sure that you properly act on a delete notice from twitter. The onus is on them to actually send the delete notification.
That being said, I receive delete notifications from twitter. However, we aren't using the public stream, we are using sitestreams, which relies on authorizing specific social accounts and streaming all updates for those accounts (e.g. favorites, follows, blocks, tweets, retweets, etc) to us in realtime.
If you are doing a stream with filters, for example, it's probably not feasible (or at least very taxing) to run all deleted items through the same pipeline as new items. Or perhaps, to guess at which you were sent based on the times that you were running your filter.
As noted in the issue you linked to, the public streaming API will not necessarily send them out. I'd endeavor to handle them, and possibly provide a tool to manually remove any if a request comes in through another channel, but not worry too much about it, given that twitter doesn't provide the proper facility to be notified of such instances.

Searching for a song while using multiple API's

I'm going to attempt to create an open project which compares the most common MP3 download providers.
This will require a user to enter a track/album/artist name i.e. Deadmau5 this will then pull the relevant prices from the API's.
I have a few questions that some of you may have encountered before:
Should I have one server side page that requests all the data and it is all loaded simultaneously. If so, how would you deal with timeouts or any other problems that may arise. Or should the page load, then each price get pulled in one by one (ajax). What are your experiences when running a comparison check?
The main feature will to compare prices, but how can I be sure that the products are the same. I was thinking running time, track numbers but I would still have to set one source as my primary.
I'm making this a wiki, please add and edit any issues that you can think of.
Thanks for your help. Look out for a future blog!
I would check amazon first. they will give you a SKU (the barcode on the back of the album, I think amazon calls it an EAN) If the other providers use this, you can make sure they are looking at the right item.
I would cache all results into a database, and expire them after a reasonable time. This way when you get 100 requests for Britney Spears, you don't have to hammer the other sites and slow down your application.
You should also make sure you are multithreading whatever requests you are doing server side. Curl for instance allows you to pull multiple urls, and assigns a user defined callback. I'd have the callback send a some data so you can update your page with as the results come back. GETTUNES => curl callback returns some data for each url while connection is open that you parse it on the client side.

Resources