[resolved] Get data from social media - Facebook

One Star

[resolved] Get data from social media - Facebook

Hi all
I'm using Talend Open Studio for Data Integration for a few weeks, and my goal is to retrieve information about a topic via social networks.
Currently, the tTwitterInput component is useful to me, and I wanted to know if there was one for Facebook (but not tFApp because from what I understood it only treats the statistics related to its own application or his web site). And after consulting several topics on this forum, I have not found adequate answers to my problem.
And if ever there was such a component, if it existed methods, plugins or connectors to extract data from status/group/facebook page.
Thanks to you.
Best regards.
Stanaaaaa

Accepted Solutions
One Star

Re: [resolved] Get data from social media - Facebook


I found a solution, two choices open to us:
1) For example, all statuses about a page. Here, we take directly the token after the request:
"https://graph.facebook.com/oracle/feed?access_token=121212121212121212|abababababababab"
2) For a script, we perform the request of a token at each excution. To do this, we must define in the language of our choice two variables:
"https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id={app_id}&clien..."
Then, in a second variable:
"https://graph.facebook.com/oracle/feed?"
As said previously, we just create a job in Talend Open Studio using this syntax, then recover all the desired values and treat them.


The following message appears when I do a simple query using the appropriate access token.
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200
}
}

All Replies
Seventeen Stars

Re: [resolved] Get data from social media - Facebook

There is no component to connect to Facebook - also not in Talend Exchange. I guess most guys fetch statistics via a reporting interface (simply downloads csv return files).
The only nice APIs I know so far has Google.
Four Stars

Re: [resolved] Get data from social media - Facebook

Hi Stana,
Have you checked facebook graph API?
Vaibhav
One Star

Re: [resolved] Get data from social media - Facebook

Hi,
Firstly, thank you for your answers.
Yes, I tried the facebook graph API, but it seems to return information that a particular page (person, group...). What I am looking is to find the facebook status related to a keyword. Do you have any idea?
Best regards.
Stanaaaaa
Four Stars

Re: [resolved] Get data from social media - Facebook

This will read the status and related messages
GET /{status-id} HTTP/1.1
Host: graph.facebook.com
https://developers.facebook.com/docs/graph-api/reference/status/
Vaibhav
One Star

Re: [resolved] Get data from social media - Facebook

Yes, that's exactly what I was looking for. With the Graph API of Facebook, I can find the results related to a particular word (by setting the names, status, dates, etc ...). At first, I didn't quite understand the principle.
Then, I have to create a script to retrieve data in JSON. And use it as an input file in Talend Open Studio.
Thank you very much.
Best regards.
Stanaaaaa
Four Stars

Re: [resolved] Get data from social media - Facebook

Hi Stana,
Can you please post the sample complete script here so that it is useful to others as well. I also don't remember how I did it earlier.
Thanks
Vaibhav
One Star

Re: [resolved] Get data from social media - Facebook

Hi sanvaibhav,
For now, I have not yet realized the script. I don't know when I will post it, cause I currently have a problem with acess token apparently because of permissions.
I currently testing a simple request in a browser, trying to make a script after that. I need the exact syntax to do what I want, but the idea could be the next:
Core (for example, statuses about Apple):
https://graph.facebook.com/search?fields=name,message&limit=50&q=Apple
Access Token (to add before or after, I don't know):
/access_token?client_id=12345&client_secret=12345abcde&type=client_cred/
Best regards.
Stanaaaaa
One Star

Re: [resolved] Get data from social media - Facebook


I found a solution, two choices open to us:
1) For example, all statuses about a page. Here, we take directly the token after the request:
"https://graph.facebook.com/oracle/feed?access_token=121212121212121212|abababababababab"
2) For a script, we perform the request of a token at each excution. To do this, we must define in the language of our choice two variables:
"https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id={app_id}&clien..."
Then, in a second variable:
"https://graph.facebook.com/oracle/feed?"
As said previously, we just create a job in Talend Open Studio using this syntax, then recover all the desired values and treat them.


The following message appears when I do a simple query using the appropriate access token.
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200
}
}