-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata_scraping.py
63 lines (48 loc) · 2.35 KB
/
data_scraping.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
60
61
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from newspaper import Article
satoshi_nakamoto = ["http://nakamotoinstitute.org/bitcoin/"]
wei_dai = ["http://nakamotoinstitute.org/b-money/"]
timothy_may = ["http://nakamotoinstitute.org/crypto-anarchist-manifesto/",
"http://nakamotoinstitute.org/virtual-communities/"]
nick_szabo = ["http://nakamotoinstitute.org/formalizing-securing-relationships/",
"http://nakamotoinstitute.org/contract-language/",
"http://nakamotoinstitute.org/secure-property-titles/",
"http://nakamotoinstitute.org/trusted-third-parties/",
"http://nakamotoinstitute.org/contracts-with-bearer/",
"http://nakamotoinstitute.org/the-god-protocols/",
"http://nakamotoinstitute.org/multinational-small-business/",
"http://nakamotoinstitute.org/shelling-out/",
"http://nakamotoinstitute.org/bit-gold/",
"http://nakamotoinstitute.org/advances-in-distributed-security/",
"http://nakamotoinstitute.org/the-playdough-protocols/",
"http://nakamotoinstitute.org/measuring-value/",
"http://nakamotoinstitute.org/intrapolynomial-cryptography/",
"http://nakamotoinstitute.org/smart-contracts-glossary/",
"http://nakamotoinstitute.org/scarce-objects/",
"http://nakamotoinstitute.org/negative-reputation/"]
ian_grigg = ["http://nakamotoinstitute.org/the-ricardian-contract/",
"http://nakamotoinstitute.org/triple-entry-accounting/"]
hal_finney = ["http://nakamotoinstitute.org/bitcoin-and-me/",
"http://nakamotoinstitute.org/for-pay-remailers/",
"http://nakamotoinstitute.org/politics-vs-technology/",
"http://nakamotoinstitute.org/pgp-web-of-trust-misconceptions/",
"http://nakamotoinstitute.org/rpow/",
"http://nakamotoinstitute.org/digital-cash-and-privacy/"]
author = [satoshi_nakamoto, wei_dai, timothy_may, nick_szabo, ian_grigg, hal_finney]
author_name = ["satoshi_nakamoto", "wei_dai", "timothy_may", "nick_szabo", "ian_grigg", "hal_finney"]
for i in range(len(author)):
for j in range(len(author[i])):
article = Article(author[i][j])
article.download()
article.parse()
with open('{}.txt'.format(author_name[i]), 'a') as f:
f.write(article.text)
url = "http://satoshi.nakamotoinstitute.org/emails/cryptography/"
for k in range(2,19):
new_url = url + str(k)
article = Article(new_url)
article.download()
article.parse()
with open('satoshi_nakamoto_email.txt', 'a') as f:
f.write('{}'.format(article.text))