dejanstojanovic / Facebook-Album-Browser

jQuery plugin for browsing public albums of a Facebook account
http://dejanstojanovic.github.io/Facebook-Album-Browser/
MIT License
74 stars 42 forks source link

Facebook API Limit Reached #75

Closed aethatsme closed 5 years ago

aethatsme commented 5 years ago

Is there a way to spread out the api request to facebook? Looks like they are only allowing 200 call per user.

Any help would be appreciated.

dejanstojanovic commented 5 years ago

You can build a tiny proxy and cache your responses from the Facebook Graph API. This way you will only have non cached requests going out to Facebook to fetch new data. Cache on the proxy can be set to 24h so you always get fresh data with maximum one day of delay, but I guess you do not upload your photos often than that.

aethatsme commented 5 years ago

would something like this work?

function get_data($url) { /* @var $cache_file is path/to/the/cache/file/based/on/md5/url / $cache_file = 'cache' . DIRECTORY_SEPARATOR . md5($url); if(file_exists($cache_file)){ /**

dejanstojanovic commented 5 years ago

This looks like PHP to me. Not a great expert with it, but I guess this is one way to do it by saving it to the file.