File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ scripts:
12
12
greasemonkey:
13
13
collapsetips - script to collapse ChangeTips on /r/bitcoin
14
14
bitcoinwisdom - script to add USD on Chinese exchanges
15
+ reddit-btc-ticker - script to add BTC price ticker on /r/bitcoin
15
16
16
17
from other repos/gists:
17
18
subgit - nice script for easily managing sub-projects (like these)
Original file line number Diff line number Diff line change
1
+ // ==UserScript==
2
+ // @name Reddit BTC Ticker
3
+ // @namespace topherkhaew
4
+ // @include https://www.reddit.com/r/Bitcoin/*
5
+ // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
6
+ // @version 1
7
+ // @grant GM_xmlhttpRequest
8
+ // ==/UserScript==
9
+
10
+ function add_btc_price ( price ) {
11
+ var btc_css = {
12
+ "position" : "absolute" ,
13
+ "top" : "60px" ,
14
+ "right" : "60px" ,
15
+ "font-size" : "14pt"
16
+ } ;
17
+ var btc = jQuery ( "<div>" + parseFloat ( price ) . toFixed ( 2 ) + "</div>" ) . appendTo ( "#header" ) ;
18
+ btc . css ( btc_css ) ;
19
+ }
20
+
21
+ GM_xmlhttpRequest ( {
22
+ method : "GET" ,
23
+ url : "https://blockchain.info/ticker" ,
24
+ onload : function ( response ) {
25
+ data = $ . parseJSON ( response . responseText ) ;
26
+ add_btc_price ( data [ 'USD' ] [ 'last' ] ) ;
27
+ }
28
+ } ) ;
29
+
You can’t perform that action at this time.
0 commit comments