J2897

FB Dump

Jan 27th, 2015
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # NOTICE: This Bash script is currently unable to dump your entire profile. I am
  4. # reading this page...
  5. # https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#fieldexpansion
  6. #
  7. # I think I need to loop through something the FB devs call "pagination" to grab
  8. # my profile in separate segments. I will delete this notice once all is fine. If
  9. # you figure it out before me, feel free to provide me with the knowledge.
  10.  
  11. #################### README ####################
  12. # Filename:     fb_dump.sh
  13. # Latest ver':  https://pastebin.com/884g3K9x
  14. # Contact:      https://pastebin.com/message_compose?to=J2897
  15. #
  16. # This script will dump your Facebook profile data to a file.
  17. #
  18. # If you're leaving Facebook, this should be useful for those wishing to migrate
  19. # their raw data.
  20. #
  21. # I started thinking of this when the Facebook staff/moderators or bots/algorithm
  22. # began bullying me into using my so called "real name". Even though no one has
  23. # any way of verifying my real name, they still insist that I use it.
  24. #
  25. # The only data I have on Facebook that I would like to keep is my Notes, the
  26. # Links I have posted, and perhaps a few, long, Status Updates I have typed.
  27. #
  28. # I tried a proprietary program called 'Social Safe'. It dumped my entire profile
  29. # to a PDF successfully. But when I tried dumping to the CSV format, it failed to
  30. # export the Links. It also doesn't currently export Notes either; and that's why
  31. # I felt the need to create my own alternative - FB Dump.
  32. #
  33. # After dumping my profile, I hope to recreate it in something not controlled by
  34. # the corporate spyware industry. Freenet or Diaspora seems more suitable for a
  35. # democratic society...
  36. # https://freenetproject.org/
  37. # http://www.kickstarter.com/projects/196017994/diaspora-the-personally-controlled-do-it-all-distr
  38. #
  39. #
  40. # How to use FB Dump:
  41. #
  42. #   1. Set your FB ID.
  43. #   2. Uncomment one of the FIELDS.
  44. #   3. Set the ACCESS_TOKEN.
  45. #   4. Set your desired OUTPUT path correctly.
  46. #
  47. #################### README ####################
  48.  
  49. # https://graph.facebook.com/<USERNAME>
  50. ID="10151981746917553"
  51.  
  52. # https://developers.facebook.com/docs/graph-api/reference/v2.2/user/feed
  53. #FIELDS="links" # shows only the links that were published by this person.
  54. #FIELDS="posts" # shows only the posts that were published by this person.
  55. #FIELDS="statuses" # shows only the status update posts that were published by this person.
  56. #FIELDS="tagged" # shows only the posts that this person was tagged in.
  57. FIELDS="feed"
  58.  
  59. # https://developers.facebook.com/tools/explorer/
  60. ACCESS_TOKEN="CAACEgEose0cBALVc3hNxZBmB9VG2IM2V7oehsmat3bmIF6Iufv5GppLKFOYKPHHV3WutZBmZAUwu1B0PRZBaAZCUDZCZAjfziksvTMKH0Q6hGNCvT8hCvzSB5ZCYzjownG1UMF5nri8TCxYFt7QOoLDB5ZCF3doMJZAguUQPNMmoa1G01garv4c36vO0IasOnyF6F2KEukHQOW1QWkGcUoPjFr"
  61.  
  62. # http://www.useragentstring.com/pages/Mozilla/
  63. USER_AGENT="Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201"
  64.  
  65. OUTPUT="/cygdrive/c/Users/John/Code/SH/fb_dump/$FIELDS.dat"
  66.  
  67. # http://open-source-tricks.blogspot.co.uk/2013/04/backup-facebook.html
  68. # http://curl.haxx.se/docs/manpage.html
  69. #curl --user-agent "$USER_AGENT" --output "$OUTPUT" "https://graph.facebook.com/$ID?fields=$FIELDS&access_token=$ACCESS_TOKEN" -s
  70. # http://www.gnu.org/software/wget/manual/
  71. wget --no-verbose --output-document="$OUTPUT" --user-agent="$USER_AGENT" "https://graph.facebook.com/$ID?fields=$FIELDS&access_token=$ACCESS_TOKEN"
Add Comment
Please, Sign In to add comment