MCPcopy Create free account
hub / github.com/datehoer/hotToday / get_3dm_data

Function get_3dm_data

threeDM/threeDM.py:3–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1from curl_cffi import requests
2import pyquery
3
4def get_3dm_data():
5 url = "https://www.3dmgame.com/phb.html"
6 headers = {
7 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
8 }
9 res = requests.get(url, headers=headers, timeout=30, impersonate="chrome")
10 doc = pyquery.PyQuery(res.content)
11 items = doc(".Phbright>.phlist").items()
12 data = []
13 for item in items:
14 title = item.find(".bt>a").text()
15 link = item.find(".bt>a").attr("href")
16 hotScore = item.find(".score_a>span").text()
17 data.append({
18 "title": title,
19 "url": link,
20 "hotScore": hotScore
21 })

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected