diff --git a/img/au.png b/img/au.png new file mode 100644 index 0000000..244c150 Binary files /dev/null and b/img/au.png differ diff --git a/img/btc.png b/img/btc.png new file mode 100644 index 0000000..da659b9 Binary files /dev/null and b/img/btc.png differ diff --git a/img/ca.png b/img/ca.png new file mode 100644 index 0000000..38049d3 Binary files /dev/null and b/img/ca.png differ diff --git a/img/cn.png b/img/cn.png new file mode 100644 index 0000000..4b5db74 Binary files /dev/null and b/img/cn.png differ diff --git a/img/dgd.png b/img/dgd.png new file mode 100644 index 0000000..4f7331a Binary files /dev/null and b/img/dgd.png differ diff --git a/img/etc.png b/img/etc.png new file mode 100644 index 0000000..51c007f Binary files /dev/null and b/img/etc.png differ diff --git a/img/eth.png b/img/eth.png new file mode 100644 index 0000000..dbb175b Binary files /dev/null and b/img/eth.png differ diff --git a/img/eu.png b/img/eu.png new file mode 100644 index 0000000..ef6b7ad Binary files /dev/null and b/img/eu.png differ diff --git a/img/gb.png b/img/gb.png new file mode 100644 index 0000000..987ac0c Binary files /dev/null and b/img/gb.png differ diff --git a/img/large.png b/img/large.png new file mode 100644 index 0000000..5f88fcc Binary files /dev/null and b/img/large.png differ diff --git a/img/plutus.png b/img/plutus.png new file mode 100644 index 0000000..3a4f1f0 Binary files /dev/null and b/img/plutus.png differ diff --git a/img/rep.png b/img/rep.png new file mode 100644 index 0000000..2edb99c Binary files /dev/null and b/img/rep.png differ diff --git a/img/us.png b/img/us.png new file mode 100644 index 0000000..b35cf5b Binary files /dev/null and b/img/us.png differ diff --git a/per-ticker.css b/per-ticker.css new file mode 100644 index 0000000..2a181c5 --- /dev/null +++ b/per-ticker.css @@ -0,0 +1,37 @@ +${css.selector} { + background-image: url(%%${ticker.name}%%); + background-repeat: repeat-x; + background-position-y: 0px; + display: block; + width: 100%; + height: 30px; + animation-name: ${ticker.name}; + -moz-animation-name: ${ticker.name}; + -webkit-animation-name: ${ticker.name}; + animation-iteration-count: infinite; + -moz-animation-iteration-count: infinite; + -webkit-animation-iteration-count: infinite; + animation-timing-function: linear; + -moz-animation-timing-function: linear; + -webkit-animation-timing-function: linear; + animation-duration: 30s; + -moz-animation-duration: 30s; + -webkit-animation-duration: 30s; + color: white; + content: " "; + position: absolute; + top: ${ticker.top}; +} + +@keyframes ${ticker.name} { + 0% { + background-position: ${ticker.width}px 0px; + background-position: -webkit-calc(50% + ${ticker.width}px) 0px; + background-position: calc(50% + ${ticker.width}px) 0px; + } + 100% { + background-position: 0 0px; + background-position: -webkit-calc(50% + 0) 0px; + background-position: calc(50% + 0) 0px; + } +} diff --git a/ticketh.conf b/ticketh.conf new file mode 100644 index 0000000..7e0f046 --- /dev/null +++ b/ticketh.conf @@ -0,0 +1,116 @@ +ticketh { + // General settings. + reddit { + frequencySeconds = 300 // Every 5 minutes + authUrl = "https://www.reddit.com/api/v1/" + apiUrl = "https://oauth.reddit.com/" + } + + // Define URLs, with %s placeholders for variables and interesting fields in the response. + providers { + etherscan { + url = "https://api.etherscan.io/api?module=stats&action=%s&tokenname=%s&apikey=KY27HKJKGJKSTP3FGI1IKB9RAJKRDH38WS" + fields { + supply = "/result" + } + } + coinmarketcap { + url = "https://api.coinmarketcap.com/v1/ticker/%s/" + fields { + price = "/0/price_usd" + } + } + coinmarketcapnexuist { + url = "https://coinmarketcap-nexuist.rhcloud.com/api/%s" + fields { + btcPrice = "/price/btc" + usdPrice = "/price/usd" + gbpPrice = "/price/gbp" + eurPrice = "/price/eur" + cnyPrice = "/price/cny" + cadPrice = "/price/cad" + audPrice = "/price/aud" + btcVolume = "/volume/btc" + usdVolume = "/volume/usd" + gbpVolume = "/volume/gbp" + eurVolume = "/volume/eur" + cnyVolume = "/volume/cny" + cadVolume = "/volume/cad" + audVolume = "/volume/aud" + } + } + cryptofresh { + url = "https://cryptofresh.com/api/asset/markets?asset=%s" + fields { + usdPrice = "/USD/price" + btcPrice = "/BTC/price" + } + } + } + + // Using the URLs defined above, choose some datapoints (first value is the name of the provider, the rest are used in the placeholders. + dataPoints { + eth = ["coinmarketcapnexuist", "eth"] + etc = ["coinmarketcapnexuist", "etc"] + + dgd = ["coinmarketcap", "digixdao"] + augur = ["coinmarketcap", "augur"] + plu = ["coinmarketcap", "pluton"] + } + + // Define the format of the ticker(s) here: + // Use the tokens as path in json \ suffix symbol \ / format red/green based on sign + // follows to display {response.field|€|¢|3|Y|Y} <- reduce big numbers with 'k' for thousands, 'M' for millions etc. + // formatted data. prefix symbol / \ decimal places + tickers { + upper-ticker { + font = "Segoe UI" + fontHeight = 14 + color = "#000000" + background = "#ffffffbb" + backgroundHighlight = "#ffff77bb" + positiveColor: "#00cc00ff" + negativeColor: "#cc0000ff" + top: "22px" + cssSelector: "span.redditname:before" + segments = [ + " ", + "! ","[[!/img/btc.png]]","! BTC {eth.btcPrice|฿ ||4|N|N|1} v:{eth.btcVolume|||1|N|Y|1} ", + " ", + "! ","[[!/img/us.png]]","! USD {eth.usdPrice|$||2|N|N|1} v:{eth.usdVolume|||1|N|Y|1} ", + " ", + " ","[[/img/gb.png]]"," GBP {eth.gbpPrice|£||2|N|N|1} v:{eth.gbpVolume|||1|N|Y|1} ", + " ", + " ","[[/img/eu.png]]"," EUR {eth.eurPrice|€||2|N|N|1} v:{eth.eurVolume|||1|N|Y|1} ", + " ", + " ","[[/img/cn.png]]"," CNY {eth.cnyPrice|¥||2|N|N|1} v:{eth.cnyVolume|||1|N|Y|1} ", + " ", + " ","[[/img/ca.png]]"," CAD {eth.cadPrice|$||2|N|N|1} v:{eth.cadVolume|||1|N|Y|1} ", + " ", + " ","[[/img/au.png]]"," AUD {eth.audPrice|$||2|N|N|1} v:{eth.audVolume|||1|N|Y|1} ", + " ", + ] + } + lower-ticker { + font = "Segoe UI" + fontHeight = 14 + color: "#ffffff" + background: "#00009999" + backgroundHighlight: "#00009999" + positiveColor: "#00cc00ff" + negativeColor: "#cc0000ff" + top: "44px" + cssSelector: "span.redditname:after" + segments = [ + "[[/img/dgd.png]]", + " DGD {dgd.price|$||2|N|N|1} ", + "[[/img/rep.png]]", + " AUG {augur.price|$||2|N|N|1} ", + "[[/img/etc.png]]", + " ETC {etc.usdPrice|$||2|N|N|1} ", + "[[/img/plutus.png]]", + " PLU {plu.price|$||2|N|N|1} " + ] + } + } +} diff --git a/ticketh.css b/ticketh.css new file mode 100644 index 0000000..f6803d1 --- /dev/null +++ b/ticketh.css @@ -0,0 +1,9 @@ +span.redditname:after,span.redditname:before { + -webkit-animation-play-state: paused; + animation-play-state: paused; +} + +span.redditname:hover:after,span.redditname:hover:before { + -webkit-animation-play-state: running; + animation-play-state: running; +}