Пример #1
0
    def getChannel(self, channel, page=1):
        channel = channel.replace(self.domain, "")
        if page > 1:
            url = '%s%s/%d' % (self.domain, channel, page)
        else:
            url = '%s%s' % (self.domain, channel)

        response = self.request.get(url)
        return Channel().get(response)
Пример #2
0
    def getChannel(self, channel, page=1):
        channel = channel.replace(self.domain, "")
        if page > 1:
            if channel.endswith('.html'):
                channel = channel.replace(".html", "")
                url = '%s%s-%d.html' % (self.domain, channel, page)
            else:
                url = '%s%s/%d' % (self.domain, channel, page)
        else:
            url = '%s%s' % (self.domain, channel)

        response = self.request.get(url)
        return Channel().get(response)
Пример #3
0
 def search(self, text, page=1):
     url = "%s/tim-kiem/%s/" % (self.domain, urllib.quote_plus(text))
     response = self.request.get(url)
     return Channel().get(response)
Пример #4
0
 def getCategory(self):
     response = self.request.get(self.domain)
     return Category().get(response), Channel().get(response)