Initial commit

This commit is contained in:
root
2017-03-23 04:20:57 +00:00
commit 1804bb542a
20 changed files with 61 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
*.pyc
userpw.py
cachedCMC.txt
+1
View File
@@ -0,0 +1 @@
A ticker for top coinmarketcap listings based on the ethtrader-ticker project.
+18
View File
@@ -0,0 +1,18 @@
import requests
cmcurl = 'https://api.coinmarketcap.com/v1/ticker?limit=10'
def getcmc():
ticker_string = ''
try:
r = requests.get('https://api.coinmarketcap.com/v1/ticker?limit=10')
j = r.json()
with open('cachedCMC.txt', 'w') as f:
f.write(r.text)
except:
print("Failed to get CMC via API")
with open('cachedCMC.txt', 'r') as f:
j = f.read().json()
for i in j:
ticker_string += "|{}|${}|B{}".format(i['symbol'], i['price_usd'], i['price_btc'])
return ticker_string
Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

+30
View File
@@ -0,0 +1,30 @@
import reddit
import cmc
prawer = reddit.prawer()
prawer.r.login(reddit.username, reddit.password)
sub = prawer.r.get_subreddit('xdn')
ss = sub.get_stylesheet()
ticker_text = cmc.getcmc()
ss_text = """
#header {
background-repeat: repeat;
-webkit-animation: banner 300s infinite linear;
animation: banner 300s infinite linear;
}
@-webkit-keyframes banner {
from { background-position: 0 0px; }
to { background-position: -5402px 500px; }
}
@keyframes banner {
from { background-position: 0 0px; }
to { background-position: -5402px 0px; }
}
"""
sub.set_stylesheet(ss_text)
print(sub.title)
+9
View File
@@ -0,0 +1,9 @@
import praw
from userpw import *
class prawer:
def __init__(self):
self.r = praw.Reddit(client_id=client_id, client_secret=client_secret,
username=username, password=password,
user_agent=user_agent)