Esempio n. 1
0
    def __init__(self, use_cache=1, **kwargs):

        '''
        EWTScraper parameters: 'expire_time', 'headers', 'use_cache'
        '''

        # see http://stackoverflow.com/questions/8134444
        EWTScraper.__init__(self, use_cache=use_cache, **kwargs)

        self.logger = logging.getLogger(__name__)

        if 'default_model' in kwargs:
            self.default_model = kwargs['default_model']
        else:
            self.default_model = 'default'

        if 'model_urls' in kwargs:
            self.model_urls = kwargs['model_urls']
        else:
            self.model_urls = {
                'default': 'http://www.fantasylabs.com/api/playermodel/2/{0}/?modelId=100605',
                'bales': 'http://www.fantasylabs.com/api/playermodel/2/{0}/?modelId=193714',
                'phan': 'http://www.fantasylabs.com/api/playermodel/2/{0}/?modelId=193718',
                'tournament': 'http://www.fantasylabs.com/api/playermodel/2/{0}/?modelId=193722',
                'cash': 'http://www.fantasylabs.com/api/playermodel/2/{0}/?modelId=193723'
            }
Esempio n. 2
0
    def __init__(self, **kwargs):
        '''
        Args:
            **kwargs: projections_url (str)
        '''

        # see http://stackoverflow.com/questions/8134444/python-constructor-of-derived-class
        EWTScraper.__init__(self, **kwargs)

        if 'format' in 'kwargs':
            self.format = kwargs['format']
        else:
            self.format = 'standard'

        if 'projections_url' in 'kwargs':
            self.projections_url = kwargs['projections_url']
        else:
            self.projections_url = 'https://fantasyfootballcalculator.com/rankings'

        if 'teams' in 'kwargs':
            self.teams = kwargs['teams']
        else:
            self.teams = '14'

        if 'year' in 'kwargs':
            self.year = kwargs['year']
        else:
            self.year = '2015'
Esempio n. 3
0
    def __init__(self, **kwargs):
        '''
        '''

        # see http://stackoverflow.com/questions/8134444/python-constructor-of-derived-class
        EWTScraper.__init__(self, **kwargs)

        ' logger nullhandler
Esempio n. 4
0
    def __init__(self, **kwargs):
        # see http://stackoverflow.com/questions/8134444
        EWTScraper.__init__(self, **kwargs)
        logging.getLogger(__name__).addHandler(logging.NullHandler())

        if 'polite' in 'kwargs':
            self.polite = kwargs['polite']
        else:
            self.polite = True
Esempio n. 5
0
    def __init__(self, **kwargs):
        '''
        Args:
            **kwargs: projections_url (str)
        '''

        # see http://stackoverflow.com/questions/8134444/python-constructor-of-derived-class
        EWTScraper.__init__(self, **kwargs)

        self.players_url = 'http://football.myfantasyleague.com/2015/export?TYPE=players&DETAILS=1'
Esempio n. 6
0
    def __init__(self, **kwargs):
        '''
        EWTScraper parameters: 'dldir', 'expire_time', 'headers', 'keyprefix', 'mc', 'use_cache'
        '''

        # see http://stackoverflow.com/questions/8134444
        EWTScraper.__init__(self, expire_time=300, **kwargs)

        logging.getLogger(__name__).addHandler(logging.NullHandler())

        if 'odds_url' in kwargs:
            self.odds_url = kwargs['odds_url']
        else:
            self.odds_url = 'http://xml.pinnaclesports.com/pinnaclefeed.aspx?sporttype=Football&sportsubtype=nfl&contest=no'
Esempio n. 7
0
    def __init__(self, **kwargs):

        # see http://stackoverflow.com/questions/8134444
        EWTScraper.__init__(self, **kwargs)
        self.logger = logging.getLogger(__name__).addHandler(
            logging.NullHandler())
        self.pgl_finder_url = 'http://www.pro-football-reference.com/play-index/pgl_finder.cgi'

        if 'polite' in 'kwargs':
            self.polite = kwargs['polite']
        else:
            self.polite = True

        if 'params' in 'kwargs':
            self.params = kwargs['params']
        else:
            self.params = {
                'request': 1,
                'match': 'game',
                'year_min': 2016,
                'year_max': 2016,
                'season_start': 1,
                'season_end': -1,
                'age_min': 0,
                'age_max': 0,
                'pos': '',
                'game_type': 'R',
                'career_game_num_min': 0,
                'career_game_num_max': 499,
                'game_num_min': 0,
                'game_num_max': 99,
                'week_num_min': 1,
                'week_num_max': 17,
                'c1stat': 'choose',
                'c1comp': 'gt',
                'c2stat': 'choose',
                'c2comp': 'gt',
                'c3stat': 'choose',
                'c3comp': 'gt',
                'c4stat': 'choose',
                'c4comp': 'gt',
                'c5comp': 'choose',
                'c5gtlt': 'lt',
                'c6mult': 1.0,
                'c6comp': 'choose',
                'offset': 0,
                'order_by': 'draftkings_points'
            }
