Boxerman Posted September 1, 2017 Share Posted September 1, 2017 Hi all, Just a quick one, i would like to monitor an API for changes, so the first run on the API would be to grab all 315 pages and enter them into my database, once added, i want to set up a cron job (i can do that) to monitor if anything gets added, im not sure whats the best way to go about that? Anyone have any ideas to point me in the right direction please? Quote Link to comment Share on other sites More sharing options...
kicken Posted September 1, 2017 Share Posted September 1, 2017 Unless the API has some sort of the feature to make detecting changes easier than the only thing you can really do is download all 315 pages again and then compare them to what you downloaded the first time. How you compare the data kind of depends on what the data is. You'll have to figure that part out. For example if it's json data you might just compare the serialized versions, or you might decode it an compare each field, or only specific fields. Whatever your use case calls for. Beware of any API limits that are in place. You might get throttled/banned by the API provider if you hit the API to hard/fast. Might want to contact them and ask about what you want to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.