Subversion Repositories SmartDukaan

Rev

Rev 5291 | Rev 5761 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5291 Rev 5639
Line 1... Line 1...
1
'''
1
'''
2
Created on 05-Dec-2011
2
Created on 05-Dec-2011
3
@author: Varun Gupta
3
@author: Varun Gupta
4
'''
4
'''
-
 
5
from Scrapers.TradusScraper import TradusScraper
-
 
6
from Scrapers.SulekhaScraper import SulekhaScraper
5
 
7
 
6
class URL:
8
class URL:
7
    
9
    
8
    def __init__(self, url):
10
    def __init__(self, url):
9
        self.url = url
11
        self.url = url
Line 23... Line 25...
23
        return '%s (%s)' % (self.url, self.source)
25
        return '%s (%s)' % (self.url, self.source)
24
 
26
 
25
class URLQueue:
27
class URLQueue:
26
 
28
 
27
    def __init__(self):
29
    def __init__(self):
-
 
30
        TradusScraper.currentPage = 1
-
 
31
        SulekhaScraper.currentPage = 1
28
        self.urls = [
32
        self.urls = [
29
            URL('http://www.flipkart.com/mobiles/all/'),
33
            URL('http://www.flipkart.com/mobiles/all/'),
30
            URL('http://www.snapdeal.com/json/product/get/search/175/0/20?q=&sort=plrty&keyword='),
34
            URL('http://www.snapdeal.com/json/product/get/search/175/0/20?q=&sort=plrty&keyword='),
31
            URL('http://www.infibeam.com/Mobiles/search'),
35
            URL('http://www.infibeam.com/Mobiles/search'),
32
            URL('http://www.homeshop18.com/gsm-handsets/category:3027/'),
36
            URL('http://www.homeshop18.com/gsm-handsets/category:3027/'),
33
            URL('http://www.flipkart.com/mobiles/tablet-20278'),
37
            URL('http://www.flipkart.com/mobiles/tablet-20278'),
34
            URL('http://www.snapdeal.com/json/product/get/search/133/0/20?q=&sort=plrty&keyword='),
38
            URL('http://www.snapdeal.com/json/product/get/search/133/0/20?q=&sort=plrty&keyword='),
35
            URL('http://www.homeshop18.com/ipads-2f-tablets/category:8937/'),
39
            URL('http://www.homeshop18.com/ipads-2f-tablets/category:8937/'),
-
 
40
            URL('http://www.tradus.com/search/tradus_search/?query=mobile&filters=cat:7756'),
-
 
41
            URL('http://mobiles.sulekha.com/common/common.aspx?type=mobileofferslist&makeId=0&modelId=0&pageNo='),
36
            #URL('http://www.adexmart.com/modules/coremanager/modules/filtersearch/filtersearch.json.php?act=filter&ident=16&page=1&perpage=1000&orderby=newest&orderway=desc')
42
            #URL('http://www.adexmart.com/modules/coremanager/modules/filtersearch/filtersearch.json.php?act=filter&ident=16&page=1&perpage=1000&orderby=newest&orderway=desc')
37
        ]
43
        ]
38
    
44
    
39
    def enqueue(self, url):
45
    def enqueue(self, url):
40
        
46