Esempio n. 8
0
    def __init__(self, headers=None, cookies=None, cache_name=None):

        # see http://stackoverflow.com/questions/8134444
        logging.getLogger(__name__).addHandler(logging.NullHandler())
        EWTScraper.__init__(self, headers=headers, cookies=cookies, cache_name=cache_name)

        self.headers = {'Referer': 'http://www.fantasylabs.com/nfl/player-models/',
                   'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0'}

        self.model_urls = {
            'default': 'http://www.fantasylabs.com/api/playermodel/1/{model_date}/?modelId=47139',
            'levitan': 'http://www.fantasylabs.com/api/playermodel/1/{model_date}/?modelId=524658',
            'bales': 'http://www.fantasylabs.com/api/playermodel/1/{model_date}/?modelId=170627',
            'csuram': 'http://www.fantasylabs.com/api/playermodel/1/{model_date}/?modelId=193726',
            'tournament': 'http://www.fantasylabs.com/api/playermodel/1/{model_date}/?modelId=193746',
            'cash': 'http://www.fantasylabs.com/api/playermodel/1/{model_date}/?modelId=193745'
        }
Esempio n. 9
0
    def __init__(self, headers=None, cookies=None, cache_name=None):
        
        logging.getLogger(__name__).addHandler(logging.NullHandler())

        if not headers:
            self.headers = {'Referer': 'http://www.fantasylabs.com/nfl/player-models/',
                        'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0'}
        else:
            self.headers = headers

        self.cookies = cookies
        self.cache_name = cache_name

        EWTScraper.__init__(self, headers=self.headers, cookies=self.cookies, cache_name=self.cache_name)

        self.adp_url = 'http://www.fantasypros.com/nfl/adp/overall.php?export=xls'
        self.projection_url = 'http://www.fantasypros.com/nfl/rankings/consensus-cheatsheets.php?export=xls'
Esempio n. 10
0
    def __init__(self,
                 api_key,
                 positions=['QB', 'RB', 'WR', 'TE'],
                 response_format='json',
                 league_format='standard',
                 **kwargs):
        '''
        Args:
            api_key (str): Must specify API key for successful requests
        '''

        # see http://stackoverflow.com/questions/8134444/python-constructor-of-derived-class
        EWTScraper.__init__(self, **kwargs)

        self.api_key = api_key
        self.positions = positions
        self.response_format = response_format
        self.league_format = league_format
Esempio n. 11
0
    def __init__(self, **kwargs):
        '''
        Args:
            **kwargs: projections_urls (list)
        '''

        # see http://stackoverflow.com/questions/8134444/python-constructor-of-derived-class
        EWTScraper.__init__(self, **kwargs)

        if 'projections_urls' in 'kwargs':
            self.projections_urls = kwargs['projections_urls']
        else:
            self.projections_urls = {
                'qb': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=10&LeagueID=26955',
                'rb1': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=20&LeagueID=26955',
                'rb2': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=20&LeagueID=26955&order_by=FFPts&sort_order=DESC&cur_page=1',
                'wr1': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=30&LeagueID=26955',
                'wr2': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=30&LeagueID=26955&order_by=FFPts&sort_order=DESC&cur_page=1',
                'te': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=40&LeagueID=26955',
                'dst': 'http://www.fftoday.com/rankings/playerproj.php?Season=2015&PosID=99&LeagueID=26955',
            }
Esempio n. 12
0
    def __init__(self, **kwargs):
        # see http://stackoverflow.com/questions/8134444
        EWTScraper.__init__(self, **kwargs)

        if 'logger' in kwargs:
            self.logger = kwargs['logger']
        else:
            self.logger = logging.getLogger(__name__) \
                .addHandler(logging.NullHandler())

        if 'maxindex' in kwargs:
            self.maxindex = kwargs['maxindex']
        else:
            self.maxindex = 400

        if 'projection_urls' in 'kwargs':
            self.projection_urls = kwargs['projection_urls']
        else:
            base_url = 'http://games.espn.go.com/ffl/tools/projections?'
            idx = [0, 40, 80, 120, 160, 200, 240, 280, 320, 360]
            self.projection_urls = ['{}startIndex={}'.format(base_url, x) for x in idx]