I have a project that needs me to store a group feed of one of my Facebook groups that I want to store locally (MySQL). I have used PHPs Facebook SDK to successfully retrieve and store the first 24 posts. The rest are paginated like, as seen in the response:
"paging": {
"previous": "https://graph.facebook.com/v2.1/197349856967661/feed?limit=25&since=1413803847&__paging_token=enc_Aezfg88j7xOEW28BENBXvchQql9OYz00t6siBT2MviwZdOCcIFV8nyMyBmrUu39eOHbve68h6yUWLb0Lc12v_HD7k4_q299PnvIq7gz4BAZMZA",
"next": "https://graph.facebook.com/v2.1/197349856967661/feed?limit=25&until=1413803553&__paging_token=enc_AeyKAdBaClRXLJ7nBulYeqDEfzW1ovuAXSuDkPMSnbmIxpPXKh24vli0tOpF_OOtnFCXZLNTZki3j2umR8WKKyo3nLmZtICF1zfq7ZASIk2PdQ"
}
I wanted to know if there was a way in which I can loop the same piece of code until all the entries have been stored in my database. I am thinking is there a way to detect if there is a next page and execute another request using the "next" URL? Please do help me. I will highly appreciate it.