ruboty-ymcrawl 0.0.7 → 0.0.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 016d31aacb5f6c4a6ce96fa1d1eae935c36181fb
4
- data.tar.gz: c85f92a669b58f2502198af60a5abaf42e18a3c2
3
+ metadata.gz: c8e694eea5a87e30d53596aa02cf75da8697d358
4
+ data.tar.gz: 49b70cb6cdf93492e8f9cc9c0a13221bc03754b2
5
5
  SHA512:
6
- metadata.gz: e5f8e1070adf2a2788feea9772896fd7e9c64961c341294ace4b54b4c0f29348e64cb538c6e9c10cf8b5d33d2d482e04560444d624b8aef79d5d88faabdf582a
7
- data.tar.gz: 6a60710ffe1cf883ad133810b5d004a659c4d501b2ac88b778acbcb69cc045d4bbc93dcdbaa1733e94338d541f3580dc8b42684d94a4ec22dac20153f88b0101
6
+ metadata.gz: 3e19818fb8ae5ed3a5efb50530754cc58ac6d307753d2b78ca8f0092d6ba411ca98ef9b205eafda4671d04273da096e136bf0c721bb8cb440a08877ac074f596
7
+ data.tar.gz: 513f9cdce38e82e590232c0352c6145f32836eb02fb969eea15fd5b8f217c4651fbaf78a8dfc371458d6e8156f2f5f63892c00fd94df7dcf816d3eab617d3f7e
@@ -19,17 +19,26 @@ module Ruboty
19
19
  class YMCrawl < Base
20
20
  on(/hello\z/i, name: "hello", description: "Return hello")
21
21
 
22
+ def hello(message)
23
+ message.reply("hello!!")
24
+ end
25
+ end
26
+
27
+ class Test < Base
28
+ on(/test\z/i, name: "test", description: "Return test message")
29
+
30
+ def test(message)
31
+ message.reply("This is test!!")
32
+ end
33
+ end
34
+
35
+ class Crawl < Base
22
36
  on(
23
37
  /crawl ?(?<url>.+)?\z/i,
24
38
  name: "crawl",
25
39
  description: "crawl image"
26
40
  )
27
41
 
28
- def hello(message)
29
- message.reply("hello!!")
30
- end
31
-
32
-
33
42
  def get_access_token_message(url)
34
43
  return "You don't have access token.
35
44
  1. Go to: #{url}
@@ -63,7 +72,9 @@ module Ruboty
63
72
  message.reply(ex)
64
73
  end
65
74
  end
75
+ end
66
76
 
77
+ class VerifyAuthCode < Base
67
78
  on(
68
79
  /dropbox:auth ?(?<auth_code>.+)?\z/i,
69
80
  name: "verify_auth_code",
@@ -79,68 +90,7 @@ module Ruboty
79
90
  message.reply("You added access token!")
80
91
  message.reply("Try clawling again!")
81
92
  end
82
-
83
93
  end
84
94
 
85
- # class Crawl < Base
86
- # on(
87
- # /crawl ?(?<url>.+)?\z/i,
88
- # name: "crawl",
89
- # description: "crawl image"
90
- # )
91
-
92
- # def get_access_token_message(url)
93
- # return "You don't have access token.
94
- # 1. Go to: #{url}
95
- # 2. Click \"Allow\" (you might have to log in first).
96
- # 3. reply to bot as \"@bot dropbox:auth (auth_code) \""
97
- # end
98
-
99
- # def crawl(message)
100
- # url = (message[:url] == nil) ? "-- please set url --" : message[:url]
101
- # begin
102
- # crawl = CrawlManager.instance.get_crawl
103
- # uploader = crawl.get_uploader
104
-
105
- # # upload先がlocal以外かつアクセストークンが取得されていない場合は、取得先URLを示して終了
106
- # if not uploader.access_token? and uploader.get_name != "local"
107
- # message.reply( get_access_token_message( uploader.get_access_token_url ) )
108
- # return nil
109
- # end
110
-
111
- # message.reply("rubot is crawling from #{url}")
112
- # zip_paths = crawl.start([url])
113
- # message.reply("get zip file => #{zip_paths}")
114
- # rescue URI::InvalidURIError => ex
115
- # puts ex
116
- # message.reply("URL is invalid. please retry.")
117
- # rescue => ex
118
- # puts "error raise in Crawl.crawl"
119
- # puts ex
120
- # message.reply("Sorry, error occurred.")
121
- # message.reply("Please feedback this error to niboshiporipori@gmail.com")
122
- # message.reply(ex)
123
- # end
124
- # end
125
- # end
126
-
127
- # class VerifyAuthCode < Base
128
- # on(
129
- # /dropbox:auth ?(?<auth_code>.+)?\z/i,
130
- # name: "verify_auth_code",
131
- # description: "add access token by auth code"
132
- # )
133
-
134
- # def verify_auth_code(message)
135
- # auth_code = (message[:auth_code] == nil) ? "-- please set auth_code --" : message[:auth_code]
136
- # uploader = CrawlManager.instance.get_crawl.get_uploader
137
- # access_token = uploader.verify_auth_code(auth_code)
138
- # YMCrawl::DataManager.instance.update_access_token(uploader.get_name, access_token)
139
-
140
- # message.reply("You added access token!")
141
- # message.reply("Try clawling again!")
142
- # end
143
- # end
144
-
145
95
  end
146
96
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Ymcrawl
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-ymcrawl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - mpk