Use a very conservative estimate of ad inventory.

Inventory is estimated using traffic to GET_listing. This is a pretty good
estimate based on historical trends (compare subreddit traffic to impressions for
promoted links targeted to the subreddit). It seems safer to start out with a low
estimate. This is especially needed because the CPM beta will only show promoted
links on the subreddit listing, not on multireddits or the front page.
This commit is contained in:
Brian Simpson
2013-08-14 16:39:52 -04:00
parent cb4b603283
commit e6bfc29316

View File

@@ -136,8 +136,9 @@ def get_available_pageviews(srs, start, end, datestr=False):
ret = {}
for sr in srs:
sold_by_date = sold_by_sr_by_date[sr.name]
sr_ad_inventory = int(daily_inventory.get(sr.name, 0) * 0.5)
ret[sr.name] = {
datekey(date): max(0, daily_inventory.get(sr.name, 0) - sold)
datekey(date): max(0, sr_ad_inventory - sold)
for date, sold in sold_by_date.iteritems()
}