Social capital is a term coined by the French philosopher Pierre Bourdieu in 1983. Initially, social capital was understood as “resources based on kinship and relations in the membership group,” the term was later developed by James Coleman and is now interpreted very broadly.
Since this is “capital,” it is implied that it can be used to benefit. A vivid example from real life: your acquaintances, thanks to which you get a high-paying job, are social capital.
In the IT sphere, social capital also found its use (examples from domestic practice): not so long ago, Vkontakte began to filter the news feed of a profile depending on the credibility of the source of news for you (the more social connections you have with the source of news, the more chances are there , that his news will fall into your tape), recently launched a new user rating on LiveJournal, which is also based on social capital.
')
Based on the assessment of social capital, you, as the owner of an Internet resource, can assess the credibility and adequacy of the visitor and, accordingly, highlight his comments in the general flow, give some additional opportunities, etc. There is only one question: where to get data about the social capital of your visitor? Here we come to the aid of social networks. Further an example.
In order not to incline you to discuss politics, especially in view of the events taking place offline, I will not tell you the details of how we use this method (and we also use it), but use a made-up example.
Imagine that I am the owner of a torrent tracker filokopilka.tv. I’m interested in users not only downloading movies, but also distributing them as much as possible. Those who do not distribute anything and download a lot, is under restriction. Suppose that registration on my tracker is possible only through social networks. It would seem: as soon as another greedy user goes into negative rating, he will simply register a new profile on the social network and then register with me again. But here we come to the aid of the social network API, which not only allows you to authorize on your site user, but also to get some information about it.
In contact with
The API of this social network has the
users.get method, which returns such interesting data to us as the presence of linking the questionnaire to the phone (the
has_mobile field), the rating of the questionnaire (the
rate field, which indicates how full the information is in the questionnaire), readings of various activity counters fields
counters.friends ,
counters.followers ,
counters.subscriptions ,
counters.notes , etc.) It is clear that when a user tries to circumvent the restriction by creating new, empty questionnaires, the readings of the counters listed above will be very small. Also in the process of authorizing a user through the Open API, we get his ID, the value of which will also indicate how long the user has registered.
Facebook
After authorizing the Facebook user through OAuth and using the very convenient
Graph API , we can find out how many friends the user has (query
graph.facebook.com/me/friends?access_token=aaabbbccc ), assume how long he has registered, based on his ID number (basic information via
graph.facebook.com/ruslanleviev ) how actively different pages like (
like graph.facebook.com/me/likes?access_token=aaabbbccc ).
Twitter
On Twitter, the receipt of all data of interest to us occurs in just one request via the
verify_credentials method. In the answer we received, we are interested in such fields as
created_at (how long the account was created),
favourites_count (how many tweets the user added to favorites),
followers_count (how many people read this user),
verified (it is extremely rare to find a positive value in this field, it says that account is verified and really belongs to this famous person),
friends_count (how many people read the user; and based on the absolute value of the index and of its relationship with the number of readers, you can determine facts cheating, vzaimofollovinga),
statuses_count (shows how many tweets written for all time of the user).
Classmates
The only social network known to me in which the process of connecting to the API is not automated: first, you need to send a request to register you as a developer through a
special form and wait for a technical support response, then if you need to have access to some advanced methods, then you need again also send a written request to tech support for access to certain actions.
But if you still managed to overcome laziness and successfully completed the steps listed above, we can also extract useful data from the Odnoklassniki user authorization. We use the
auth.login method, or
auth.loginByToken and get in response such fields as
uid (by the value of which we can assume how long the user has registered)
activated_profile (whether the profile is activated). Also through the
friends.get method we can get the number of the user's friends.
My world
As in the social networks listed above, the API of My World has the
users.getInfo method, where we are interested in the fields
uid ,
is_verified (the binding of the questionnaire to a mobile phone is confirmed). Similarly, there is a
friends.get method (we can find out the number of friends).
Livejournal
Fortunately, in LiveJournal for each account there is an XML file with a description of the account, and it is available to everyone without any authorization at
username.livejournal.com/data/foaf , but there is another problem: in this case, the user can specify someone else’s account . Therefore, we still have to first authorize the user through
OpenID . In the above file, we are interested in the fields
foaf: Person-> ya: blogActivity-> ya: posts-> ya: Posted (contains the number of published posts),
foaf: Person-> foad: weblog (contains the attributes
lj: dateCreated and
lj : dateLastUpdated ). But that's not all: with a request to the address
www.livejournal.com/misc/fdata.bml?user=username we get a simple text file with a “name” list of all friends (in the specified file, the
> symbol means that the authorized user reads the specified account , and the symbol
< - on the contrary, that the specified account reads the authorized user).
Note: LJ requires that the fact that the request is made by a “bot” be directly indicated in the request headers, otherwise a ban may follow.Blogs Ya.ru, My circle (Yandex)
In the Yandex blogs API, we are interested in methods with a
description of a user’s profile (we get the ID, rating of KU and the time of its last update), the
list of friends of the user (count them).
Similarly with My Circle:
profile description and list of friends (get ID and count the number of friends).
Google and Google +
Despite the fact that Google is one of the oldest companies in this list and one of the largest (if not the largest), Google + is the most meager for this API useful for us.
In Google +, we are interested only in the user ID (
but there is an etag there ), and when logging in via a
regular Google account (for example, if the user does not have a profile in the Google + social network, but there is mail on Gmail), the
verified_email field is also.
Note: a reasonable question arises, if there is no difference - why pay more, if Google and Google + are almost the same thing - why ask for information twice? In addition to the described case with the absence of a profile on the social network, this is necessary if you collect basic user information (for example, first and last name), since it can be radically different.PS: since, due to the abundance of social networks, the post has already turned out to be very long, the authorization and query modules (for Yii and Kohana) of all the above data will be given next time.
A small explanation and a request to all users
We understand that among the audience of Habrahabr there are many supporters of our foundation, as well as opponents. Nevertheless, we completely agree that it is impossible to turn Habrahabr into a foothold of our supporters and arrange hell and Israel with our opponents in the comments, who are also present in large numbers among Habrahabr users.
Therefore, in all of our topics here, we will in no way deal with political issues, express unflattering assessments regarding any political figures and structures, talk about our plans that are not related to the subject of IT, etc.
Also, in order not to stir up political discussions in the comments, we will not answer any questions not related to IT and ask you not to ask them, or ask in private messages. We also ask you to refrain from any evaluative comments on the political activities of the Foundation, its employees and Alexey Navalny personally (regardless of whether they are laudable or critical).
Since we do not have any moderation of comments here, we have only one tool of influence: if these rules are not observed, we will have to close the blog on Habrahabr and deprive you of our stories about various interesting topics like dealing with constant DDoS attacks, cheating, bots and much more. The appearance of our blog on Habrahabr is not a sign that the Topical Media management supports our activity in any form.
PPS: for beta testing of the Foundation's project, we need those who want to get an invite and be able to “click through” the site, identify errors, describe them to us, etc. Those who wish to write in a personal
ruskar