Example #1
0
 def __init__(self):
     try:
         self.client = thrift_utils.get_thrift_client(
             pipeline_config.PARSER_SERVICE_HOST,
             pipeline_config.PARSER_SERVICE_PORT, ParserService)
     except Thrift.TException, tx:
         print "%s" % tx.message
         exit("Parser service not running!")
 def __init__(self):
     try:
         self.client = thrift_utils.get_thrift_client(pipeline_config.PARSER_SERVICE_HOST,
                                                      pipeline_config.PARSER_SERVICE_PORT,
                                                      ParserService)
     except Thrift.TException, tx:
         print "%s" % tx.message
         exit("Parser service not running!")
 def __init__(self):
     self.parser_meta = {
         "amazon.in": {
             "title": "//div[@id='titleSection']/h1[@id='title']/span[@id='productTitle']/text()",
             "price": "//div[@id='price']/table[@class='a-lineitem']/tbody/tr/td/span[@id='priceblock_saleprice']/text()"
         },
         "www.flipkart.com": {
             "title": "//div[@class='title-wrap line fk-font-family-museo section omniture-field']/h1/text()",
             "price": "//div[@class='prices']/div/span[@class='selling-price omniture-field']/text()",
             "out_of_stock": "//div[@class='out-of-stock']/div[@class='out-of-stock-text']/div[@class='out-of-stock-status']/text()"
         }
     }
     try:
         self.writer_client = thrift_utils.get_thrift_client(pipeline_config.WRITER_SERVICE_HOST,
                                                             pipeline_config.WRITER_SERVICE_PORT,
                                                             WriterService)
     except Thrift.TException, tx:
         logging.error("%s" % tx.message)
         exit("Writer service not running!")
Example #4
0
 def __init__(self):
     self.parser_meta = {
         "amazon.in": {
             "title":
             "//div[@id='titleSection']/h1[@id='title']/span[@id='productTitle']/text()",
             "price":
             "//div[@id='price']/table[@class='a-lineitem']/tbody/tr/td/span[@id='priceblock_saleprice']/text()"
         },
         "www.flipkart.com": {
             "title":
             "//div[@class='title-wrap line fk-font-family-museo section omniture-field']/h1/text()",
             "price":
             "//div[@class='prices']/div/span[@class='selling-price omniture-field']/text()",
             "out_of_stock":
             "//div[@class='out-of-stock']/div[@class='out-of-stock-text']/div[@class='out-of-stock-status']/text()"
         }
     }
     try:
         self.writer_client = thrift_utils.get_thrift_client(
             pipeline_config.WRITER_SERVICE_HOST,
             pipeline_config.WRITER_SERVICE_PORT, WriterService)
     except Thrift.TException, tx:
         logging.error("%s" % tx.message)
         exit("Writer service not running!")