| Usuario | Titulo: Find friends on facebook |
evasingle¡Adicto Total!![]() ![]() ![]() ![]() ![]() 2134 mensajes
0 Albumes (0 fotos)0 perros (0 fotos) Sexo: Hombre Edad: 24 años Provincia: Matam |
Publicado: Tuesday 17 de March de 2026, 23:05
Article about find friends on facebook: In this article by the authors, Vikram Garg and Sharan Kumar Ravindran , of the book, Mastering Social Media Mining with R, we learn about data mining using Facebook as our resource. (For more resources related to this topic, see here.) We will see how to use the R package Rfacebook , which provides access to the Facebook Graph API from R. It includes a series of functions that allow us to extract various data about our network such as friends, likes, comments, followers, newsfeeds, and much more. GO TO SITE We will discuss how to visualize our Facebook network and we will see some methodologies to make use of the available data to implement business cases. Rfacebook package installation and authentication. The Rfacebook package is authored and maintained by Pablo Barbera and Michael Piccirilli. It provides an interface to the Facebook API. It needs Version 2.12.0 or later of R and it is dependent on a few other packages, such as httr , rjson , and httpuv . Before starting, make sure those packages are installed. It is preferred to have Version 0.6 of the httr package installed. Installation. We will now install the Rfacebook packages. We can download and install the latest package from GitHub using the following code and load the package using the library function. On the other hand, we will also install the Rfacebook package from the CRAN network. One prerequisite for installing the package using the function install_github is to have the package devtools loaded into the R environment. The code is as follows: After installing the Rfacebook package for connecting to the API, make an authentication request. This can be done via two different methods. The first method is by using the access token generated for the app, which is short-lived (valid for two hours), on the other hand, we can create a long-lasting token using the OAuth function. Let’,s first create a temporary token. Go to https://developers.facebook.com/tools/explorer, click on Get Token , and select the required user data permissions. The Facebook Graph API explorer will open with an access token. This access token will be valid for two hours. The status of the access token as well as the scope can be checked by clicking on the Debug button. Once the tokens expire, we can regenerate a new token. Now, we can access the data from R using the following code. The access token generated using the link should be copied and passed to the token variable. The use of username in the function getUsers is deprecated in the latest Graph API, hence, we are passing the ID of a user. You can get your ID from the same link that was used for token generation. This function can be used to pull the details of any user, provided the generated token has the access. Usually, access is limited to a few users with a public setting or those who use your app. It is also based on the items selected in the user data permission check page during token generation. In the following code, paste your token inside the double quotes, so that it can be reused across the functions without explicitly mentioning the actual token. A closer look at how the package works. The getUsers function using the token will hit the Facebook Graph API. Facebook will be able to uniquely identify the users as well as the permissions to access information. If all the check conditions are satisfied, we will be able to get the required data. Copy the token from the mentioned URL and paste it within the double quotes. Remember that the token generated will be active only for two hours. Use the getUsers function to get the details of the user. Earlier, the getUsers function used to work based on the Facebook friend’,s name as well as ID, in API Version 2.0, we cannot access the data using the name. Consider the following code for example: Then, the details of the user, such as name and hometown, can be retrieved using the following code: The output is also mentioned for your reference: For the following code: The output is as follows: Now, let’,s see how to create a long-lasting token. Open your Facebook app page by going to https://developers.facebook.com/apps/ and choosing your app. On the Dashboard tab, you will be able to see the App ID and Secret Code values. Use those in the following code. On executing the preceding statements, you will find the following message in your console: Copy the URL displayed and open your Facebook app, on the Settings tab, click on the Add Platform button and paste the copied URL in the Site URL text box. Make sure to save the changes. Then, return to the R console and press any key to continue, you will be prompted to enter your Facebook username and password. On completing that, you will return to the R console. If you find the following message, it means your long-lived token is ready to use. When you get the completion status, you might not be able to access any of the information. It is advisable to use the OAuth function a few minutes after creation of the Facebook application. How to find friends on facebook by contact How to find out if someone has a facebook account Find someone by number on facebook Search friends with phone number facebook |
| Denunciar mensaje Citar |
![]() |
|
|
Usuarios conectados |
| Tenemos 0 usuarios conectados. 0 invitados y 0 miembro/s: |
Pastor alemán|Bulldog|Bull terrier|Yorkshire|Boxer|San bernardo|Schnauzer|Golden Retriever|Doberman|Labrador Retriever