Thinker is a tool that finds discrepancies between Campaign
entity result set and remote ad service data.
ruby >= 2.3
$ git clone git@github.com:zeitnot/thinker.git
$ bundle install
$ rake
You can view the Thinker documentation in RDoc format here: https://www.rubydoc.info/github/zeitnot/thinker/
Got to $ bin/console
and then type FindDiscrepancy.call
. This will produce something like:
[
{
remote_reference: "1",
remote_existence: true,
discrepancies: [
{ remote: "Description for campaign 11", local: "Campaign Description", field: "ad_description" },
{ remote: "enabled", local: "paused", field: "status" }
]
},
{ remote_reference: "4", remote_existence: false, discrepancies: [] },
{ remote_reference: "5", remote_existence: false, discrepancies: [] },
{ remote_reference: "6", remote_existence: false, discrepancies: [] }
]
If there is exceptions such as connection timeout or parsing malformed JSON data FindDiscrepancy.call
will return empty array.
This means that FindDiscrepancy.call
is fault tolerant for known exceptions.