How to get your own facebook friends every day
<p>I want to get all of my facebook friends every day and I was searching which is the more efficient way to do it.</p>

<p>My first approach was to create a selenium webdriver script. It opens a web browser, visits <code>/me/friends</code>, scrolls down automatically until the list finishes and then it parses the names. It is working pretty good but it takes some time (approximately 4-5 minutes). </p>

<p>After some search on the graph API, it appears that it isn't possible to have your complete list.</p>

<p>Another approach is to request from facebook to download all of your data, but facebook sends you an email and you need to wait and download it etc. and still you have to wait.</p>

<p>Final approach was to use a chrome extension (the name is <code>who deleted me</code>) which it worked and it was faster than my approach. I am wondering how this extension worked and one thing that I noticed is that it didn't found a friend of mine which has passed away. I don't like a 3rd party extension to have my data and I prefer to do it on my own. So I am wondering is there an endpoint which returns your public friends? or what is the approach of this chrome extension to do that? </p>

<p>Is there any other programming way of fetching your friends? Sure you could use a headless browser and do some requests to the <code>/me/friends</code> and get the responses as it does a web browser when it scrolls down, but it is pretty difficult to understand which ajax calls are the correct ones.</p>

<p><strong>Update:</strong>
My approach of scrapping: <a href="https://gist.github.com/johndel/cd01a854e8bf36d9d30b44758607cf3d#file-check_friends-rb" rel="nofollow">https://gist.github.com/johndel/cd01a854e8bf36d9d30b44758607cf3d#file-check_friends-rb</a></p>

<p>It isn't the best code I can write, just a hack for seeing it done, just replace the sendkeys with your email / password and it will do the trick. My approach gets all of my friends (the chrome extension approach didn't found a friend of mine, that's why I think it is hitting another endpoint and it is doing it differently).</p>