Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Commit

Permalink
don't try to parse page_ids for sidebar ads
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Merrill committed Apr 23, 2020
1 parent 6c4ac64 commit 34655fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/page_ids.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace :page_ids do
counter = 0

batch_size = 500
FbpacAd.where("created_at > '2020-01-01'").where("page_id is null").find_in_batches(batch_size: batch_size) do |ads|
FbpacAd.where("created_at > '2020-01-01'").where("page_id is null and advertiser is not null").find_in_batches(batch_size: batch_size) do |ads|
ads.each do |ad|
next if ad.html.include?("ego_unit")
match = ad.html.match(/data-hovercard="https:\/\/www.facebook.com\/(\d+)"/)
Expand Down

0 comments on commit 34655fd

Please sign in to comment.