MCPcopy Create free account
hub / github.com/dataabc/weibo-crawler / sqlite_insert_comments

Method sqlite_insert_comments

weibo.py:2578–2589  ·  view source on GitHub ↗
(self, weibo, comments)

Source from the content-addressed store, hash-verified

2576 logger.exception(e)
2577
2578 def sqlite_insert_comments(self, weibo, comments):
2579 if not comments or len(comments) == 0:
2580 return
2581 con = self.get_sqlite_connection()
2582 for comment in comments:
2583 data = self.parse_sqlite_comment(comment, weibo)
2584 self.sqlite_insert(con, data, "comments")
2585 if "comments" in comment and isinstance(comment["comments"], list):
2586 for c in comment["comments"]:
2587 data = self.parse_sqlite_comment(c, weibo)
2588 self.sqlite_insert(con, data, "comments")
2589 con.close()
2590
2591 def sqlite_insert_reposts(self, weibo, reposts):
2592 if not reposts or len(reposts) == 0:

Callers

nothing calls this directly

Calls 3

get_sqlite_connectionMethod · 0.95
parse_sqlite_commentMethod · 0.95
sqlite_insertMethod · 0.95

Tested by

no test coverage detected