mirror of
				https://github.com/Mueller-Patrick/Betterzon.git
				synced 2025-11-04 02:25:48 +00:00 
			
		
		
		
	.
This commit is contained in:
		
							parent
							
								
									233a5ba140
								
							
						
					
					
						commit
						f1d6487701
					
				| 
						 | 
					@ -2,13 +2,13 @@
 | 
				
			||||||
<module type="WEB_MODULE" version="4">
 | 
					<module type="WEB_MODULE" version="4">
 | 
				
			||||||
  <component name="FacetManager">
 | 
					  <component name="FacetManager">
 | 
				
			||||||
    <facet type="Python" name="Python">
 | 
					    <facet type="Python" name="Python">
 | 
				
			||||||
      <configuration sdkName="Python 3.9" />
 | 
					      <configuration sdkName="Python 3.9 (venv)" />
 | 
				
			||||||
    </facet>
 | 
					    </facet>
 | 
				
			||||||
  </component>
 | 
					  </component>
 | 
				
			||||||
  <component name="NewModuleRootManager" inherit-compiler-output="true">
 | 
					  <component name="NewModuleRootManager" inherit-compiler-output="true">
 | 
				
			||||||
    <exclude-output />
 | 
					    <exclude-output />
 | 
				
			||||||
    <content url="file://$MODULE_DIR$" />
 | 
					    <content url="file://$MODULE_DIR$" />
 | 
				
			||||||
    <orderEntry type="sourceFolder" forTests="false" />
 | 
					    <orderEntry type="sourceFolder" forTests="false" />
 | 
				
			||||||
    <orderEntry type="library" name="Python 3.9 interpreter library" level="application" />
 | 
					    <orderEntry type="library" name="Python 3.9 (venv) interpreter library" level="application" />
 | 
				
			||||||
  </component>
 | 
					  </component>
 | 
				
			||||||
</module>
 | 
					</module>
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,5 @@
 | 
				
			||||||
import sql
 | 
					import sql
 | 
				
			||||||
 | 
					import amazonspider
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def crawl(product_ids: [int]) -> dict:
 | 
					def crawl(product_ids: [int]) -> dict:
 | 
				
			||||||
| 
						 | 
					@ -50,13 +51,14 @@ def crawl(product_ids: [int]) -> dict:
 | 
				
			||||||
        'products_with_problems': products_with_problems
 | 
					        'products_with_problems': products_with_problems
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
def __crawl_amazon__(product_info: dict) -> tuple:
 | 
					def __crawl_amazon__(product_info: dict) -> tuple:
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Crawls the price for the given product from amazon
 | 
					    Crawls the price for the given product from amazon
 | 
				
			||||||
    :param product_info: A dict with product info containing product_id, vendor_id, url
 | 
					    :param product_info: A dict with product info containing product_id, vendor_id, url
 | 
				
			||||||
    :return: A tuple with the crawled data, containing (product_id, vendor_id, price_in_cents)
 | 
					    :return: A tuple with the crawled data, containing (product_id, vendor_id, price_in_cents)
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    amazonspider.start_crawling()
 | 
				
			||||||
    return (product_info['product_id'], product_info['vendor_id'], 123)
 | 
					    return (product_info['product_id'], product_info['vendor_id'], 123)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user