mirror of
https://github.com/simon987/chan_feed.git
synced 2025-04-19 18:16:44 +00:00
monitoring fix
This commit is contained in:
parent
fa32408b15
commit
e4a2e59c22
16
chan.py
16
chan.py
@ -31,6 +31,10 @@ class ChanHelper:
|
|||||||
def item_id(item):
|
def item_id(item):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def item_mtime(item):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def item_unique_id(self, item, board):
|
def item_unique_id(self, item, board):
|
||||||
return int(self.board_hash(board) + str(self.item_id(item)))
|
return int(self.board_hash(board) + str(self.item_id(item)))
|
||||||
|
|
||||||
@ -77,6 +81,10 @@ class HtmlChanHelper(ChanHelper):
|
|||||||
def thread_mtime(thread):
|
def thread_mtime(thread):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def item_id(item):
|
||||||
|
return 0 # TODO
|
||||||
|
|
||||||
def parse_threads_list(self, r):
|
def parse_threads_list(self, r):
|
||||||
soup = BeautifulSoup(r.text, "html.parser")
|
soup = BeautifulSoup(r.text, "html.parser")
|
||||||
|
|
||||||
@ -117,6 +125,10 @@ class JsonChanHelper(ChanHelper):
|
|||||||
def item_id(item):
|
def item_id(item):
|
||||||
return item["no"]
|
return item["no"]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def item_id(item):
|
||||||
|
return item["time"]
|
||||||
|
|
||||||
def item_urls(self, item, board):
|
def item_urls(self, item, board):
|
||||||
urls = set()
|
urls = set()
|
||||||
|
|
||||||
@ -158,6 +170,10 @@ class RussianJsonChanHelper(ChanHelper):
|
|||||||
def item_id(item):
|
def item_id(item):
|
||||||
return int(item["num"])
|
return int(item["num"])
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def item_mtime(item):
|
||||||
|
return item["timestamp"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_threads_list(r):
|
def parse_threads_list(r):
|
||||||
j = json.loads(r.text)
|
j = json.loads(r.text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user