tipjar 0.1.171 → 0.1.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/bitbot/plugin/common.rb +1 -1
- data/lib/bitbot/plugin/deposit.rb +1 -1
- data/lib/bitbot/plugin/log.rb +11 -0
- data/lib/bitbot/plugin/version.rb +1 -1
- data/lib/bitbot/plugin.rb +21 -7
- data/tipjar.gemspec +2 -1
- metadata +5 -4
- data/README_old.md +0 -140
data/README.md
CHANGED
data/lib/bitbot/plugin/common.rb
CHANGED
@@ -111,7 +111,7 @@ module Bitbot::Common
|
|
111
111
|
btc_str = btc_str.irc(:green)
|
112
112
|
end
|
113
113
|
|
114
|
-
usd_str = "[".irc(:grey) + satoshi_to_usd(satoshi).irc(:
|
114
|
+
usd_str = "[".irc(:grey) + satoshi_to_usd(satoshi).irc(:orange) + "]".irc(:grey)
|
115
115
|
|
116
116
|
"#{btc_str} #{usd_str}"
|
117
117
|
end
|
@@ -3,7 +3,7 @@ module Bitbot::Deposit
|
|
3
3
|
user_id = db.get_or_create_user_id_for_username(m.user.user)
|
4
4
|
|
5
5
|
unless cached_addresses
|
6
|
-
m.reply "TipJar is
|
6
|
+
m.reply "Sorry, TipJar is initializing its database. Please try again in a minute."
|
7
7
|
return
|
8
8
|
end
|
9
9
|
|
data/lib/bitbot/plugin.rb
CHANGED
@@ -43,24 +43,38 @@ class Bitbot::Plugin
|
|
43
43
|
set :prefix, ""
|
44
44
|
|
45
45
|
#
|
46
|
-
# Private messages
|
46
|
+
# Private messages ~ replies sent via PRIVMSG
|
47
47
|
#
|
48
48
|
match /^help(.*)$/, :method => :on_help, :react_on => :private
|
49
49
|
match /^balance$/, :method => :on_balance, :react_on => :private
|
50
50
|
match /^history$/, :method => :on_history, :react_on => :private
|
51
51
|
match /^withdraw(.*)$/, :method => :on_withdraw, :react_on => :private
|
52
52
|
match /^deposit$/, :method => :on_deposit, :react_on => :private
|
53
|
-
match
|
53
|
+
match /^ping$/, :method => :on_ping, :react_on => :private
|
54
54
|
# match /^\+prize\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_prize, :react_on => :private
|
55
55
|
|
56
56
|
#
|
57
|
-
#
|
57
|
+
# Private messages ~ replies sent via channel
|
58
|
+
#
|
59
|
+
match /^\+tip\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_tip, :react_on => :channel
|
60
|
+
|
61
|
+
#
|
62
|
+
# Channel messages ~ replies sent via channel
|
58
63
|
#
|
59
64
|
match /^\+help(.*)$/, :method => :on_help, :react_on => :channel
|
60
65
|
match /^\+tipstats$/, :method => :on_tipstats, :react_on => :channel
|
61
66
|
match /^\+tip\s+(\w+)\s+([\d.]+)\s+?(.*)/, :method => :on_tip, :react_on => :channel
|
62
|
-
match /^\+doc$/, :method => :
|
63
|
-
match /^\+ticker$/, :method => :
|
67
|
+
match /^\+doc$/, :method => :on_doc, :react_on => :channel
|
68
|
+
match /^\+ticker$/, :method => :on_ticker, :react_on => :channel
|
69
|
+
match /^\+txfee$/, :method => :on_txfee, :react_on => :channel
|
70
|
+
match /^\+version$/, :method => :on_version, :react_on => :channel
|
71
|
+
|
72
|
+
#
|
73
|
+
# Channel messages ~ replies sent via PRIVMSG
|
74
|
+
#
|
75
|
+
match /^\+balance$/, :method => :on_balance, :react_on => :private
|
76
|
+
match /^\+help$/, :method => :on_help, :react_on => :private
|
77
|
+
match /^\+history$/, :method => :on_history, :react_on => :private
|
64
78
|
|
65
79
|
#
|
66
80
|
# Timer jobs
|
@@ -74,7 +88,7 @@ class Bitbot::Plugin
|
|
74
88
|
#
|
75
89
|
listen_to :connect, :method => :on_update_exchange_rates
|
76
90
|
listen_to :connect, :method => :on_update_addresses
|
77
|
-
listen_to :connect, :method => :on_online
|
78
|
-
listen_to :connect, :method => :on_doc
|
91
|
+
# listen_to :connect, :method => :on_online
|
92
|
+
# listen_to :connect, :method => :on_doc
|
79
93
|
|
80
94
|
end
|
data/tipjar.gemspec
CHANGED
@@ -2,13 +2,14 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{tipjar}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.191"
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["WeirdThall", "Zach Wily"]
|
8
8
|
s.email = ["weirdthall@gmail.com", "zach@zwily.com"]
|
9
9
|
s.homepage = %q{http://github.com/weirdthall/TipJar}
|
10
10
|
s.summary = %q{Bitcoin IRC Tip Bot}
|
11
11
|
s.description = ["A Bitcoin IRC Tip Bot on freenode"]
|
12
|
+
s.license = "MIT"
|
12
13
|
|
13
14
|
s.files = `git ls-files`.split("\n")
|
14
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tipjar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.191
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cinch
|
@@ -120,7 +120,6 @@ files:
|
|
120
120
|
- .gitignore
|
121
121
|
- Gemfile
|
122
122
|
- README.md
|
123
|
-
- README_old.md
|
124
123
|
- Rakefile
|
125
124
|
- bin/bitbot
|
126
125
|
- bitbot.gemspec
|
@@ -133,6 +132,7 @@ files:
|
|
133
132
|
- lib/bitbot/plugin/doc.rb
|
134
133
|
- lib/bitbot/plugin/help.rb
|
135
134
|
- lib/bitbot/plugin/history.rb
|
135
|
+
- lib/bitbot/plugin/log.rb
|
136
136
|
- lib/bitbot/plugin/online.rb
|
137
137
|
- lib/bitbot/plugin/ping.rb
|
138
138
|
- lib/bitbot/plugin/prize.rb
|
@@ -147,7 +147,8 @@ files:
|
|
147
147
|
- lib/ircstring.rb
|
148
148
|
- tipjar.gemspec
|
149
149
|
homepage: http://github.com/weirdthall/TipJar
|
150
|
-
licenses:
|
150
|
+
licenses:
|
151
|
+
- MIT
|
151
152
|
post_install_message:
|
152
153
|
rdoc_options: []
|
153
154
|
require_paths:
|
data/README_old.md
DELETED
@@ -1,140 +0,0 @@
|
|
1
|
-
# Bitbot
|
2
|
-
|
3
|
-
An IRC bit-tip style bot. Just for fun, don't use with lots of coins.
|
4
|
-
|
5
|
-
## Security
|
6
|
-
|
7
|
-
**You probably don't want to use this.**
|
8
|
-
|
9
|
-
This section is first because anything Bitcoin related seems to attract
|
10
|
-
l33t hax0rs. This is just a toy. You probably shouldn't use it, and if
|
11
|
-
you do, you shouldn't put much money into it. Here's why:
|
12
|
-
|
13
|
-
Bitbot does not operate on nicknames, but usernames. Therefore, it's
|
14
|
-
only secure on IRC networks where usernames are forced. *This probably
|
15
|
-
isn't true of whatever IRC network you're on.* (On our IRC network,
|
16
|
-
usernames cannot be spoofed.) In order to be secure, the bot would need
|
17
|
-
to authenticate users in some other way, perhaps by using NickServ or
|
18
|
-
something. Pull requests accepted.
|
19
|
-
|
20
|
-
Bitbot uses an online wallet at https://blockchain.info. This was
|
21
|
-
because it was the easiest path forward, but it is not the most secure.
|
22
|
-
Blockchain.info itself seems reasonably secure, but if someone were to
|
23
|
-
breach its servers, they would be able to steal all the coins stored by
|
24
|
-
Bitbot. A better setup would be for Bitbot to perform its own
|
25
|
-
transactions on the Bitcoin network. Pull requests accepted. :)
|
26
|
-
|
27
|
-
Bitbot is based on a Ruby IRC library called
|
28
|
-
[Cinch](https://github.com/cinchrb/cinch). I have no idea how secure
|
29
|
-
Cinch is - it's possible that it has a remote code execution
|
30
|
-
vulnerability. If it does, an attacker can steal all the coins from
|
31
|
-
Bitbot.
|
32
|
-
|
33
|
-
Hopefully the above has scared you off from installing this and using it
|
34
|
-
on Freenode. If it didn't, then you deserve to lose whatever you put in.
|
35
|
-
You could just send it to me directly instead:
|
36
|
-
`1zachsQ82fM7DC4HZQXMAAmkZ2Qg7pH2V`.
|
37
|
-
|
38
|
-
## How Does It Work
|
39
|
-
|
40
|
-
Bitbot lets people in IRC send each other Bitcoin. It's loosely modelled
|
41
|
-
after the [Reddit Bitcointip](http://redd.it/13iykn).
|
42
|
-
|
43
|
-
The big difference is that in Bitbot, tips between users do not show up
|
44
|
-
in the blockchain. Bitbot maintains a wallet with all of the deposited
|
45
|
-
funds, and then keeps a record of transactions between users. Only
|
46
|
-
deposits and withdrawals to and from Bitbot show up in the Bitcoin
|
47
|
-
blockchain.
|
48
|
-
|
49
|
-
We do this because our tips are generally pretty tiny, and if each one
|
50
|
-
were a real transaction, our entire "Bitconomy" would be eaten up by
|
51
|
-
transaction fees.
|
52
|
-
|
53
|
-
## Installation
|
54
|
-
|
55
|
-
* Install the dependencies (sqlite3)
|
56
|
-
|
57
|
-
* Install the gem:
|
58
|
-
|
59
|
-
```bash
|
60
|
-
gem install bitbot
|
61
|
-
```
|
62
|
-
|
63
|
-
* Create an online wallet at https://blockchain.info/wallet/ . Create a
|
64
|
-
secondary password on it, and I suggest locking access to the IP from
|
65
|
-
which your bot will be running for an little extra security. It's
|
66
|
-
probably also good to set up (encrypted) wallet backups to go to your
|
67
|
-
email address.
|
68
|
-
|
69
|
-
* Create a data directory for Bitbot:
|
70
|
-
|
71
|
-
```bash
|
72
|
-
$ mkdir ~/.bitbot
|
73
|
-
```
|
74
|
-
|
75
|
-
* Create a bitbot.yml file that looks like this:
|
76
|
-
|
77
|
-
```yaml
|
78
|
-
irc:
|
79
|
-
server: irc.example.com
|
80
|
-
port: 8765
|
81
|
-
ssl: true
|
82
|
-
nick: bitbot
|
83
|
-
username: bitbot@example.com
|
84
|
-
password: blahblah
|
85
|
-
|
86
|
-
blockchain:
|
87
|
-
wallet_id: <long guid>
|
88
|
-
password1: <password>
|
89
|
-
password2: <secondary password>
|
90
|
-
withdrawal_fee: <fee in satoshi, default: 50000>
|
91
|
-
|
92
|
-
data:
|
93
|
-
path: /home/me/.bitbot
|
94
|
-
```
|
95
|
-
|
96
|
-
* Start the bot:
|
97
|
-
|
98
|
-
```bash
|
99
|
-
$ bitbot start <path to config.yml>
|
100
|
-
```
|
101
|
-
|
102
|
-
## Usage
|
103
|
-
|
104
|
-
### Help
|
105
|
-
|
106
|
-
To get help, `/msg bitbot help`. He will respond with a list of commands
|
107
|
-
he supports:
|
108
|
-
|
109
|
-
```
|
110
|
-
bitbot: Commands: deposit, balance, history, withdrawal
|
111
|
-
```
|
112
|
-
|
113
|
-
### Deposit
|
114
|
-
|
115
|
-
To make a deposit to your Bitbot account, ask bitbot for your depositing
|
116
|
-
address: `/msg bitbot deposit`. Bitbot will respond with a Bitcoin
|
117
|
-
address to send coins to. Once
|
118
|
-
|
119
|
-
### Tipping
|
120
|
-
|
121
|
-
To tip somebody, you must both be in a room with Bitbot. The syntax is
|
122
|
-
`+tip <nickname> <amount in BTC> <message>`. When Bitbot sees that, it
|
123
|
-
verifies that you have the funds to tip, does a `whois` on the recipient
|
124
|
-
nickname, and then transfers the funds. He then responds with a
|
125
|
-
confirmation:
|
126
|
-
|
127
|
-
```
|
128
|
-
bob: how do i make rails tests fast?
|
129
|
-
john: refactor your app so you can test it without rails
|
130
|
-
bob: +tip john 0.01 ur so smart
|
131
|
-
bitbot: [✔] Verified: bob ➜ ฿+0.01 [$1.12] ➜ john
|
132
|
-
```
|
133
|
-
|
134
|
-
### Withdrawing
|
135
|
-
|
136
|
-
When you want to withdraw funds to another Bitcoin address, just tell
|
137
|
-
Bitbot: `/msg bitbot withdraw <amount> <address>`.
|
138
|
-
|
139
|
-
Bitbot will verify that you have enough money, and send `<amount>` BTC -
|
140
|
-
0.0005 (to cover the transaction fee) to the specified `<address>`.
|