9-volt/baku — pull request #3 by alisnic (2013-11-20 22:21:32+00:00)
Title: Facebook graph link generator + protv link generator

First, FACEBOOK_APP_ID and FACEBOOK_APP_SECRET must be in sever env. These values are in our gdoc.

The algorithm is simple:
```
1: get all posts from facebook page
2: extract urls from them
3: validate urls
4: see how many of them we already have
- if some of them are duplicates and result set is not empty
5: fetch posts from next page
6: go to 2
- else
- if ENV['ALL'] is set
5: fetch posts from next page
6: go to 2
- else
7: end
```

The `ENV['ALL']` is used to indicate the algorithm to not stop if all entries are duplicates, this will force it to fetch all entries on the next page until the oldest. Therefore the use case of this flag is when we don't have any protv urls at all.