mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user