In Twitter, how to filter the results of a list? - twitter

I have created a list - LL (for linguistics list) - containing 2 members :
languagelog (http://languagelog.ldc.upenn.edu/nll/)
languagehat (http://languagehat.comBut i
The list, of course, works fine. But suppose I would like to :
exclude languagelog's tweets containing "chinese"
include languagehat's tweets only if they contain "russian"
I know how to do that with one search operator :
(from:language log -chinese) OR (from:languagehat russian)
but it seems it could be interesting to do that via lists, which would allow longer and more complex searches (it might even become a sort of substitute for yahoo pipes, although a very simple one).
Is it possible to include search operators in lists ?
Thanks in advance

This is the correct search query for the separate accounts:
(from:languagehat OR from:languagelog) lang:ru -lang:zh
If you'd like to do similar with a list:
create a Twitter list and add the accounts you need into it.
click on your list and copy the list ID from the browser's URL line the list ID.
in the query below, replace [list_id] with your copied list IDlist:[list_id] lang:ru -lang:zh
paste the query in Twitter's search box
Of course, as you suggested, you can build longer and more complex searches on that list.

Related

Using endsWith filter together with expanding user's memberOf doesn't work

I want to fetch all users together with their group names from MS Graph API.
It works as long as I don't want to do some advanced filtering (endsWith()).
Here's the select query I'm running:
https://graph.microsoft.com/v1.0/users?$select=displayName,userPrincipalName,mail,id,givenName,surname,memberOf&$expand=memberOf($select=displayName)
It produces a nice set of users together with the display name's of groups they are in.
I wanted to restrict the result to a specific mail domain (i have added ConsistencyLevel: eventual), however I am unable to do it unless I remove the memberOf expand. This works:
https://graph.microsoft.com/v1.0/users?$select=displayName,userPrincipalName,mail,id,givenName,surname,memberOf&$count=true&$filter=endsWith(mail,'#somedomain.com')
But as expected, there are no groups. In fact, there are no groups at all despite selecting memberOf! I thought I'll just fetch groups first and then pair them in my code, but to get them I must expand, and with expand the filter doesn't work!
This produces an Request_UnsupportedQuery error:
https://graph.microsoft.com/v1.0/users?$select=displayName,userPrincipalName,mail,id,givenName,surname,memberOf&$expand=memberOf($select=displayName)&$count=true&$filter=endsWith(mail,'#somedomain.com')
Is there any way to achieve what I want without filtering manually or issuing multiple requests and mapping stuff on my own? We're talking about directories containing tens of thousands of users.. Graph seemed to be nice at the beginning but as I wanted to do anything more complex it turns out to be a limited POS where one query totally excludes another. I was also unable to filter by the expanded memberOf in any way
Based on Microsoft Docs
$expand is not currently supported with advanced queries.

Microsoft Graph API using filter on get sharepoint lists

I'm trying to filter on the sharepoint lists, but the semantics seems to be different to the default semantics.
What I already tried was (with $ and without; single quotes and no quotes):
https://graph.microsoft.com/v1.0/sites/root/lists?filter=name eq 'Something'
https://graph.microsoft.com/v1.0/sites/root/lists?$filter=name eq 'Something'
https://graph.microsoft.com/v1.0/sites/root/lists?filter=id eq 'CFFF1460-B4D7-419C-A921-61B5279BBDDC'
https://graph.microsoft.com/v1.0/sites/root/lists?$filter=id eq 'CFFF1460-B4D7-419C-A921-61B5279BBDDC'
https://graph.microsoft.com/v1.0/sites/root/lists?filter=id eq CFFF1460-B4D7-419C-A921-61B5279BBDDC
https://graph.microsoft.com/v1.0/sites/root/lists?$filter=id eq CFFF1460-B4D7-419C-A921-61B5279BBDDC
But everything returns an array containing all lists and not only the subset matching the desired criteria.
So how can I filter on sharepoint lists?
If you know the id of the list you want to filter and get a response for.
YOu can run a graph API query like this.
https://graph.microsoft.com/v1.0/sites/root/lists/{list-id}
This will give you data about that list.
Let me know if you need further details on this.
Unfortunately (like Marc already mentioned in the comments) it is not possible to filter on SharePoint lists. If you need to, you have to do it on the client side, by reading the list without any filter and make a LINQ statement (or something similar) on the received collection. Be aware that (like all collections in Graph) you don't get always all elements at once. Potentially you have to call the next link request from the last response and wade through more requests and elements till you find what you need.
So when you found what you need, it is a good idea to store the list id within a memory cache or Redis cache for faster lookups the next time, you need this information.

Visual studio online query items without tags

When are working with various Work Item types (user stories,Tasks, etc) we assign tags to reference the area of work. This makes it easy to filter the Backlogs items view to find any related stories.
I would like to build a query to identify Work Items where the tags have not yet been assigned.
I know this can be achieved using excel and filtering, however I specifically would like to do this using the queries. Is this possible??
Thanks in advance for any assistance.
Firstly, I have to say that it is not possible to create work item query to show work items which don't contain tags. As you see that the Operator for Tags is Contains or Does Not Contain, it is not possible to use these two operators to filter out these non-tagged work items.
Secondly, as you have more than 100 tags, it is not an effective way to use "Does Not Contain" operator to exclude all tagged work items.
So,
How about you adding a 'Null' tag to all non-tagged work items to specify that these work items don't have any tags? With this approach, you can create a work item query with Tags Contains Null to list these non-tagged work items.
If you don't want to take this approach, you need to work with excel just as you mentioned above, or take Dave's advice to work with API.

Search a document in Elasticsearch by a list of Wildcarded statements on a single field

If I have documents in ElasticSearch that have a field called url and the contents of the url field are strings like "http://www.foo.com" or "http://www.bar.com/some/url/segment/the-page.html", is it possible to search for documents matching a list of wildcarded url fragments e.g., ["http://www.foo.", "http://www.bar.com//segment/.html", "://*bar.com/**"]?
If it is possible, what is the best approach to do this? I have explored wildcard query which only seems to support 1 fragment not multiple. Filters don't seem to support wildcarding as I have tried using * in a term filter without any luck.
To make it a little more complex, I'm also interested in being able to search by a lot of these fragments. I have come across terms filter lookup which seems like it is a good solution for dealing with many search terms, but I'm not sure wildcarding works with filters.
Any thoughts?

Does Youtube API have "AND and OR" search and explicit match search?

Does Youtube API allow me to do searches like
Search videos which have (in their title) strings both Lady Gaga AND (Cyrus OR Muse)
And does Youtube API allow me to do searches like
Search videos which have (in their title) string exactly Katy Perry. I don't want titles which have Katy Elizabeth Perry.
What's the most efficient code to write that type of search request? I want to code it using Ruby on rails.
I've gone through various introduction about how to search Youtube but they were mainly talking about other filtering things like relevance and view counts filtering.
And is supported with include and exclude just like the search query in the Web UI.
You can use -{query term} to exclude a query term. Or |{gaga} to OR.
like {lady -gaga} or in decoded form
https://www.googleapis.com/youtube/v3/search?part=snippet&q=lady+-gaga&key={YOUR_API_KEY}
You can also make separate calls, put results into sets and do all these operations in your client.

Resources