Ruby Facebook Graph API Project to Download Profile Info Data inside ZIP File



Facebook data analyzer as seen on I analyzed my facebook data and it’s story of shyness, loneliness, and change

Analyze Facebook copy of your data. Download zip file from Facebook and get info about friends, ranking by message, vocabulary, contacts, friends added statistics and more.

What’s inside

  • Ranking of friends by messages (number of messages sent, who sent more, how many words, characters in conversation)
  • Your most used words in conversations, the most frequent words from English language and also Polish (my native language) are deleted. So you get quite good and interesting results.
  • Your overall statistics of messaging: total number of messages, words, characters, unique words.
  • How many messages were sent by period: month, week, year, hour. So you can easily get what type of writer you are: night owl vs. early bird. Find your most busy messaging days.
  • How your history of making friends looked like? Breakdown by month, year, weekend vs. working day, most busy days, weeks and months.

How to run

Remember you need to use english language(US) on facebook for download

It won’t work if you use different language because of date formatting, different titles on pages. This script uses nokogiri internally to parse data.

  1. Go to settings on Facebook and switch to English language(US), you can later go back to your native langauge.
  2. From Facebook settings, request copy of your data.
  3. You should get an email back in about 30 minutes.
  4. Download the zip file from the link provided in email.
  5. Extract the file and then get path to catalog with copy of your data. In my case it was: /Users/przemyslawmroczek/Downloads/facebook-przemekmroczek90/.
  6. Clone this repository with script.
  7. You need to install rubygem bundlergem nokogirigem axlsx. There are extensive tutorials in the web how to do it and it’s beyond this readme.
  8. Go to folder where you cloned facebook_data_analyzer.
  9. Run bin/facebook_data_analyzer -c path_to_catalog_with_copy_of_facebook_data in my case this command looked like: bin/facebook_data_analyzer -c /Users/przemyslawmroczek/Downloads/facebook-przemekmroczek90/
  10. You will see the script running and analyzing your conversations. At the end you will see it generated new excel file facebook_analysis.xlsx, and html file facebook_analysis.html.

Optional: If the DEBUG environment variable is present, messages are getting converted as json for speed improvement.

Minimal Command

Available Options

Default values


Please consider running your changes with

before making a pull request. Changes that significantly slow this project may be rejected


After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.


Leave a Reply