-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbtctalk.py
59 lines (49 loc) · 1.87 KB
/
btctalk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from lxml import html
import requests
import sys
print ("""
bitcointalk.org intelligence scraping data
_ _ _ _ _ _ _
| |__ | |_ ___| |_ __ _| | | _(_)_ __ | |_
| '_ \| __/ __| __/ _` | | |/ | | '_ \| __|
| |_) | || (__| || (_| | | <| | | | | |_
|_.__/ \__\___|\__\__,_|_|_|\_|_|_| |_|\__|
maded with love <3 by blackout314 @ ghlab
-------------------------------------------
""")
if len(sys.argv) > 1:
uid = sys.argv[1]
profile = "https://bitcointalk.org/index.php?action=profile;u=" + uid
profilepage = requests.get(profile)
ptree = html.fromstring(profilepage.content)
pdata = ptree.xpath("//td[@class='windowbg']/table/tr/td/text()")
print ('[USER]', pdata[0])
print (' - (posts)', pdata[1])
print (' - (activity)', pdata[2])
print (' - (merit)', pdata[3])
print (' - (rank)', pdata[4])
print (' - (registered)', pdata[5])
print (' - (address)', pdata[11])
print (' - (location)', pdata[14])
print (' - (localtime)', pdata[15])
url = "https://bitcointalk.org/index.php?action=profile;u=" + uid + ";sa=statPanel"
page = requests.get(url)
tree = html.fromstring(page.content)
online = tree.xpath("//td[@class='windowbg2'][1]/table[1]/tr/td[2]/text()")
print ('[DATA]')
for d in online:
print (' >', d)
boards = tree.xpath("//td[@class='windowbg2'][2]/table/tr/td/a/text()")
boards_perc = tree.xpath("//td[@class='windowbg2'][2]/table/tr/td/text()")
print ('[BOARDS]')
for i in range(len(boards)):
print (' +', boards_perc[i], "", boards[i])
pboards = tree.xpath("//td[@class='windowbg2'][1]/table/tr/td/a/text()")
pboards_perc = tree.xpath("//div[@id='bodyarea']/table/tr/td/table/tr[6]/td[@class='windowbg2'][1]/table/tr/td/text()")
print ('[BOARDS]')
for i in range(len(pboards)):
print (' +', pboards_perc[i], "", pboards[i])
else:
print ("""
usage: python btctalk.py {UID}
""")