ESWC 2014 Tutorial Handson 1: Collect Data from Facebook

195 views

Published on

ESWC 2014 Tutorial Handson 1: Collect Data from Facebook
http://tutorials.oeg-upm.net/socialweb/snippets-handson1.html

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
195
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ESWC 2014 Tutorial Handson 1: Collect Data from Facebook

  1. 1. Social Web: Where are the Semantics? ESWC 2014 Miriam Fernández, Victor Rodríguez, Andrés García-Silva, Oscar Corcho Ontology Engineering Group, UPM, Spain Knowledge Media Institute, The Open University
  2. 2. 1.- Obtain a FB account • If you don’t have already one ;) ESWC 2014 Social Web: Where are the Semantics? 2
  3. 3. 2.- Register as developer • https://developers.facebook.com/ ESWC 2014 Social Web: Where are the Semantics? 3
  4. 4. 3.- Create a new App ESWC 2014 Social Web: Where are the Semantics? 4
  5. 5. 4.- Obtain your App ID and App Secret! ESWC 2014 Social Web: Where are the Semantics? 5
  6. 6. 5.- Play a bit with the graph ESWC 2014 Social Web: Where are the Semantics? 6
  7. 7. Now lets try to create our own APP https://gist.github.com/miriamfs/b78a8b26ea0f2895788f ESWC 2014 Social Web: Where are the Semantics? 7
  8. 8. To set up your project…you need three files • FacebookDataCollector.java contains the code that you need to download data from Facebook open groups or Facebook pages • pom.xml contains the dependencies. If you prefer not to use a maven project, just go to http://restfb.com/#download and download the corresponding library [or ask for the usb] • fbCollector.properties. This is the properties file that you need to set up. You need to add: – appId and appSecret. This are your facebook app's credentials. – FbGroups and FbPages are the ids of groups and pages for which you want to download information. If you have more than one group or one page, please provide them separated by ",” – maxPosts = maximum number of [initial] posts that you want to download for each group/page. Note that for each initial posts all of its corresponding comments will also be included in the download ESWC 2014 Social Web: Where are the Semantics? 8
  9. 9. And you get three files ;) • This program provides as output 3 files: – posts.csv -> contains all the posts and comments that have been downloaded including their text, time, user who generate them and group or page from where they come from. – replies.csv -> contains the reply change, i.e., information of which posts have been generated as comments to other posts – groups.csv -> contains information about the groups from which information have been downloaded ESWC 2014 Social Web: Where are the Semantics? 9
  10. 10. And if you don’t fancy to play with the code… • Just execute it!  – java –jar fb_data_collector.jar ./fbCollector.properties – And get the data! ESWC 2014 Social Web: Where are the Semantics? 10

×