필터 지우기
필터 지우기

How to read Facebook information in MATLAB?

조회 수: 1 (최근 30일)
Adriano
Adriano 2011년 8월 18일
편집: ali fadaie 2017년 4월 3일
I want to read data from a group in Facebook to make a statistical analysis (number of posts by each member, number of "likes", etc.).
How can I access Facebook to extract this information?
I would appreciate any information that could point me in the right direction.
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2011년 8월 18일
Looks like you may be working toward the one useful use for Facebook.
Congrats +1

댓글을 달려면 로그인하십시오.

채택된 답변

Sreeram Mohan
Sreeram Mohan 2011년 8월 18일
I just tried a thing quickly !
[Object Status] = urlread('https://graph.facebook.com/Mathworks')
The Object should contain the relevant data which could be parsed to get the required info and the status returns if the attempt succeded !
Getting a good JSON object parser would make extracting information more easier though !
I tried using one of the file exchange submission here and it works smoothly with no issues !
Hope this helps better !
--sreeram
  댓글 수: 1
ali fadaie
ali fadaie 2017년 4월 3일
편집: ali fadaie 2017년 4월 3일
hi teacher.u can help how fetch data in facebook matlab??

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sreeram Mohan
Sreeram Mohan 2011년 8월 18일
Here is an API published by facebook http://developers.facebook.com/docs/reference/api/
You should combine the calls with the matlab functions like urllread ..etc to get the data that you require !
Let me know if you need help !
--sreeram
  댓글 수: 5
Cedric
Cedric 2015년 9월 23일
편집: Cedric 2015년 9월 23일
I never worked with FB, so you should open a new thread and see if someone did it. The API is not something that you write, but something that you interact with. It is a way for you to access data programmatically and not through the usual "user friendly web page interface". It is not always available and sometimes you have just the web pages to work with. When available, it is documented usually in a developer section and the documentation tells you how to send a query to the server, and how to read what is returned.
When not available, you are left to parsing web pages. This is not always possible, e.g. when there is Flash or some client-side code like JS. When the information lies in the HTML source of web pages though, you can generally extract it using an XML parser (for the simplest and best structured pages), or regular expressions if it is not XML compliant (most cases are not) and you need to extract data using pattern matching. Images can be saved as well in this case, because you can extract their URL and it is easy to download them.
I know that FB has a developer portal and APIs. Your next moves should be..
  • Look at the FEX if someone implemented something relevant to your work already, or anything related to FB.
  • If not, check if you get anything through google (e.g. "How to extract facebook information using MATLAB").
  • If nothing is already available, see if there is an API by FB which can provide the data that you need.
  • Then open a new thread here that explains what you are trying to achieve, reference what you found on the FEX or elsewhere already if there is anything (and explain in what it doesn't solve your problem). Also describe what you found in the dev. corner at FB, if there is an API that could be used, etc.
If you get no information, no answer, find no relevant API, but you are able to describe precisely what you need to extract from specific web pages (provide examples), we can talk about a solution that extracts data from the HTML code of these web pages (if available). This is in fact what I did in my small example.
Cedric
Cedric 2015년 9월 23일
PS: if you open a new thread, please post a link here as a comment so I see it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 JSON Format에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by