Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- import urllib2
- from BeautifulSoup import BeautifulSoup
- from memberrewards.lib.api import get_date
- from memberrewards.lib.api.aggregators.ls.api import LinkshareAPI
- from rewards.aggregators.external import ExternalAffiliateProperties, ImageProperty
- class LinkshareExternalAffiliateProperties(ExternalAffiliateProperties):
- __sources__ = dict(
- aggregator_affiliate_id=None, # Loaded on __init__
- aggregator_affiliate_name='scrape',
- description='scrape',
- rollover='scrape',
- active='scrape',
- website_name='scrape',
- green=None,
- days_to_return='scrape',
- is_select_goods_only='scrape',
- has_non_commissionable_goods='scrape',
- offer='scrape',
- images='api_images',
- categories='scrape',
- )
- def __init__(self, aggregator_affiliate_id, account_username, account_password, api_token):
- assert self is not None, 'Self is None'
- assert LinkshareExternalAffiliateProperties is not None, 'LinkshareExternalAffiliateProperties is None'
- super(LinkshareExternalAffiliateProperties, self).__init__(aggregator_affiliate_id)
- self.account_username = account_username
- self.account_password = account_password
- self.api_token = api_token
- # CONFIG: django, gunicorn, nginx. Works under straight django, adding gunicorn (with 3 worker processes) raises the assertion `assert LinkshareExternalAffiliateProperties is not None`
Add Comment
Please, Sign In to add comment