Пример #1
0
 def isknown(self, url):
     request = HttpRequestGet(host=self.host, path='/url/isknown')
     request.set("User-Agent", USER_AGENT)
     request.set("Accept", "application/xml;text/xml")
     request.set("Accept-Charset", "utf-8")
     request.query("url", url)
     request.query("consumer_key", "none")
     return send_request(request.writable(), self.ip, self.port)
Пример #2
0
 def choose(self, limit=10):
     request = HttpRequestGet(host=self.host, path='/url/choose')
     request.set("User-Agent", USER_AGENT)
     request.set("Accept", "application/xml;text/xml")
     request.set("Accept-Charset", "utf-8")
     request.query("consumer_key", "none")
     response = send_request(request.writable(), self.ip, self.port)
     return self.__process(response)
Пример #3
0
 def fetched(self, url):
     request = HttpRequestPut(host=self.host, path='/url/fetched')
     request.set("User-Agent", USER_AGENT)
     request.set("Accept", "application/xml;text/xml")
     request.set("Accept-Charset", "utf-8")
     request.store("url", url)
     request.store("consumer_key", "none")
     request.store("token", "none")
     return send_request(request.writable(), self.ip, self.port)