Searching LinkedIn profiles by name on Spring Social - spring-social

Is it possible to search LinkedIn Profiles by name within your network using Spring Social?
I've seen the search option defined on profileOperations but there's nothing like that available on connectionOperations. I was thinking something along the line of retrieving all the connection ids and using that as a filter on a profile search.
But I couldn't find any documentation on how to use the search function and since the connectionOperations only retrieves full profiles that's a pretty expensive operation, in any case.
Any suggestions?

Yes. It is possible.
You can use the search() method in org.springframework.social.linkedin.api.ProfileOperations
LinkedInProfiles search(SearchParameters parameters)
Set the firstName and/or lastName attributes in SearchParameters object.
Sample code:
SearchParameters searchParameters = new SearchParameters();
searchParameters.setFirstName("first_name");
searchParameters.setLastName("last_name");
LinkedInProfiles profiles = linkedinApi.profileOperations().search(searchParameters);
Hope this helps. Let me know if you have any further questions.
Praveen

Related

Azure AD graph API to filter users with onPremisesExtensionAttributes [extensionAttribute6]

I need to filter users with the onPremisesExtensionAttributes [extensionAttribute6] is there a graph API call for it?
As #Tinywa suggested in the comment:
onPremisesExtensionAttributes contains extensionAttributes 1-15 for
the user. Note that the individual extension attributes are neither
selectable nor filterable.
You can get all the results first and use your own code logic to filter them.
Or you can consider using extensionProperty as a workaround. Create the extensionProperty and assign value for the users, and then query users with filtering with this extensionProperty. For detailed steps to create extensionProperty and assign value for users, you can refer to this answer.
It looks like they've updated the BETA Graph API so that extension attributes (onPremisesExtensionAttributes) are now filterable.
Try the below in Graph Explorer. You'll need to change the extensionAttribute1 eq 'Employee' part to a query that will actually work in your active directory environment.
https://graph.microsoft.com/beta/users?$count=true&$filter=onPremisesExtensionAttributes/extensionAttribute1 eq 'Employee'&$orderBy=displayName&$select=displayName,mail,onPremisesExtensionAttributes
Please note that this is the BETA Graph API so I guess that means Microsoft hasn't finalized it, so it might change or never get fully released.
EDIT: I also just learned that if you're using this filter via the Graph API, you must add the following header or you'll an error:
client.DefaultRequestHeaders.Add("ConsistencyLevel", "eventual");
The Graph Explorer has this header by default, I guess.
Here's where I found this answer: Get Extended Properties on User using Microsoft Graph
Here's the error I was getting:
Property 'extensionAttribute1' does not exist as a declared property or extension property.

spring reactive: check if user exists or not

I am using spring reactive and need to check weather user with particular
data exists or not and currently I am not able to solve that problem.
Considering the scenerio
In my document I need to check if username or email already exists or not
In RDBS I can do it as
select count(id)>0 where username='abc' or email='abc#idx.com'
while using spring reactive which returns either mono or flux the simple most query becomes
{$or:[{"username":"abc"},{"email":"abc#idx.com"}]} which will return flux but I need boolean to verify from db
On solution is that I can get Flux<User> and the iterate it using form loop but then using ' result.block()' whick will block some other threads and therefore not a clean solution.
Is there any clean solution or any Idea how to solve this.
Thanks
Edit One possible solution can be creating unique indexing in monogdb, that I am using right now. But if there is any other solution please let me know
Using Spring Data MongoDB, you can use something like below:
public interface ReactiveUserRepository extends ReactiveSortingRepository<User, Long> {
Mono<User> findByUsernameAndEmail(String username, String email);
}
Find a single entity for the given criteria. It completes with IncorrectResultSizeDataAccessException on non-unique results.
You can refer to the complete syntax here:
https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/

facebook userid from username in excel power query

I have been spending time on excel power query in the past two days but did not figure out how to fetch facebook userid if i have the username.
For instance, if I have the username zuck OR
the profile url https://www.facebook.com/zuck
using any of the above, is it possible to find the uid (facebook numeric id). In this example, the ID is 4
Somewhat similar to what http://findmyfbid.com does, I want to find out if it is possible with excel power query.
Thanks
Looking around the Power Query Facebook connector and the Facebook Graph API reference I can't find any obvious way to look up user id's from the username.
http://findmyfbid.com/failure indicates that a search engine had to index the public usernames in order to find the id. You can open a page like https://www.facebook.com/Code.org/ in your browser and muck through the HTML and find the username yourself, assuming the page is still public.
On the other hand, findmyfbid.com has already solved this problem. Here's how to query against their website directly using a custom Power Query function FindId:
let
// Assume you've already URL-encoded the id
FindId = (id as text) as text =>
let
Source = Web.Contents("http://findmyfbid.com/", [
Content = Text.ToBinary("url=" & id),
Headers = [#"Content-Type"= "application/x-www-form-urlencoded"]
]),
// Web.Page can't POST directly, so force Web.Contents to execute the POST
WebPage = Web.Page(Binary.Buffer(Source)),
// Hopefully findmyfbid.com doesn't change their HTML layout
DrillDown = WebPage[Data]{0}
{[Name="HTML"]}[Children]
{[Name="BODY"]}[Children]
{[Name="DIV"]}[Children]
{[Name="DIV"]}[Children]
{[Name="CODE"]}[Children]
{[Kind="Text"]}[Text]
in
DrillDown,
ExampleCodeOrg = FindId("code.org")
in
ExampleCodeOrg
And you find that Code.org has an Id of 309754825787494.

Retrieve all groups for a member using Google Admin java sdk

I would like to retrieve all groups for a given member.
There is an api interface for this:
https://developers.google.com/admin-sdk/directory/v1/guides/manage-groups#get_all_member_groups
But unfortunately I can't figure out how to do that using java SDK as I was not able to find a method for this.
How can this problem be solved?
You don't need to add methods, you can use Directory.Groups.List and set the userKey parameter, something like
//... imports, initializations etc.
Directory service = new Directory.Builder(httpTransport, jsonFactory,
credential).build();
Groups userGroups = service.groups().list().setUserKey("member#domain.com")
.execute();
Add new method to class com.google.api.services.admin.directory.Directory class to query https://www.googleapis.com/admin/directory/v1/groups?userKey={userKey}. This way you can retrieve the member's groups.

Has anyone used the ConstraintRelationship class for Dynamics CRM?

As documented here there is a property on the AppointmentRequest class for the CRM webservice that allows you to add constraints to what possible appointments are returned from a search.
The actual constraint is specified as an xml string, but I can find almost no documentation about it. Can any one point me to any relevant resources?
I was never able to find any quality documentation on this property or an accepted schema. About all that is available (that I've found) exists on this example from the SDK: Schedule A Resource
You can kind of see how you would limit the search results to a set of resources/users. The list of which properties can be replaced for "name" in the example is in the article ConstraintRelation.Constraints Property.
Hope this helps...

Resources