def __init__(self):
     configuration = AppConfiguration()
     self.logger = configuration.getLogger(__name__)
     self.url = 'https://br.investing.com/crypto/currencies/'
     self.headers = {
         'User-Agent': 'Chrome/39.0.2171.95'
     }
Exemplo n.º 2
0
 def __init__(self):
     configuration = AppConfiguration()
     repository = configuration.getMongoDBProperty()
     self.logger = configuration.getLogger(__name__)
     try:
         if (repository.username is not None):
             self.db = MongoClient(host=repository.host,
                                   port=repository.port,
                                   username=repository.username,
                                   password=repository.password)
         else:
             self.db = MongoClient(host=repository.host,
                                   port=repository.port)
     except:
         pass
 def __init__(self):
     configuration = AppConfiguration()
     self.logger = configuration.getLogger(__name__)
 def __init__(self):
     configuration = AppConfiguration()
     self.logger = configuration.getLogger(__name__)
     self.service = SrapingRowsService()
     self.translator = RowToDataTranslator()
     self.repository = QuotationRepository()
Exemplo n.º 5
0
#!/bin/python
import sys
import json

from infrastructure.configuration.Configuration import AppConfiguration

from application.usecase.StartMiningUseCase import StartMiningUseCase
from application.usecase.ReportUseCase import ReportUseCase

configuration = AppConfiguration()
logger = configuration.getLogger(__name__)


def mining():
    try:
        response = StartMiningUseCase().execute()
        logger.info('Mining - SizeOf: %d' % (len(response, )))
    except Exception as err:
        logger.fatal(err)
        pass


def report():
    try:
        response = ReportUseCase().execute()
        logger.info('Report - SizeOf: %d' % (len(response, )))
        for data in response:
            logger.info('Name: %s - Price: %s - Capitalization: %s' % (
                data.name,
                data.price,
                data.capitalization,
Exemplo n.º 6
0
 def __init__(self):
     configuration = AppConfiguration()
     self.logger = configuration.getLogger(__name__)
     self.translator = DocumentDataTranslator()
     self.repository = QuotationRepository()