Tom Dickman
7 years ago
12 changed files with 236 additions and 35 deletions
@ -1 +1,2 @@ |
|||
results.json |
|||
dist/index.html |
|||
|
@ -1,4 +1,5 @@ |
|||
# Notes |
|||
|
|||
http://whattomine.com/coins.json |
|||
TODO: Remove cookies from git |
|||
* http://whattomine.com/coins.json |
|||
* TODO: Remove cookies from git |
|||
* Icons: https://github.com/allienworks/cryptocoins |
|||
|
@ -0,0 +1,29 @@ |
|||
import requests |
|||
|
|||
|
|||
class CMC: |
|||
def get_listings(self): |
|||
results = {} |
|||
page_size = 100 |
|||
start = 1 |
|||
while True: |
|||
print(start) |
|||
resp = requests.get('https://api.coinmarketcap.com/v2/ticker/?sort=id&start={}'.format(start)) |
|||
data = resp.json() |
|||
# Stop when we hit the end |
|||
if data['metadata'].get('error') == 'id not found': |
|||
break |
|||
for _id, coin in data['data'].items(): |
|||
results[coin['symbol']] = { |
|||
'rank': coin['rank'], |
|||
'market_cap': coin['quotes']['USD']['market_cap'], |
|||
'price': coin['quotes']['USD']['price'], |
|||
'website_slug': coin['website_slug'] |
|||
} |
|||
start += page_size |
|||
return results |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
cmc = CMC() |
|||
print(cmc.get_listings()) |
@ -0,0 +1,14 @@ |
|||
import json |
|||
from jinja2 import Template |
|||
|
|||
|
|||
def render(results): |
|||
with open('src/index.html', 'r') as f: |
|||
template = Template(f.read()) |
|||
with open('dist/index.html', 'w') as g: |
|||
g.write(template.render(results={'coins': results})) |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
with open('results.json', 'r') as f: |
|||
render(json.load(f)) |
@ -0,0 +1,25 @@ |
|||
html { |
|||
font-size: 14px; |
|||
} |
|||
@media (min-width: 768px) { |
|||
html { |
|||
font-size: 16px; |
|||
} |
|||
} |
|||
|
|||
.container { |
|||
max-width: 960px; |
|||
} |
|||
|
|||
.pricing-header { |
|||
max-width: 700px; |
|||
} |
|||
|
|||
.card-deck .card { |
|||
min-width: 220px; |
|||
} |
|||
|
|||
.border-top { border-top: 1px solid #e5e5e5; } |
|||
.border-bottom { border-bottom: 1px solid #e5e5e5; } |
|||
|
|||
.box-shadow { box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); } |
@ -1,8 +0,0 @@ |
|||
<html lang="en"> |
|||
<head> |
|||
</head> |
|||
<body> |
|||
<p>Hi</p> |
|||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> |
|||
</body> |
|||
</html> |
@ -0,0 +1,122 @@ |
|||
<!doctype html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
|||
<meta name="description" content=""> |
|||
<meta name="author" content=""> |
|||
<link rel="icon" href="../../../../favicon.ico"> |
|||
|
|||
<title>Cryptocurrencies that are Vulnerable to a 51% Attack</title> |
|||
|
|||
<!-- Bootstrap core CSS --> |
|||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> |
|||
|
|||
<!-- Custom styles for this template --> |
|||
<link href="style.css" rel="stylesheet"> |
|||
|
|||
<!-- Coin icons --> |
|||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cryptocoins-icons@2.7.0/webfont/cryptocoins.css"> |
|||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cryptocoins-icons@2.7.0/webfont/cryptocoins-colors.css"> |
|||
</head> |
|||
|
|||
<body> |
|||
|
|||
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow"> |
|||
<h5 class="my-0 mr-md-auto font-weight-normal">51crypto</h5> |
|||
<nav class="my-2 my-md-0 mr-md-3"> |
|||
<a class="p-2 text-dark" href="#">About</a> |
|||
</nav> |
|||
</div> |
|||
|
|||
<div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center"> |
|||
<h1 class="display-4">Vulnerable PoW Coins</h1> |
|||
<p class="lead">This is a collection of coins that are vulnerable to a 51% attack + the price to complete it.</p> |
|||
</div> |
|||
|
|||
<div class="container"> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th scope="col">Rank</th> |
|||
<th scope="col">Name</th> |
|||
<th scope="col">Symbol</th> |
|||
<th scope="col">Market Cap</th> |
|||
<th scope="col">Algorithm</th> |
|||
<th scope="col">Hash Rate</th> |
|||
<th scope="col">1h Attack Cost</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{% for coin in results.coins %} |
|||
<tr> |
|||
<th scope="row">{{ coin.rank }}</th> |
|||
<!-- <td><a href="{{ coin.cmc_link }}"><i class="cc {{coin.symbol }}"></i> {{ coin.name }}</a></td> --> |
|||
<td><a href="https://www.coinmarketcap.com/currencies/{{ coin.cmc_slug }}">{{ coin.name }}</a></td> |
|||
<td>{{ coin.symbol }}</td> |
|||
<td>{{ coin.market_cap }}</td> |
|||
<td>{{ coin.algorithm }}</td> |
|||
<td>{{ coin.hash_rate_pretty }}</td> |
|||
<td>{{ coin.hour_cost }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</tbody> |
|||
</table> |
|||
|
|||
<footer class="pt-4 my-md-5 pt-md-5 border-top"> |
|||
<div class="row"> |
|||
<div class="col-12 col-md"> |
|||
<img class="mb-2" src="https://getbootstrap.com/assets/brand/bootstrap-solid.svg" alt="" width="24" height="24"> |
|||
<small class="d-block mb-3 text-muted">© 2017-2018</small> |
|||
</div> |
|||
<div class="col-6 col-md"> |
|||
<h5>Features</h5> |
|||
<ul class="list-unstyled text-small"> |
|||
<li><a class="text-muted" href="#">Cool stuff</a></li> |
|||
<li><a class="text-muted" href="#">Random feature</a></li> |
|||
<li><a class="text-muted" href="#">Team feature</a></li> |
|||
<li><a class="text-muted" href="#">Stuff for developers</a></li> |
|||
<li><a class="text-muted" href="#">Another one</a></li> |
|||
<li><a class="text-muted" href="#">Last time</a></li> |
|||
</ul> |
|||
</div> |
|||
<div class="col-6 col-md"> |
|||
<h5>Resources</h5> |
|||
<ul class="list-unstyled text-small"> |
|||
<li><a class="text-muted" href="#">Resource</a></li> |
|||
<li><a class="text-muted" href="#">Resource name</a></li> |
|||
<li><a class="text-muted" href="#">Another resource</a></li> |
|||
<li><a class="text-muted" href="#">Final resource</a></li> |
|||
</ul> |
|||
</div> |
|||
<div class="col-6 col-md"> |
|||
<h5>About</h5> |
|||
<ul class="list-unstyled text-small"> |
|||
<li><a class="text-muted" href="#">Team</a></li> |
|||
<li><a class="text-muted" href="#">Locations</a></li> |
|||
<li><a class="text-muted" href="#">Privacy</a></li> |
|||
<li><a class="text-muted" href="#">Terms</a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</footer> |
|||
</div> |
|||
|
|||
|
|||
<!-- Bootstrap core JavaScript |
|||
================================================== --> |
|||
<!-- Placed at the end of the document so the pages load faster --> |
|||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> |
|||
<script>window.jQuery || document.write('<script src="../../../../assets/js/vendor/jquery-slim.min.js"><\/script>')</script> |
|||
<script src="../../../../assets/js/vendor/popper.min.js"></script> |
|||
<script src="../../../../dist/js/bootstrap.min.js"></script> |
|||
<script src="../../../../assets/js/vendor/holder.min.js"></script> |
|||
<script> |
|||
Holder.addTheme('thumb', { |
|||
bg: '#55595c', |
|||
fg: '#eceeef', |
|||
text: 'Thumbnail' |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue