├── helper
├── qrs
│ └── logo3.png
├── main.css
├── app.js
└── make_wishlist.py
├── requirements.txt
├── README.md
└── wishlist-aas.py
/helper/qrs/logo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plowsof/xmr-wishlist-aaS/HEAD/helper/qrs/logo3.png
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | cryptocompare==0.7.5
2 | python_monerorpc==0.6.2
3 | qrcode==7.3
4 | requests==2.22.0
5 | filelock==3.0.12
6 | Pillow==8.3.2
7 | PyGithub==1.55
8 |
--------------------------------------------------------------------------------
/helper/main.css:
--------------------------------------------------------------------------------
1 | body[a="dark"] {
2 | filter: invert(1)
3 | }
4 |
5 | body[a="dark"] img {
6 | filter: invert(1)
7 | }
8 |
9 | body[a="dark"] img.ioda {
10 | filter: invert(0)
11 | }
12 |
13 | @media (prefers-color-scheme: dark) {
14 | body[a="auto"] {
15 | filter: invert(1)
16 | }
17 | body[a="auto"] img {
18 | filter: invert(1)
19 | }
20 | body[a="auto"] img.ioda {
21 | filter: invert(0)
22 | }
23 | }
24 |
25 | html,
26 | body {
27 | background: white
28 | }
29 |
30 | html {
31 | height: 100%
32 | }
33 |
34 | body {
35 | color: black ;
36 | font-family: monospace ;
37 | font-size: 16px ;
38 | line-height: 1.4 ;
39 | margin: 0 ;
40 | min-height: 100% ;
41 | overflow-wrap: break-word
42 | }
43 |
44 | .post-meta {
45 | text-align: right
46 | }
47 |
48 | h2,
49 | h3,
50 | h4,
51 | h5,
52 | h6 {
53 | margin-top: 3rem
54 | }
55 |
56 | hr {
57 | margin: 2rem 0
58 | }
59 |
60 | p {
61 | margin: 1rem 0
62 | }
63 |
64 | li {
65 | margin: 0.4rem 0
66 | }
67 |
68 | *:target {
69 | background: yellow
70 | }
71 |
72 | .w {
73 | max-width: 640px ;
74 | margin: 0 auto ;
75 | padding: 4rem 2rem
76 | }
77 |
78 | hr {
79 | text-align: center ;
80 | border: 0
81 | }
82 |
83 | hr:before {
84 | content: "/////"
85 | }
86 |
87 | hr:after {
88 | content: attr(data-content) "/////"
89 | }
90 |
91 | table {
92 | width: 100%
93 | }
94 |
95 | table,
96 | th,
97 | td {
98 | border: thin solid black ;
99 | border-collapse: collapse ;
100 | padding: 0.4rem
101 | }
102 |
103 | code {
104 | color: white ;
105 | background: black
106 | }
107 |
108 | div.highlighter-rouge code {
109 | display: block ;
110 | overflow-x: auto ;
111 | white-space: pre-wrap ;
112 | padding: 1rem
113 | }
114 |
115 | blockquote {
116 | font-style: italic ;wi
117 | border: thin solid black ;
118 | padding: 1rem
119 | }
120 |
121 | blockquote p {
122 | margin: 0
123 | }
124 |
125 | img {
126 | max-width: 100% ;
127 | display: block ;
128 | margin: 0 auto
129 | }
130 |
131 | .subaddress{
132 | color: yellow ;
133 | font-family: monospace ;
134 | cursor: pointer ;
135 | display: inline-block ;
136 | }
137 |
138 | .wishtitle{
139 | color: blue ;
140 | }
141 |
142 | #ascii-progress-bar{
143 | color: brown ;
144 | font: monospace ;
145 | font-size: 10px ;
146 | }
147 |
148 | .qrimage{
149 | color: blue ;
150 | }
151 |
152 | .qrbtn{
153 | text-align:center ;
154 | }
155 |
156 | input.accordion {
157 | display: none;
158 | }
159 |
160 | label.accordion {
161 | cursor: zoom-in;
162 | }
163 |
164 | input.accordion:checked ~ .qr-content {
165 | height: auto;
166 | padding: 1rem;
167 | }
168 |
169 | .qr-content {
170 | overflow: hidden;
171 | padding: 0;
172 | height: 0;
173 | -webkit-transition: all .5s ease;
174 | -moz-transition: all .5s ease;
175 | transition: all .5s ease;
176 | }
177 |
178 | .qr img {
179 | border-radius: 5px;
180 | max-width: 100%;
181 | }
182 |
183 |
184 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Live XMR wishlist as a service
2 |
3 | ## FlipStarter
4 | In an experiment to explore other funding alternatives to the CCS, (and extend the outreach of Monero), i have been funded by Flipstarter to make this multi-currency. XMR/BCH/BTC (and recently WOWnero) which is being developed [here](https://github.com/plowsof/flipstarter-waas-wip). I have been somewhat successful with my goals, as my new list is being used by someone else who has had one of their wishes successfully funded @ [Ruckniums Donation page](https://rucknium.me/donate) and can be span up in a few minutes using docker!
5 |
6 | ## About
7 | It will serve / push updates to a Json array file on github for any external websites to fetch and display.
8 | What you need:
9 | ```
10 | A github account / access token for the script (modify the variables accordingly)
11 | monero-wallet-rpc monitoring a view-only wallet
12 | ```
13 | Example json data
14 | ```
15 | https://github.com/plowsof/plowsof.github.io/blob/main/wishlist/wishlist-data.json
16 | ```
17 | The json array is 'live' and changes will be pushed to your page (adding/removing)
18 |
19 | In your monero-wallet-rpc config file:
20 | ```bash
21 | tx-notify=/usr/bin/python3 /path/to/wishlist-aas.py %s
22 | ```
23 |
24 | In your .html file:
25 | ```html
26 |
27 |
28 |
29 | ```
30 |
31 | In your .js file:
32 | ```
33 | see helpers/app.js
34 | ```
35 |
36 | ## Examples
37 | https://xmr.radio/funding src @ https://github.com/plowsof/funding-xmr-radio (i had full creative control over the UI for this one, so im especially proud!)
38 | https://funding.monerujo.app/
39 | https://moneroart.neocities.org/
40 |
41 | ## Setting up with an unused wallet
42 | - Modify ```helpers/make_wishlist.py``` to create your json wishlist, containing the subaddresses/descriptions of each wish.
43 | - Upload this file to your github and set the correct URL / github token values. (or ignore this step put it on your own server, im just poor ^^)
44 | - Configure your monero-wallet-rpc's 'tx-notify' value to call ```wishlist-aas.py``` with python3
45 | - Make sure that the pyhton script is using the correct ip:port for your rpc-wallet
46 |
47 | ## Setting up with an 'already used wallet'
48 | Now using rpc call ```get_transfers``` to load the wallet history (if any found) (no more wasting time creating a csv file from the GUI).
49 | - After creating a new wishlist, the wallet history will be imported into the json data (+= to contributors and amounts of the matching addresses)
50 | - see ```load_old_txs``` in ```helpers/make_wishlist.py```
51 |
52 | ## Modifying your list
53 | - An online json editor could be used to add/remove items easily. e.g:
54 | - https://jsoneditoronline.org
55 |
56 | ## Updates
57 | - QRimages generated for each subaddress + a custom logo see ```helpers/make_wishlist.py```
58 | - USD amounts accepted for each wish - then converted to current XMR value + a % buffer (can be changed on the fly to readjust goals also)
59 | - Generate a sub address for your wish if none is supplied see ```helpers/make_wishlist.py```.
60 | - Creating wishlist is now as simple as: (3rd arg is a wish 'type' to help display things on the front end)
61 | ```
62 | create_new_wishlist(500,"Something special",None,"work")
63 | create_new_wishlist(5,"buy me a coffee"86aSNJwDYC2AshDDvbGgtQ17RWspmKNwNXAqdFiFF2Db91v9PC26uDxffD9ZYfcMjvJpuKJepsQtELAdmXVk85E1DsuL6rG","gift")
64 | ```
65 | # Support
66 |
67 | This project has been fully funded by the Monero Outreach team @https://twitter.com/xmroutreach <3
68 |
69 | I enjoyed making this (because of how out of my depth i am with front end stuff), i will support you if you reach out to me with issues/q's reg. this.
70 | And if you want to show support to me, my xmr address is below, much appreciated! :')
71 | ```
72 | 86aSNJwDYC2AshDDvbGgtQ17RWspmKNwNXAqdFiFF2Db91v9PC26uDxffD9ZYfcMjvJpuKJepsQtELAdmXVk85E1DsuL6rG
73 | ```
74 |
--------------------------------------------------------------------------------
/helper/app.js:
--------------------------------------------------------------------------------
1 | let modified = "0"
2 |
3 | async function getWishlist() {
4 | let ran_int = Math.floor(Math.random() * 100000)
5 | //let url = 'https://raw.githubusercontent.com/plowsof/plowsof.github.io/main/wishlist/wishlist-data.json?uid=' + ran_int;
6 | let url = "https://raw.githubusercontent.com/plowsof/funding-xmr-radio/main/json/wishlist-data.json?uid=" + ran_int;
7 | try {
8 | let res = await fetch(url);
9 | return await res.json();
10 | } catch (error) {
11 | return null;
12 | }
13 | }
14 |
15 | async function renderWishlist() {
16 | let wishlist = await getWishlist();
17 | modified_live = wishlist["metadata"]["modified"]
18 | if (modified != modified_live){
19 | modified = modified_live
20 | let html_equip = '';
21 | let html_subsc = '';
22 | let id = 0
23 | let ran_int = Math.floor(Math.random() * 101);
24 | wishlist["wishlist"].forEach(wish => {
25 | let qrcheck = document.getElementById(`qr-${wish.address}`);
26 | let qrchecked = (qrcheck && qrcheck.checked)?" checked":"";
27 | //alert(qrchecked)
28 | wish.percent = wish.total / wish.goal * 100;
29 | let total = wish.total.toFixed(2)
30 | let goal = wish.goal.toFixed(2)
31 | //alert(wish.address)
32 | let ahead1 = wish.address.substr(0,4)
33 | let ahead2 = wish.address.substr(4,4)
34 | let atail1 = wish.address.substr(-8,4)
35 | let atail2 = wish.address.substr(-4,4)
36 | let atail = wish.address.substr(-5,5)
37 | let something = ""
38 | let address = something.concat(ahead1, " ", ahead2," .. ", atail1, " ", atail2)
39 | wish.percent = 50
40 | var current_percent = wish.percent;
41 | let ascii_progress = ''
42 | for (n = 0; n < 20; n++) {
43 | if (current_percent < (n+1)*5) {
44 | ascii_progress = ascii_progress.concat("░"); // alt-176
45 | }
46 | else {
47 | ascii_progress = ascii_progress.concat("▓"); // alt-178
48 | }
49 | }
50 | //alert(ascii_progress)
51 | //let address = wish.address
52 | //
53 | let qr =`
54 |
55 |
56 |