twoffein-client 0.1.0 → 0.1.1
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 +98 -95
- data/README.md.erb +4 -2
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/bin/twoffein-client +5 -8
- metadata +1 -1
data/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Twoffein-Client
|
|
2
|
-
Client-Version: 1.0
|
|
2
|
+
Client-Version: 0.1.0 | API-Version: 0.2
|
|
3
3
|
|
|
4
4
|
This client for [Twoffein](http://twoffein.com/)'s [API](http://twoffein.com/api-faq/).
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ SYNOPSIS
|
|
|
27
27
|
twoffein-client [global options] command [command options] [arguments...]
|
|
28
28
|
|
|
29
29
|
VERSION
|
|
30
|
-
1.0
|
|
30
|
+
0.1.0
|
|
31
31
|
|
|
32
32
|
GLOBAL OPTIONS
|
|
33
33
|
--help - Show this message
|
|
@@ -44,6 +44,7 @@ COMMANDS
|
|
|
44
44
|
|
|
45
45
|
## Examples
|
|
46
46
|
|
|
47
|
+
|
|
47
48
|
### Drinks
|
|
48
49
|
|
|
49
50
|
**Input:**
|
|
@@ -52,92 +53,94 @@ COMMANDS
|
|
|
52
53
|
|
|
53
54
|
**Output:**
|
|
54
55
|
```
|
|
55
|
-
Drink
|
|
56
|
-
|
|
57
|
-
Kaffee
|
|
58
|
-
Milchkaffee
|
|
59
|
-
Eiskaffee
|
|
60
|
-
Energy Drink
|
|
61
|
-
Cola
|
|
62
|
-
Cola Light
|
|
63
|
-
Cola Zero
|
|
64
|
-
Cola-Mix
|
|
65
|
-
Cola-Mix Light
|
|
66
|
-
Cola-Mix Zero
|
|
67
|
-
Bubble Tea
|
|
68
|
-
Cherry Cola
|
|
69
|
-
Vanilla Cola
|
|
70
|
-
Caffé Latte
|
|
71
|
-
Caffé au Lait
|
|
72
|
-
Latte Macchiato
|
|
73
|
-
Espresso Macciato
|
|
74
|
-
Espresso con Panne
|
|
75
|
-
Flat White
|
|
76
|
-
Caffé Breve
|
|
77
|
-
Caffé Mocha
|
|
78
|
-
Americano
|
|
79
|
-
Melange
|
|
80
|
-
Red Eye
|
|
81
|
-
Tee
|
|
82
|
-
Eistee
|
|
83
|
-
Kakao
|
|
84
|
-
Mate
|
|
85
|
-
Espresso
|
|
86
|
-
Cappuccino
|
|
87
|
-
Vannillochino
|
|
88
|
-
Instantkaffee
|
|
89
|
-
Mokka
|
|
90
|
-
Chai-Latte
|
|
91
|
-
Grünen Tee
|
|
92
|
-
Schwarztee
|
|
93
|
-
1337MATE
|
|
94
|
-
Club-Mate
|
|
95
|
-
Club-Mate Cola
|
|
96
|
-
ICE-Tea KRAFTSTOFF
|
|
97
|
-
Premium-Cola
|
|
98
|
-
Dr Pepper
|
|
99
|
-
Vita Cola
|
|
100
|
-
Vita Cola Mix
|
|
101
|
-
Vita Cola Pur
|
|
102
|
-
Schokocino
|
|
103
|
-
afri cola
|
|
104
|
-
afri sugarfree
|
|
105
|
-
afri power
|
|
106
|
-
fritz-kola
|
|
107
|
-
fritz-kola stevia
|
|
108
|
-
fritz-kola zuckerfrei
|
|
109
|
-
mischmasch
|
|
110
|
-
Haji Cola
|
|
111
|
-
KILLERFISH Hot Energy
|
|
112
|
-
Café Frappé
|
|
113
|
-
Energy Shot
|
|
114
|
-
Wasser
|
|
115
|
-
Mineralwasser
|
|
116
|
-
Apfelsaft
|
|
117
|
-
Orangensaft
|
|
118
|
-
Milch
|
|
119
|
-
Sojamilch
|
|
120
|
-
Orangenlimonade
|
|
121
|
-
Zitronenlimonade
|
|
122
|
-
Kräuterlimonade
|
|
123
|
-
Apfelsaftschorle
|
|
124
|
-
Ginger Ale
|
|
125
|
-
Tonic Water
|
|
126
|
-
Bitter Lemon
|
|
127
|
-
Bananensaft
|
|
128
|
-
Traubensaft
|
|
129
|
-
Milchshake
|
|
130
|
-
Joghurtdrink
|
|
131
|
-
Smoothie
|
|
132
|
-
Espresso Doppio
|
|
133
|
-
Fassbrause
|
|
134
|
-
Ayran
|
|
135
|
-
Flora Power
|
|
136
|
-
VOLT Cola
|
|
137
|
-
COFAIN 699
|
|
138
|
-
Erdbeersaft
|
|
139
|
-
KiBa
|
|
140
|
-
Müllermilch
|
|
56
|
+
Drink (key)
|
|
57
|
+
--------------------------------------------
|
|
58
|
+
Kaffee (kaffee)
|
|
59
|
+
Milchkaffee (milchkaffee)
|
|
60
|
+
Eiskaffee (eiskaffee)
|
|
61
|
+
Energy Drink (energiedrink)
|
|
62
|
+
Cola (cola)
|
|
63
|
+
Cola Light (colalight)
|
|
64
|
+
Cola Zero (colazero)
|
|
65
|
+
Cola-Mix (colamix)
|
|
66
|
+
Cola-Mix Light (colamixlight)
|
|
67
|
+
Cola-Mix Zero (colamixzero)
|
|
68
|
+
Bubble Tea (bubbletea)
|
|
69
|
+
Cherry Cola (cherrycola)
|
|
70
|
+
Vanilla Cola (vanillacola)
|
|
71
|
+
Caffé Latte (cafelatte)
|
|
72
|
+
Caffé au Lait (cafeaulait)
|
|
73
|
+
Latte Macchiato (lattemacchiato)
|
|
74
|
+
Espresso Macciato (espressomacciato)
|
|
75
|
+
Espresso con Panne (espressoconpanne)
|
|
76
|
+
Flat White (flatwhite)
|
|
77
|
+
Caffé Breve (caffebreve)
|
|
78
|
+
Caffé Mocha (caffemocha)
|
|
79
|
+
Americano (americano)
|
|
80
|
+
Melange (melange)
|
|
81
|
+
Red Eye (redeye)
|
|
82
|
+
Tee (tee)
|
|
83
|
+
Eistee (eistee)
|
|
84
|
+
Kakao (kakao)
|
|
85
|
+
Mate (mate)
|
|
86
|
+
Espresso (espresso)
|
|
87
|
+
Cappuccino (cappuccino)
|
|
88
|
+
Vannillochino (vannillochino)
|
|
89
|
+
Instantkaffee (instantkaffee)
|
|
90
|
+
Mokka (mokka)
|
|
91
|
+
Chai-Latte (chailatte)
|
|
92
|
+
Grünen Tee (guenertee)
|
|
93
|
+
Schwarztee (schwarztee)
|
|
94
|
+
1337MATE (leetmate)
|
|
95
|
+
Club-Mate (clubmate)
|
|
96
|
+
Club-Mate Cola (clubmatecola)
|
|
97
|
+
ICE-Tea KRAFTSTOFF (kraftstoff)
|
|
98
|
+
Premium-Cola (premiumcola)
|
|
99
|
+
Dr Pepper (drpepper)
|
|
100
|
+
Vita Cola (vitacola)
|
|
101
|
+
Vita Cola Mix (vitacolamix)
|
|
102
|
+
Vita Cola Pur (vitacolapur)
|
|
103
|
+
Schokocino (schokocino)
|
|
104
|
+
afri cola (africola)
|
|
105
|
+
afri sugarfree (afrisugarfree)
|
|
106
|
+
afri power (afripower)
|
|
107
|
+
fritz-kola (fritzkola)
|
|
108
|
+
fritz-kola stevia (fritzkolastevia)
|
|
109
|
+
fritz-kola zuckerfrei (fritzkolazuckerfrei)
|
|
110
|
+
mischmasch (mischmasch)
|
|
111
|
+
Haji Cola (hajicola)
|
|
112
|
+
KILLERFISH Hot Energy (killerfishhotenergy)
|
|
113
|
+
Café Frappé (cafefrappe)
|
|
114
|
+
Energy Shot (energyshot)
|
|
115
|
+
Wasser (wasser)
|
|
116
|
+
Mineralwasser (mineralwasser)
|
|
117
|
+
Apfelsaft (apfelsaft)
|
|
118
|
+
Orangensaft (orangensaft)
|
|
119
|
+
Milch (milch)
|
|
120
|
+
Sojamilch (sojamilch)
|
|
121
|
+
Orangenlimonade (orangenlimonade)
|
|
122
|
+
Zitronenlimonade (zitronenlimonade)
|
|
123
|
+
Kräuterlimonade (kraeuterlimonade)
|
|
124
|
+
Apfelsaftschorle (apfelsaftschorle)
|
|
125
|
+
Ginger Ale (gingerale)
|
|
126
|
+
Tonic Water (tonicwater)
|
|
127
|
+
Bitter Lemon (bitterlemon)
|
|
128
|
+
Bananensaft (bananensaft)
|
|
129
|
+
Traubensaft (traubensaft)
|
|
130
|
+
Milchshake (milchshake)
|
|
131
|
+
Joghurtdrink (joghurtdrink)
|
|
132
|
+
Smoothie (smoothie)
|
|
133
|
+
Espresso Doppio (espressodoppio)
|
|
134
|
+
Fassbrause (fassbrause)
|
|
135
|
+
Ayran (ayran)
|
|
136
|
+
Flora Power (florapower)
|
|
137
|
+
VOLT Cola (voltcola)
|
|
138
|
+
COFAIN 699 (cofain669)
|
|
139
|
+
Erdbeersaft (erdbeersaft)
|
|
140
|
+
KiBa (kiba)
|
|
141
|
+
Müllermilch (muellermilch)
|
|
142
|
+
Malzbier (malzbier)
|
|
143
|
+
Rhabarberschorle (rhabarberschorle)
|
|
141
144
|
```
|
|
142
145
|
|
|
143
146
|
### Drinks (filtered)
|
|
@@ -148,10 +151,10 @@ Müllermilch (muellermilch)
|
|
|
148
151
|
|
|
149
152
|
**Output:**
|
|
150
153
|
```
|
|
151
|
-
Drink
|
|
152
|
-
|
|
153
|
-
Club-Mate
|
|
154
|
-
Club-Mate Cola
|
|
154
|
+
Drink (key)
|
|
155
|
+
------------------------------
|
|
156
|
+
Club-Mate (clubmate)
|
|
157
|
+
Club-Mate Cola (clubmatecola)
|
|
155
158
|
```
|
|
156
159
|
|
|
157
160
|
### Profile
|
|
@@ -164,9 +167,9 @@ Club-Mate Cola (clubmatecola)
|
|
|
164
167
|
```
|
|
165
168
|
Quest: Blitzlicht
|
|
166
169
|
Drink: Club-Mate
|
|
167
|
-
Rank:
|
|
170
|
+
Rank: 74
|
|
168
171
|
Rank Title: Kaffeekännchen
|
|
169
|
-
Drunken:
|
|
172
|
+
Drunken: 16
|
|
170
173
|
Bluttwoffeinkonzentration: 1%
|
|
171
174
|
First Login: 2012-07-08 13:36
|
|
172
175
|
Screen Name: DSIW
|
|
@@ -195,7 +198,7 @@ _Notice: You can't send yourself a cookie._
|
|
|
195
198
|
```
|
|
196
199
|
Ich trinke gerade Club-Mate.
|
|
197
200
|
Info: Youre Tweet has been tweeted. Thanks.
|
|
198
|
-
Drinks today:
|
|
201
|
+
Drinks today: 2
|
|
199
202
|
```
|
|
200
203
|
|
|
201
204
|
## Contributing
|
data/README.md.erb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Twoffein-Client
|
|
2
|
-
Client-Version: <%= require File.absolute_path("lib/twoffein-client/version.rb", __FILE__); Twoffein::Client::VERSION %> | API-Version: <%= require File.absolute_path("lib/twoffein-client/version.rb", __FILE__); Twoffein::Server::VERSION %>
|
|
2
|
+
Client-Version: <%= require File.absolute_path("../lib/twoffein-client/version.rb", __FILE__); Twoffein::Client::VERSION %> | API-Version: <%= require File.absolute_path("../lib/twoffein-client/version.rb", __FILE__); Twoffein::Server::VERSION %>
|
|
3
3
|
|
|
4
4
|
This client for [Twoffein](http://twoffein.com/)'s [API](http://twoffein.com/api-faq/).
|
|
5
5
|
|
|
@@ -25,7 +25,7 @@ Or install it yourself as:
|
|
|
25
25
|
|
|
26
26
|
## Examples
|
|
27
27
|
<%
|
|
28
|
-
def example(title, command);
|
|
28
|
+
def self.example(title, command);
|
|
29
29
|
title = "### #{title}"
|
|
30
30
|
input = "**Input:**\n\n #{command.gsub("bundle exec bin/",'')}"
|
|
31
31
|
output = "**Output:**\n```\n#{%x[#{command}]}```"
|
|
@@ -41,6 +41,8 @@ Or install it yourself as:
|
|
|
41
41
|
|
|
42
42
|
<%= example "Cookie", "bundle exec bin/twoffein-client cookie DSIW" %>
|
|
43
43
|
|
|
44
|
+
_Notice: You can't send yourself a cookie._
|
|
45
|
+
|
|
44
46
|
<%= example "Tweet", "bundle exec bin/twoffein-client tweet clubmate" %>
|
|
45
47
|
|
|
46
48
|
## Contributing
|
data/Rakefile
CHANGED
|
@@ -40,16 +40,16 @@ task :default => [:spec,:features]
|
|
|
40
40
|
module Erb
|
|
41
41
|
require 'erb'
|
|
42
42
|
|
|
43
|
-
def rm_basename_ext file, extension
|
|
43
|
+
def self.rm_basename_ext file, extension
|
|
44
44
|
path = Pathname.new(file)
|
|
45
45
|
path.basename.sub(/\.#{extension}$/, '').to_s
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
def target_of file
|
|
48
|
+
def self.target_of file
|
|
49
49
|
rm_basename_ext(file, "erb")
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def generate_file file, options={}
|
|
52
|
+
def self.generate_file file, options={}
|
|
53
53
|
target = target_of file
|
|
54
54
|
puts "generating #{target}"
|
|
55
55
|
return if options[:noop]
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.1
|
data/bin/twoffein-client
CHANGED
|
@@ -24,7 +24,7 @@ command :profile do |c|
|
|
|
24
24
|
#if options[:grep]
|
|
25
25
|
#puts Profiles.search(/#{options["grep"]}/i)
|
|
26
26
|
#else
|
|
27
|
-
puts Profile.get
|
|
27
|
+
puts Profile.get(profile)
|
|
28
28
|
#end
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -36,11 +36,8 @@ command :drinks do |c|
|
|
|
36
36
|
c.flag :grep
|
|
37
37
|
|
|
38
38
|
c.action do |global_options,options,args|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
else
|
|
42
|
-
puts Drinks.new
|
|
43
|
-
end
|
|
39
|
+
drinks = options[:grep] ? Drinks.search(/#{options[:grep]}/i) : Drinks.new
|
|
40
|
+
puts drinks.to_s
|
|
44
41
|
end
|
|
45
42
|
end
|
|
46
43
|
|
|
@@ -59,7 +56,7 @@ command :tweet do |c|
|
|
|
59
56
|
info = tweet.publish unless DEBUG
|
|
60
57
|
puts 'Info: ' + info[:info] unless info.nil?
|
|
61
58
|
puts 'Drinks today: ' + info[:tweets].to_s if info && !info[:tweets].nil?
|
|
62
|
-
rescue
|
|
59
|
+
rescue Server::Error => e
|
|
63
60
|
puts e.message
|
|
64
61
|
end
|
|
65
62
|
end
|
|
@@ -75,7 +72,7 @@ command :cookie do |c|
|
|
|
75
72
|
begin
|
|
76
73
|
info = cookie.send unless DEBUG
|
|
77
74
|
puts 'Info: ' + info[:info] unless info.nil?
|
|
78
|
-
rescue
|
|
75
|
+
rescue Server::Error => e
|
|
79
76
|
puts e.message
|
|
80
77
|
end
|
|
81
78
|
end
|