I would do the following:
- Create WP-Cron task (or just use daily
wp_scheduled_delete
one to tag along) and hook your function to it. -
In that function:
- fetch XML file;
- fetch all posts with
meta_weight
set, usingget_posts()
; - loop through posts and save comparison result in another meta field for each.