Is it possible to perform the following kind of streaming filter (pseudocode)?
(track = "shooter" and location = "Miami") or (track = "flood" and location="Los Angeles") or ...
I think it might not be possible because of the following (quoted from the documentation):
The track, follow, and locations fields should be considered to be
combined with an OR operator.
No, this is not possible. You would need to use the enterprise PowerTrack API.
Related
I currently use something like https://www.googleapis.com/youtube/v3/search?part=id&order=date&channelId=CHANNELID&maxResults=1&type=video&key=KEY and I want to be able to retrieve only the latest video and to totally exclude shorts.
How can I achieve this? 🤔
The Youtube search method
Will allow you to search for things like keyword, location, events, your own videos and related videos.
There is no way to filter or limit videos returned. Your only hope would be to sort them out locally when you get the results.
You may want to add a feature request here there is this one but it's really old Search API: More flexible/logical videoDuration requests
(sorry its my 1st time answering at stackoverflow, so might not be descriptive)
if you you use youtube serch method
then you'll realise that shorts description are assigned as empty string "" where as the videos have some description . so with an if condition like below can slove your problem (js)
if(!(video.snippet.description == ""))
First of all please share if there is any MSGraph SDK official documentation anywhere that I can use for reference.
I have a scenario, where I want to query all manager and member links from AAD without providing the user and group objectID respectively. This is currently supported in DQ channel, i.e. I can do something like this using MsGraphSDK:
MsGraphClient.Users.Delta().Request().Select("manager")
OR
MsGraphClient.Groups.Delta().Request().Select("members")
I don't want to use DQ for initial-sync due to performance problems, and other issues.
My fallback option is to query through Graph directly, so I want to do something like the following, but this doesn't return any result:
MsGraphClient.Users.Request().Select("manager")
OR
MsGraphClient.Groups.Request().Select("members")
It looks like this isn't even supported currently at the lower (AADGraph) layer. Please correct me if I am wrong, and provide a solution if any!
So my fallback approach is to pull all the user and group aadObjectIds, and explicitly query the manager and member links respectively.
In my case, there can potentially be 500K User-Objects in AAD, and I want to avoid making 500K separate GetManager calls to AAD. Instead, I want to batch the Graph requests as much as possible.
I wasn't able to find much help from the Internet on sending Batch requests through SDK.
Here's what I am doing:
I have this BatchRequestContent:
var batchRequestContent = new BatchRequestContent();
foreach (string aadObjectId in aadObjectIds)
{
batchRequestContent.AddBatchRequestStep(new BatchRequestStep(aadObjectId, Client.Users[aadObjectId].Manager.Request().GetHttpRequestMessage()));
}
and I am trying to send a BatchRequest through GraphSDK with this content to get a BatchResponse. Is this currently supported in SDK? If yes, then what's the procedure? Any documentation or example? How to read the batch-response back? Finally, is there any limit for the # of requests in a batch?
Thanks,
Here is a related post: $expand=manager does not expand manager
$expand is currently not supported on the manager and directReports relationships in the v1.0 endpoint. It is support in the beta endpoint but
the API returns way to much throw away information: https://graph.microsoft.com/beta/users?$expand=manager
The client library partially supports Batch at this time although we have a couple of pull requests to provide better support
with the next release (PR 1 and 2).
To use batch with the current library and your authenticated client, you'll do something like this:
var authProv = MsGraphClient.AuthenticationProvider;
var httpClient = GraphClientFactory.Create(authProv);
// Send batch request with BatchRequestContent.
HttpResponseMessage response = await httpClient.PostAsync("https://graph.microsoft.com/v1.0/$batch", batchRequestContent);
// Handle http responses using BatchResponseContent.
BatchResponseContent batchResponseContent = new BatchResponseContent(response);
I want to listen to real time all the tweets which has #abc #def hashtags for example,
preferred language is Java but raw API is great too
I couldn't find the documentation that describes it
I don't have experience with twitter4j, but what you'll need to utilize their Streaming API example.
From that you'll need to include filter method.
A more detailed example is found in this example
FilterQuery fq = new FilterQuery();
String keywords[] = {"ireland"};
fq.track(keywords);
I'm using TweetStream to use Twitter Streaming API. Talking with my colleagues (and also in my memory) when tracking hashstag the # should not be included, but I cannot find any indications about it anymore in the documentation.
Also in another stackoverflow question this rule is mentioned, but the linked page in Twitter Documentation does not shows this indication anymore.
It looks like that using TweetStream like this:
TweetStream::Client.new.track('#term1', '#term2') do |status|
puts "#{status.text}"
end
works as expected. Can anyone confirm if this is the right way to setup a streaming client if I need to track #term1 and #term2?
The Listening Center at my university does not use hash tags when tracking terms. But as you mentioned and in the documentation, using them will work if you're trying to match only #term1 and #term2 with no other variations.
So for example if you filter out tweets based on #term1 you won't get #term11. But if you filter tweets based on term1 you'll get any variation of term1 including both #term1 and #term11.
I want to search for keyword related youtube videos, I'm using youtube getdata API.
Reading documentation I came up with this:
http://gdata.youtube.com/feeds/api/videos/-/". urlencode($kwd) ."?orderby=viewCount&max-results=". $max ."&alt=json
But this is not a real search, it gives urls taged with keyword... Youtubes internal search works quite differently I imagine, because comparing results don't match at all.
Any ideas?
The URL you offer does a search for any videos in a category where the category includes your keyword. What you want to do instead is to send a query string:
"https://gdata.youtube.com/feeds/api/videos?q=". urlencode($kwd) ."&orderby=viewCount&max-results=". $max ."&alt=json"
This way the feed will match right on the videos rather than the categories.
In the newer v3 of the API, your call would look like:
"https://www.googleapis.com/youtube/v3/search?part=snippet&q=".urlencode($kwd)."&maxResults=".$max."&order=viewCount&key={YOUR_API_KEY}"
Use Data API v3, search->list method.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&q=term&key={YOUR_API_KEY}
In my opinion, I would use the "q" parameter, for example to search for "dog"
var request = gapi.client.youtube.search.list({
part: 'snippet',
q: "dog"
});
But I'm just a noob the others guys answers are probably better.