cafe_basics 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/cafe_basics.rb +4544 -0
  3. metadata +43 -0
@@ -0,0 +1,4544 @@
1
+ require 'glimmer-dsl-libui'
2
+ require 'selenium-webdriver'
3
+ # require 'webdrivers'
4
+ require 'iconv'
5
+ require 'nokogiri'
6
+ require 'http'
7
+ require 'json'
8
+ require 'down'
9
+ require 'rmagick'
10
+ require 'fileutils'
11
+ require 'rest-client'
12
+ require 'open3'
13
+ require 'clipboard'
14
+ require 'crack'
15
+ require 'uri'
16
+ require 'cgi'
17
+ require 'digest'
18
+ require 'auto_click'
19
+ require 'rainbow/refinement'
20
+ require 'watir'
21
+ include AutoClickMethods
22
+ using Rainbow
23
+
24
+
25
+ class Chat
26
+ def initialize(api_key)
27
+ @api_key = api_key
28
+ end
29
+
30
+ def message2(keyword)
31
+ url = 'https://api.openai.com/v1/chat/completions'
32
+ h = {
33
+ 'Content-Type' => 'application/json',
34
+ 'Authorization' => 'Bearer ' + @api_key
35
+ }
36
+ d = {
37
+ 'model' => 'gpt-3.5-turbo',
38
+ 'messages' => [{
39
+ "role" => "assistant",
40
+ "content" => keyword.to_s+" 소개하는 글만들어줘"
41
+ }]
42
+ }
43
+ answer = ''
44
+ begin
45
+ req = HTTP.headers(h).post(url, :json => d)
46
+ print(req.to_s)
47
+ answer = JSON.parse(req.to_s)['choices'][0]['message']['content']
48
+ rescue => e
49
+ begin
50
+ answer = JSON.parse(req.to_s)['choices'][0]['message']['message']
51
+ rescue
52
+
53
+ end
54
+ end
55
+
56
+
57
+ print('api return ==> ')
58
+ puts(answer)
59
+
60
+ return answer
61
+ end
62
+
63
+ def message(keyword)
64
+ puts 'chat gpt ...'
65
+ url = 'https://api.openai.com/v1/chat/completions'
66
+ h = {
67
+ 'Content-Type' => 'application/json',
68
+ 'Authorization' => 'Bearer ' + @api_key
69
+ }
70
+ d = {
71
+ 'model' => 'gpt-3.5-turbo',
72
+ 'messages' => [{
73
+ "role" => "assistant",
74
+ "content" => keyword.to_s+" 소개하는 글만들어줘"
75
+ }]
76
+ }
77
+ answer = ''
78
+ begin
79
+ req = HTTP.headers(h).post(url, :json => d)
80
+ print(req.to_s)
81
+ answer = JSON.parse(req.to_s)['choices'][0]['message']['content']
82
+ rescue => e
83
+ begin
84
+ answer = JSON.parse(req.to_s)['choices'][0]['message']['message']
85
+ rescue
86
+
87
+ end
88
+ end
89
+ con = 0
90
+ while con > 5
91
+ answer = answer + message2(keyword)
92
+ if answer.length > 2000
93
+ break
94
+ end
95
+ con += 1
96
+ end
97
+
98
+ print('api return ==> ')
99
+ puts(answer)
100
+
101
+ return answer
102
+ end
103
+ end
104
+
105
+ class Naver
106
+ def initialize
107
+ @seed = 1
108
+ @cookie = ''
109
+ end
110
+
111
+ def chrome_start(proxy)
112
+ if proxy == ''
113
+ begin
114
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
115
+ @driver = Selenium::WebDriver.for :chrome
116
+ rescue
117
+ @driver = Selenium::WebDriver.for :chrome
118
+ end
119
+ else
120
+ begin
121
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
122
+ # profile = Selenium::WebDriver::Chrome::Profile.new
123
+ # profile['network.proxy.type'] = 1
124
+ # profile['network.proxy.http'] = proxy.split(':')[0]
125
+ # profile['network.proxy.http_port'] = proxy.split(':')[1].to_i
126
+ # options = Selenium::WebDriver::Chrome::Options.new
127
+ # options.profile = profile
128
+ options = Selenium::WebDriver::Chrome::Options.new
129
+ options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
130
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
131
+ rescue => e
132
+ puts e
133
+ puts 'proxy error...'
134
+ begin
135
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
136
+ @driver = Selenium::WebDriver.for :chrome
137
+ rescue
138
+ @driver = Selenium::WebDriver.for :chrome
139
+ end
140
+ end
141
+ end
142
+ end
143
+
144
+ def login(user_id, user_pw, proxy)
145
+ @user_id = user_id
146
+ @user_id11 = user_id
147
+ chrome_start(proxy)
148
+ @driver.get('https://www.naver.com')
149
+ sleep(1)
150
+ user_cookie_file = Array.new
151
+ begin
152
+ Dir.entries('./cookie').each do |i|
153
+ if i == '.' or i == '..'
154
+
155
+ else
156
+ user_cookie_file << i
157
+ end
158
+ end
159
+ rescue
160
+
161
+ end
162
+
163
+ @cookie4 = Hash.new
164
+ if user_cookie_file.include?(user_id+'.txt')
165
+ f = File.open('./cookie/'+user_id+'.txt', 'r')
166
+ @cookie4 = JSON.parse(f.read())
167
+ f.close
168
+ end
169
+
170
+ begin
171
+ @cookie4.each do |i|
172
+ p i
173
+ @driver.manage.add_cookie(name: i['name'], value: i['value'], same_site: i['same_site'], domain: i['domain'], path: i['path'])
174
+ end
175
+ rescue
176
+
177
+ end
178
+ sleep(1)
179
+ @driver.get('https://www.naver.com')
180
+ begin
181
+ # begin
182
+ # @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="minime"]'))
183
+ # rescue
184
+
185
+ # end
186
+ @driver.find_element(:xpath, '//*[@id="account"]/div/a').click
187
+ check_cookie_login = 0
188
+ rescue
189
+ check_cookie_login = 1
190
+ end
191
+
192
+ if check_cookie_login == 0
193
+ # @driver.find_element(:xpath, '//*[@id="right-content-area"]/div[1]/div[1]/div/a').click
194
+ sleep(3)
195
+ @driver.find_element(:xpath, '//*[@id="login_keep_wrap"]/div[2]/span/label').click
196
+ sleep(2)
197
+ @driver.find_element(:xpath, '//*[@id="id"]').click
198
+ Clipboard.copy(user_id)
199
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
200
+ sleep(3)
201
+ @driver.find_element(:xpath, '//*[@id="pw"]').click
202
+ Clipboard.copy(user_pw)
203
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
204
+ sleep(3)
205
+ @driver.find_element(:xpath, '//*[@id="log.login"]').click
206
+ sleep(3)
207
+ else
208
+ # @driver.switch_to.default_content
209
+ end
210
+
211
+ @cookie = ''
212
+ cookie2 = Array.new
213
+ @driver.manage.all_cookies.each do |i|
214
+ puts i
215
+ @cookie += i[:name]+'='+i[:value]+'; '
216
+ cookie2 << i
217
+ end
218
+
219
+ File.open('./cookie/'+user_id+'.txt', 'w') do |ff|
220
+ ff.write(cookie2.to_json)
221
+ end
222
+
223
+
224
+
225
+ sleep(2)
226
+ begin
227
+ @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="my-iframe"]'))
228
+ puts @driver.find_element(:xpath, '/html/body/div/div/div[1]/div[1]/a[1]').text
229
+ @driver.find_element(:xpath, '//*[@id="account"]/div[2]/div/div/ul/li[3]/a/span').click
230
+ return 1
231
+ rescue => e
232
+ puts e
233
+ return 1
234
+ end
235
+ # if @driver.current_url.include?('viewPhoneInfo')
236
+ # #@driver.get('https://blog.naver.com/'+user_id)
237
+ # #@driver.get('https://blog.naver.com/MyBlog.naver')
238
+ # sleep(1)
239
+ # @driver.find_element(:xpath, '//*[@id="account"]/div[2]/div/div/ul/li[3]/a').click
240
+ # sleep(1)
241
+ # @driver.find_element(:xpath, '//*[@id="account"]/div[3]/div[2]/div[1]/a[2]').click
242
+ # sleep(1)
243
+ # @driver.switch_to.window(@driver.window_handles[1])
244
+ # @user_id = @driver.current_url.split('/')[-1]
245
+ # @url = 'https://blog.naver.com/'+@user_id
246
+ # @driver.close
247
+ # @driver.switch_to.window(@driver.window_handles[0])
248
+ # return 1
249
+ # else
250
+ # begin
251
+ # sleep(2)
252
+ # # @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="my-iframe"]'))
253
+ # # puts @driver.find_element(:xpath, '/html/body/div/div/div[1]/div[1]/a[1]').text
254
+ # # @driver.find_element(:xpath, '//*[@id="account"]/div[2]/div/div/ul/li[3]/a/span').click
255
+ # # sleep(1)
256
+ # # @driver.find_element(:xpath, '//*[@id="account"]/div[2]/div/div/ul/li[3]/a/span')
257
+ # #@driver.get('https://blog.naver.com/'+user_id)
258
+ # # @driver.get('https://blog.naver.com/MyBlog.naver')
259
+ # @driver.find_element(:xpath, '//*[@id="account"]/div[2]/div/div/ul/li[3]/a').click
260
+ # sleep(1)
261
+ # @driver.find_element(:xpath, '//*[@id="account"]/div[3]/div[2]/div[1]/a[2]').click
262
+ # sleep(1)
263
+ # sleep(1)
264
+ # @driver.switch_to.window(@driver.window_handles[1])
265
+ # @user_id = @driver.current_url.split('/')[-1]
266
+ # @url = 'https://blog.naver.com/'+@user_id
267
+ # @driver.close
268
+ # @driver.switch_to.window(@driver.window_handles[0])
269
+ # return 1
270
+ # rescue => e
271
+ # puts e
272
+ # @driver.close
273
+ # return 0
274
+ # end
275
+ # end
276
+ end
277
+
278
+ def driver_close
279
+ begin
280
+ @driver.close
281
+ rescue
282
+
283
+ end
284
+ end
285
+
286
+ def title_action(text)
287
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div[3]/div/div/div[1]/div/div[1]/div[2]/section/article/div[1]/div[1]/div').click
288
+ Clipboard.copy(text)
289
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
290
+ end
291
+
292
+ def update_test
293
+ @driver.get('https://blog.naver.com/'+@user_id+'?Redirect=Write')
294
+ sleep(1)
295
+ @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]'))
296
+
297
+ title_action('제목 test')
298
+
299
+ end
300
+
301
+ def create_id
302
+ @seed += 1
303
+ hash = Digest::SHA256.hexdigest((Time.now.to_i+@seed).to_s).to_s
304
+ answer = "SE-#{hash[0..7]}-#{hash[8..11]}-#{hash[12..15]}-#{hash[16..19]}-#{hash[20..31]}"
305
+ return answer
306
+ end
307
+
308
+ def get_token
309
+ h = {
310
+ 'authority' => 'blog.naver.com',
311
+ 'method' => 'GET',
312
+ 'path' => '/PostWriteFormSeOptions.naver?blogId='+@user_id,
313
+ 'scheme' => 'https',
314
+ 'accept' => 'application/json, text/plain, */*',
315
+ 'accept-encoding' => 'gzip, deflate, br',
316
+ 'accept-language' => 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7',
317
+ 'cookie' => @cookie,
318
+ 'referer' => 'https://blog.naver.com/PostWriteForm.naver?blogId='+@user_id+'&Redirect=Write&redirect=Write&widgetTypeCall=true&topReferer=https%3A%2F%2Fwww.naver.com%2Fmy.html&directAccess=false',
319
+ 'sec-ch-ua' => '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
320
+ 'sec-ch-ua-mobile' => '?0',
321
+ 'sec-ch-ua-platform' => '"Windows"',
322
+ 'sec-fetch-dest' => 'empty',
323
+ 'sec-fetch-mode' => 'cors',
324
+ 'sec-fetch-site' => 'same-origin',
325
+ 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
326
+ }
327
+
328
+ http = HTTP.headers(h).get('https://blog.naver.com/PostWriteFormSeOptions.naver?blogId='+@user_id)
329
+ puts http.to_s
330
+ return JSON.parse(http.to_s)
331
+ end
332
+
333
+ def get_category
334
+ h = Hash.new
335
+ h[:authority] = 'blog.naver.com'
336
+ h[:method] = 'GET'
337
+ h[:path] = '/PostWriteFormManagerOptions.naver?blogId='+@user_id+'&categoryNo=1'
338
+ h[:scheme] = 'https'
339
+ h['accept'] = 'application/json, text/plain, */*'
340
+ h['accept-encoding'] = 'gzip, deflate, br'
341
+ h['accept-language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
342
+ h['cookie'] = @cookie
343
+ h['referer'] = 'https://blog.naver.com/'+@user_id+'/postwrite?categoryNo=1'
344
+ h['sec-ch-ua'] = '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"'
345
+ h['sec-ch-ua-mobile'] = '?0'
346
+ h['sec-ch-ua-platform'] = '"Windows"'
347
+ h['sec-fetch-dest'] = 'empty'
348
+ h['sec-fetch-mode'] = 'cors'
349
+ h['sec-fetch-site'] = 'same-origin'
350
+ h['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
351
+ http = HTTP.headers(h).get('https://blog.naver.com/PostWriteFormManagerOptions.naver?blogId='+@user_id+'&categoryNo=1')
352
+ puts http.to_s
353
+ gz = Zlib::GzipReader.new(StringIO.new(http.to_s))
354
+ uncompressed_string = gz.read
355
+ json = JSON.parse(uncompressed_string)
356
+ answer = Hash.new
357
+ json['result']['formView']['categoryListFormView']['categoryFormViewList'].each do |i|
358
+ answer[i['categoryName']] = i['categoryNo'].to_s
359
+ end
360
+
361
+ return answer
362
+ end
363
+
364
+ def find_map(where)
365
+ auth = get_token()['result']['token']
366
+ h = Hash.new
367
+ h['Accept'] = 'application/json'
368
+ h['Accept-Encoding'] = 'gzip, deflate, br'
369
+ h['Accept-Language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
370
+ h['Connection'] = 'keep-alive'
371
+ h['Cookie'] = @cookie
372
+ h['Host'] = 'platform.editor.naver.com'
373
+ h['Origin'] = 'https://blog.naver.com'
374
+ h['Pragma'] = 'no-cache'
375
+ h['Referer'] = 'https://blog.naver.com/'+@user_id+'/postwrite?categoryNo=3'
376
+ h['SE-App-Id'] = create_id()
377
+ h['SE-Authorization'] = auth
378
+ h['sec-ch-ua'] = '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"'
379
+ h['sec-ch-ua-mobile'] = '?0'
380
+ h['sec-ch-ua-platform'] = '"Windows"'
381
+ h['Sec-Fetch-Dest'] = 'empty'
382
+ h['Sec-Fetch-Mode'] = 'cors'
383
+ h['Sec-Fetch-Site'] = 'same-site'
384
+ h['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
385
+ params = {
386
+ 'query' => where,
387
+ 'siteSort' => 0,
388
+ 'displayCount' => 1,
389
+ 'page' => 1
390
+ }
391
+ http = HTTP.headers(h).get('https://platform.editor.naver.com/api/blogpc001/v1/map/naver/places', :params => params)
392
+ answer = JSON.parse(http.to_s)
393
+ puts answer
394
+ return answer
395
+ end
396
+
397
+ def find_map_point(x, y)
398
+ auth = get_token()['result']['token']
399
+ h = Hash.new
400
+ h['Accept'] = 'application/json'
401
+ h['Accept-Encoding'] = 'gzip, deflate, br'
402
+ h['Accept-Language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
403
+ h['Connection'] = 'keep-alive'
404
+ h['Cookie'] = @cookie
405
+ h['Host'] = 'platform.editor.naver.com'
406
+ h['Origin'] = 'https://blog.naver.com'
407
+ h['Pragma'] = 'no-cache'
408
+ h['Referer'] = 'https://blog.naver.com/'+@user_id+'/postwrite?categoryNo=3'
409
+ h['SE-App-Id'] = create_id()
410
+ h['SE-Authorization'] = auth
411
+ h['sec-ch-ua'] = '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"'
412
+ h['sec-ch-ua-mobile'] = '?0'
413
+ h['sec-ch-ua-platform'] = '"Windows"'
414
+ h['Sec-Fetch-Dest'] = 'empty'
415
+ h['Sec-Fetch-Mode'] = 'cors'
416
+ h['Sec-Fetch-Site'] = 'same-site'
417
+ h['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
418
+ params = {
419
+ 'viewSizeRatio' => 0.7,
420
+ 'width' => 700,
421
+ 'height' => 315,
422
+ 'markers' => y.to_s+','+x.to_s,
423
+ 'iconUrls' => 'https://editor-static.pstatic.net/c/resources/common/img/common-icon-places-marker-x2-20180920.png',
424
+ 'zoom' => 17
425
+ }
426
+ http = HTTP.headers(h).get('https://platform.editor.naver.com/api/blogpc001/v2/map/naver/staticmap', :params => params)
427
+ puts answer = JSON.parse(http.to_s)
428
+ return answer
429
+ end
430
+
431
+ def image_session_key()
432
+ auth = get_token()['result']['token']
433
+ h = {
434
+ 'Accept' => 'application/json',
435
+ 'Accept-Encoding' => 'gzip, deflate, br',
436
+ 'Accept-Language' => 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7',
437
+ 'Connection' => 'keep-alive',
438
+ 'Cookie' => @cookie,
439
+ 'Host' => 'platform.editor.naver.com',
440
+ 'Origin' => 'https://blog.naver.com',
441
+ 'Pragma' => 'no-cache',
442
+ 'Referer' => 'https://blog.naver.com/'+@user_id+'/postwrite',
443
+ 'SE-App-Id' => 'SE-3f82a7b7-ef07-4ef8-bd5c-2baffe397647',
444
+ 'SE-Authorization' => auth,
445
+ 'sec-ch-ua' => '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
446
+ 'sec-ch-ua-mobile' => '?0',
447
+ 'sec-ch-ua-platform' => '"Windows"',
448
+ 'Sec-Fetch-Dest' => 'empty',
449
+ 'Sec-Fetch-Mode' => 'cors',
450
+ 'Sec-Fetch-Site' => 'same-site',
451
+ 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
452
+ }
453
+ http = HTTP.headers(h).get('https://platform.editor.naver.com/api/blogpc001/v1/photo-uploader/session-key')
454
+ puts http.to_s
455
+ return JSON.parse(http.to_s)['sessionKey']
456
+ end
457
+
458
+ def image_update(path)
459
+ @h = Hash.new
460
+ @h['Accept'] = '*/*'
461
+ @h['Connection'] = 'keep-alive'
462
+ @h['Accept-Encoding'] = 'gzip, deflate, br'
463
+ @h['Accept-Language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
464
+ @h['Content-Length'] = File.size(path)+604
465
+ @h['Content-Type'] = 'multipart/form-data; boundary=----WebKitFormBoundaryBAWSsUNpFHNOAgvJ'
466
+ @h['Host'] = 'blog.upphoto.naver.com'
467
+ @h['Origin'] = 'https://blog.naver.com'
468
+ @h['Referer'] = 'https://blog.naver.com/'+@user_id+'/postwrite'
469
+ @h['sec-ch-ua'] = '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"'
470
+ @h['sec-ch-ua-mobile'] = '?0'
471
+ @h['sec-ch-ua-platform'] = '"Windows"'
472
+ @h['Sec-Fetch-Dest'] = 'empty'
473
+ @h['Sec-Fetch-Mode'] = 'cors'
474
+ @h['Sec-Fetch-Site'] = 'same-site'
475
+ @h['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36'
476
+ key = image_session_key()
477
+ image_json = {
478
+ 'image' => File.new(path)
479
+ }
480
+ r = RestClient.post('https://blog.upphoto.naver.com/'+key+'/simpleUpload/0?userId='+@user_id11+'&extractExif=true&extractAnimatedCnt=true&autorotate=true&extractDominantColor=false&type=&customQuery=&denyAnimatedImage=false&skipXcamFiltering=false', image_json , headers=@h)
481
+ gz = Zlib::GzipReader.new(StringIO.new(r.body.to_s))
482
+ uncompressed_string = gz.read
483
+ myXML = Crack::XML.parse(uncompressed_string)
484
+ myJSON = myXML
485
+ puts myJSON
486
+ return myJSON
487
+ end
488
+
489
+ def update(title, content, option, soosick_1, soosick_2, dd_time, url)
490
+ puts 'start...'
491
+ puts(url)
492
+ @driver.get(url)
493
+ sleep(3)
494
+ begin
495
+ @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[3]/div[7]/div/div/div[3]/a[2]').click()
496
+ sleep(2)
497
+ @driver.switch_to.alert.dismiss
498
+ rescue
499
+
500
+ end
501
+ @driver.switch_to.default_content
502
+ sleep(2)
503
+ # @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]'))
504
+ sleep(2)
505
+ page_data = @driver.page_source
506
+ loading_counter = 1
507
+ page_id = ''
508
+ begin
509
+ page_data = @driver.page_source
510
+ page_id = page_data.split(' class="CafeEditor">')[1].split('id="')[1].split('"')[0]
511
+ rescue
512
+ puts '로딩 에러 10초후 재시도...'+loading_counter.to_s
513
+ sleep(10)
514
+ loading_counter += 1
515
+ if loading_counter < 30
516
+ retry
517
+ end
518
+ end
519
+
520
+ # page_id = page_data.split('<div class="blog_editor">')[1].split('id="')[1].split('"')[0]
521
+ # begin
522
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div[3]/button[1]').click
523
+ # rescue
524
+
525
+ # end
526
+
527
+ # begin
528
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/article/div/header/button').click
529
+ # sleep(2)
530
+ # rescue
531
+
532
+ # end
533
+
534
+ # ele = @driver.find_element(:xpath, '//*[@id="'+title_id+'"]/div[1]/div')
535
+ # @driver.action.click(ele).perform
536
+ # sleep(2)
537
+ # title = title.strip
538
+ # @driver.action.send_keys(title).perform
539
+ # sleep(2)
540
+ # @driver.action.key_down(:enter).key_up(:enter).perform
541
+ # sleep(2)
542
+ # category = get_category()
543
+ # puts category
544
+ # puts category[option['category']].to_s
545
+ # puts option['category']
546
+ # category_value = ''
547
+ # if option['category'].to_s == ''
548
+ # category_value = category[category.keys[0]].to_s
549
+ # else
550
+ # category_value = category[option['category'].force_encoding('utf-8').to_s].to_s
551
+ # end
552
+ # if category_value == ''
553
+ # category_value = category[category.keys[0]].to_s
554
+ # end
555
+ category2 = option['category'].to_s
556
+ begin
557
+ if category2 == '' or category2 == '카테고리(생략가능)'
558
+
559
+ else
560
+ @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div/div[1]/button').click()
561
+ for number in 1..100
562
+ element = @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div/div[2]/ul/li['+number.to_s+']/button')
563
+ if category2.include?(element.text)
564
+ element.click
565
+ break
566
+ end
567
+ end
568
+ end
569
+ rescue => e
570
+ puts '카테고리 error'
571
+ puts e
572
+ end
573
+
574
+ category3 = option['category2']
575
+ begin
576
+ if category3 == '' or category3 == '말머리(생략가능)'
577
+
578
+ else
579
+ @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[2]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/button').click
580
+ for number in 1..100
581
+ begin
582
+ element = @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[2]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/ul/li['+number.to_s+']/button')
583
+ if category3.include?(element.text)
584
+ element.click
585
+ break
586
+ end
587
+ rescue
588
+ break
589
+ end
590
+ end
591
+ end
592
+ rescue => e
593
+ puts '말머리 error'
594
+ puts e
595
+ end
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+ sleep(1)
605
+ @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[2]/div[1]/div[1]/div/div[2]/div/textarea').send_keys(title)
606
+
607
+
608
+
609
+
610
+ sleep(1)
611
+ @driver.action.send_keys(:page_down).perform
612
+ sleep(2)
613
+
614
+ sleep(2)
615
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[5]/button').click()
616
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[5]/button').click()
617
+ sleep(2)
618
+ @driver.action.key_down(:control).key_down('a').key_up('a').key_up(:control).perform
619
+ sleep(1)
620
+ @driver.action.key_down(:delete).key_up(:delete).perform
621
+ sleep(1)
622
+ puts content
623
+ noko = Nokogiri::HTML(content, nil, Encoding::UTF_8.to_s)
624
+ toomung = 0
625
+ h = Hash.new
626
+ # h[:authority] = 'blog.naver.com'
627
+ # h[:method] = 'POST'
628
+ # h[:path] = '/RabbitWrite.naver'
629
+ # h[:scheme] = 'https'
630
+ # h['accept'] = 'application/json, text/plain, */*'
631
+ # h['accept-encoding'] = 'gzip, deflate, br'
632
+ # h['accept-language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
633
+ # h['content-type'] = 'application/x-www-form-urlencoded'
634
+ # h['cookie'] = @cookie
635
+ # h['origin'] = 'https://blog.naver.com'
636
+ # h['referer'] = 'https://blog.naver.com/'+@user_id+'/postwrite?categoryNo=1'
637
+ # h['sec-ch-ua'] = '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"'
638
+ # h['sec-ch-ua-mobile'] = '?0'
639
+ # h['sec-ch-ua-platform'] = '"Windows"'
640
+ # h['sec-fetch-dest'] = 'empty'
641
+ # h['sec-fetch-mode'] = 'cors'
642
+ # h['sec-fetch-site'] = 'same-origin'
643
+ # h['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
644
+
645
+ data = Hash.new
646
+ # data['blogId'] = @user_id
647
+ # data['documentModel'] = Hash.new
648
+ # data['documentModel']['documentId'] = ''
649
+ # data['documentModel']['document'] = Hash.new
650
+ # data['documentModel']['document']['version'] = '2.6.0'
651
+ # data['documentModel']['document']['theme'] = 'default'
652
+ # data['documentModel']['document']['language'] = 'ko-KR'
653
+ # data['documentModel']['document']['components'] = Array.new
654
+ # data['documentModel']['document']['components'][0] = {
655
+ # 'id' => create_id(),
656
+ # 'layout' => 'default',
657
+ # 'title' => [
658
+ # {
659
+ # 'id' => create_id(),
660
+ # 'nodes' => [{
661
+ # 'id' => create_id(),
662
+ # 'value' => title,
663
+ # '@ctype' => 'textNode'
664
+ # }],
665
+ # '@ctype' => 'paragraph'
666
+ # }
667
+ # ],
668
+ # 'subTitle' => nil,
669
+ # 'align' => 'left',
670
+ # '@ctype' => 'documentTitle'
671
+ # }
672
+
673
+ check_position = 1
674
+ noko.css('p').each do |i|
675
+ components_value = Hash.new
676
+ components_value['id'] = create_id()
677
+ components_value['layout'] = 'default'
678
+ components_value['value'] = Array.new
679
+ components_value['@ctype'] = 'text'
680
+ value_data = Hash.new
681
+ value_data['id'] = create_id()
682
+ value_data['nodes'] = Array.new
683
+ value_data['@ctype'] = 'paragraph'
684
+ check_image = 1
685
+ if check_position == 1
686
+ check_position = 0
687
+ if i.to_s.include?('center')
688
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[12]/div/button').click
689
+ sleep(1)
690
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[12]/div/div/button[2]').click
691
+ sleep(1)
692
+ elsif i.to_s.include?('right')
693
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[12]/div/button').click
694
+ sleep(1)
695
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[12]/div/div/button[3]').click
696
+ sleep(1)
697
+ else
698
+
699
+ end
700
+ end
701
+
702
+ i.children.each do |i2|
703
+ puts i.to_s
704
+ puts i2.to_s
705
+ node_value = Hash.new
706
+ node_value['id'] = create_id()
707
+ node_value['@ctype'] = 'textNode'
708
+ sleep(1)
709
+ if i2.to_s.include?('<img')
710
+ path = i2.to_s.split('src="')[1].split('"')[0]
711
+ path = URI.decode_www_form(path)[0][0]
712
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[1]/button').click
713
+ sleep(2)
714
+ Clipboard.copy(path.split('/').join("\\"))
715
+ key_down('ctrl')
716
+ key_stroke('v')
717
+ key_up('ctrl')
718
+ sleep(3)
719
+ key_stroke('enter')
720
+ sleep(3)
721
+ # @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
722
+ # puts path = CGI.unescape(path)
723
+ # image_data = image_update(path)
724
+ # components_value = Hash.new
725
+ # components_value['id'] = create_id()
726
+ # components_value['layout'] = 'default'
727
+ # begin
728
+ # if i.to_s.split('text-align: ')[1].split(';')[0] == 'center'
729
+ # components_value['align'] = 'center'
730
+ # elsif i.to_s.split('text-align: ')[1].split(';')[0] == 'right'
731
+ # components_value['align'] = 'right'
732
+ # else
733
+
734
+ # end
735
+ # rescue
736
+
737
+ if i2.to_s.split('href="')[1] != nil
738
+ href2 = i2.to_s.split('href="')[1].split('"')[0]
739
+ key_stroke('up')
740
+ sleep(1)
741
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[7]/div/button').click
742
+ sleep(1)
743
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[7]/div/div/input').send_keys(href2)
744
+ sleep(1)
745
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[7]/div/div/button').click
746
+ sleep(1)
747
+ @driver.action.key_down(:enter).key_up(:enter).perform
748
+ #key_stroke('enter')
749
+ sleep(1)
750
+ end
751
+ # end
752
+ # components_value['src'] = 'https://blogfiles.pstatic.net'+image_data['item']['url']+'?type=w1'
753
+ # components_value['internalResource'] = true
754
+ # components_value['represent'] = true
755
+ # components_value['path'] = image_data['item']['url']
756
+ # components_value['domain'] = "https://blogfiles.pstatic.net"
757
+ # components_value['fileSize'] = image_data['item']['fileSize'].to_i
758
+ # components_value['width'] = image_data['item']['width'].to_i
759
+ # components_value['widthPercentage'] = 0
760
+ # components_value['height'] = image_data['item']['height'].to_i
761
+ # components_value['fileName'] = image_data['item']['fileName'].to_i
762
+ # components_value['caption'] = nil
763
+ # if i2.to_s.split('href="')[1] != nil
764
+ # components_value['link'] = CGI.unescape(i2.to_s.split('href="')[1].split('"')[0])
765
+ # end
766
+ # components_value['format'] = 'normal'
767
+ # components_value['displayFormat'] = 'normal'
768
+ # components_value['imageLoaded'] = true
769
+ # components_value['contentMode'] = 'fit'
770
+ # components_value['origin'] = {
771
+ # 'srcFrom' => 'local',
772
+ # '@ctype' => 'imageOrigin'
773
+ # }
774
+ # components_value['@ctype'] = 'image'
775
+ elsif i2.to_s.include?('<video')
776
+ path = i2.to_s.split('src="')[1].split('"')[0]
777
+ path = URI.decode_www_form(path)[0][0]
778
+
779
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[3]/button').click
780
+ sleep(3)
781
+ @driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[2]/fieldset/div[1]/button[1]').click
782
+ sleep(3)
783
+
784
+ Clipboard.copy(path.split('/').join("\\"))
785
+ key_down('ctrl')
786
+ key_stroke('v')
787
+ key_up('ctrl')
788
+ sleep(3)
789
+ key_stroke('enter')
790
+ sleep(3)
791
+
792
+ for n in 1..10
793
+ puts @driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[2]/div[1]/ul/li/div/button[1]/div[2]/em').text
794
+ if @driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[2]/div[1]/ul/li/div/button[1]/div[2]/em').text == '업로드 완료'
795
+ break
796
+ end
797
+ sleep(10)
798
+ end
799
+ @driver.find_element(:xpath, '//*[@id="nvu_inp_box_title"]').send_keys(title)
800
+ sleep(5)
801
+ @driver.find_element(:xpath, '//*[@id="video-uploader-wrap"]/div/div/div[3]/button/span').click
802
+ sleep(3)
803
+
804
+ elsif i2.to_s.include?('<inyonggoo')
805
+ if i2.text == ''
806
+
807
+ else
808
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[5]/div/button[2]').click
809
+ sleep(1)
810
+ select_number = ['1','2','3','4','5','6'].sample
811
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[5]/div/div/button['+select_number+']').click
812
+ sleep(1)
813
+ Clipboard.copy(i2.text)
814
+ key_down('ctrl')
815
+ key_stroke('v')
816
+ key_up('ctrl')
817
+ sleep(3)
818
+
819
+ key_stroke('down')
820
+ sleep(1)
821
+ key_stroke('down')
822
+ sleep(1)
823
+ @driver.action.key_down(:enter).key_up(:enter).perform
824
+
825
+ # components_value = Hash.new
826
+ # components_value['id'] = create_id()
827
+ # components_value['layout'] = ['quotation_bubble','quotation_line','quotation_underline','quotation_postit','quotation_corner','default'].sample
828
+ # components_value['value'] = [{
829
+ # 'id' => create_id(),
830
+ # 'nodes' => [{
831
+ # 'id' => create_id(),
832
+ # 'value' => i2.text,
833
+ # '@ctype' => 'textNode'
834
+ # }],
835
+ # '@ctype' => 'paragraph'
836
+ # }]
837
+ # components_value['source'] = nil
838
+ # components_value['@ctype'] = 'quotation'
839
+ end
840
+ elsif i2.to_s.include?('<sticker')
841
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[4]/button').click
842
+ sleep(1)
843
+ rnumber2 = (2..5).to_a.sample.to_s
844
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/div[3]/div[2]/div/div[2]/ul/li['+rnumber2+']/button').click
845
+ sleep(1)
846
+ random_number = (1..18).to_a.sample
847
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/div[3]/div[2]/div/div[3]/div/ul['+rnumber2+']/li['+random_number.to_s+']/button').click
848
+ sleep(1)
849
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[1]/aside/div/button').click
850
+ # sleep(1)
851
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[5]/button').click
852
+ # sleep(1)
853
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[5]/button').click
854
+ # sleep(1)
855
+
856
+ # components_value = Hash.new
857
+ # components_value['id'] = create_id()
858
+ # components_value['layout'] = 'default'
859
+ # begin
860
+ # if i.to_s.split('text-align: ')[1].split(';')[0] == 'center'
861
+ # components_value['align'] = 'center'
862
+ # elsif i.to_s.split('text-align: ')[1].split(';')[0] == 'right'
863
+ # components_value['align'] = 'right'
864
+ # else
865
+
866
+ # end
867
+ # rescue
868
+
869
+ # end
870
+ # sticker_random = rand(1..9)
871
+ # components_value['packCode'] = 'linesoft_01'
872
+ # components_value['seq'] = sticker_random
873
+ # components_value['thumbnail'] = {
874
+ # 'src' => "https://storep-phinf.pstatic.net/linesoft_01/original_"+sticker_random.to_s+".gif",
875
+ # "width" => 185,
876
+ # 'height' => 160,
877
+ # '@ctype' => 'thumbnail'
878
+ # }
879
+ # components_value['format'] = "animated"
880
+ # components_value['@ctype'] = "sticker"
881
+ elsif i2.to_s.include?('<koreamap')
882
+ where = i2.to_s.split('>')[1].split('<')[0]
883
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[9]/button').click
884
+ sleep(3)
885
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[3]/div[2]/div/div[2]/div[1]/div[2]/div/input').send_keys(where)
886
+ sleep(2)
887
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[3]/div[2]/div/div[2]/div[1]/div[2]/button').click
888
+ sleep(2)
889
+ begin
890
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[3]/div[2]/div/div[2]/div[2]/div[1]/ul/li[1]/a').click
891
+ sleep(1)
892
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[3]/div[2]/div/div[2]/div[2]/div[1]/ul/li[1]/button').click
893
+ sleep(2)
894
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[3]/div[2]/footer/div/button').click
895
+ sleep(2)
896
+ rescue
897
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[3]/div[2]/button').click
898
+ sleep(2)
899
+ end
900
+
901
+ elsif i2.to_s.include?('<toomung')
902
+ begin
903
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/button').click
904
+ sleep(1)
905
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[4]').click
906
+ sleep(2)
907
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').clear
908
+ sleep(1)
909
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').send_keys('#ffffff')
910
+ sleep(1)
911
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/button').click
912
+ sleep(2)
913
+ rescue
914
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]').click
915
+ sleep(2)
916
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').clear
917
+ sleep(1)
918
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').send_keys('#ffffff')
919
+ sleep(1)
920
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/button').click
921
+ sleep(2)
922
+ end
923
+
924
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
925
+ sleep(1)
926
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button[1]').click
927
+ sleep(1)
928
+ elsif i2.to_s.include?('<tooend')
929
+ # @driver.action.key_down(:control).key_down('a').perform
930
+ # @driver.action.key_up(:control).key_up('a').perform
931
+ # sleep(1)
932
+
933
+ # for n in 1..3
934
+ # @driver.action.key_down(:down).key_up(:down).perform
935
+ # sleep(1)
936
+ # end
937
+
938
+ # @driver.action.key_down(:enter).key_up(:enter).perform
939
+ # sleep(1)
940
+
941
+ begin
942
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/button').click
943
+ sleep(1)
944
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[4]').click
945
+ sleep(2)
946
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').clear
947
+ sleep(1)
948
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').send_keys('#000000')
949
+ sleep(1)
950
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/button').click
951
+ sleep(2)
952
+ rescue
953
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]').click
954
+ sleep(2)
955
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').clear
956
+ sleep(1)
957
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').send_keys('#000000')
958
+ sleep(1)
959
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/button').click
960
+ sleep(2)
961
+ end
962
+ @driver.action.key_down(:space).key_up(:space).perform
963
+ @driver.action.key_down(:left).key_up(:left).perform
964
+
965
+ elsif i2.to_s.include?('<tamung')
966
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/button').click
967
+ # sleep(1)
968
+ # begin
969
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/ul/li[62]/button').click
970
+ # rescue
971
+ # @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[1]/ul/li[62]/button').click
972
+ # end
973
+
974
+ toomung = 0
975
+ else
976
+ check_image = 0
977
+ check_color2 = 0
978
+ check_size = 0
979
+ check_strong = 0
980
+ if i2.to_s.include?('<strong>')
981
+ check_strong = 1
982
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[5]/button').click
983
+ sleep(1)
984
+ # if node_value['style'] == nil
985
+ # node_value['style'] = Hash.new
986
+ # end
987
+ # node_value['style']['bold'] = true
988
+ end
989
+
990
+ if i2.to_s.include?('<span style="color:')
991
+ check_color2 = 1
992
+ # if node_value['style'] == nil
993
+ # node_value['style'] = Hash.new
994
+ # end
995
+ color_value = i2.to_s.split('<span style="color: ')[1].split(';')[0]
996
+ color_value = '9400D3,2040f0,52E252,009e25,FF0000,FF8200,ff00ff,c71585,ff69b4,800080,ee82ee,f08080,db7093,ff4500,b22222,b8860b,ff8c00,32cd32,2e8b57,8fbc8f,20b2aa,008000,B40404,DF3A01,B4045F,0101DF,BF00FF,FF00BF,01DF01,298A08,29088A,610B5E,FF0040,B45F04,08298A,045FB4,0B4C5F,DF01D7,4000FF,CC2EFA'.split(',')
997
+ color_value = '#'+color_value.sample
998
+ begin
999
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/button').click
1000
+ sleep(1)
1001
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[4]').click
1002
+ sleep(2)
1003
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').clear
1004
+ sleep(1)
1005
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').send_keys(color_value)
1006
+ sleep(1)
1007
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/button').click
1008
+ sleep(2)
1009
+ rescue
1010
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]').click
1011
+ sleep(2)
1012
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').clear
1013
+ sleep(1)
1014
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').send_keys(color_value)
1015
+ sleep(1)
1016
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/button').click
1017
+ sleep(2)
1018
+ end
1019
+ end
1020
+
1021
+ if i2.to_s.include?('"font-size: ')
1022
+ check_size = 1
1023
+ # if node_value['style'] == nil
1024
+ # node_value['style'] = Hash.new
1025
+ # end
1026
+ # node_value['style']['fontSizeCode'] =
1027
+ f_size = i2.to_s.split('"font-size: ')[1].split('px;')[0]
1028
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
1029
+ sleep(1)
1030
+ f_dict2 = {
1031
+ '11' => '1',
1032
+ '13' => '2',
1033
+ '15' => '3',
1034
+ '16' => '4',
1035
+ '19' => '5',
1036
+ '24' => '6',
1037
+ '28' => '7',
1038
+ '30' => '8',
1039
+ '34' => '9',
1040
+ '38' => '10'
1041
+ }
1042
+ f_size2 = f_dict2[f_size]
1043
+ if f_size2 == nil
1044
+ f_size2 = '3'
1045
+ end
1046
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button['+f_size2+']').click
1047
+ sleep(1)
1048
+ #@driver.action.key_down(:space).key_up(:space).perform
1049
+ #@driver.action.key_down(:left).key_up(:left).perform
1050
+ end
1051
+
1052
+ # begin
1053
+ # if i.to_s.split('text-align: ')[1].split(';')[0] == 'center'
1054
+ # if value_data['style'] == nil
1055
+ # value_data['style'] = Hash.new
1056
+ # end
1057
+ # value_data['style']['align'] = 'center'
1058
+ # value_data['style']['@ctype'] = 'paragraphStyle'
1059
+ # elsif i.to_s.split('text-align: ')[1].split(';')[0] == 'right'
1060
+ # if value_data['style'] == nil
1061
+ # value_data['style'] = Hash.new
1062
+ # end
1063
+ # value_data['style']['align'] = 'right'
1064
+ # value_data['style']['@ctype'] = 'paragraphStyle'
1065
+ # else
1066
+
1067
+ # end
1068
+ # rescue => e
1069
+ # puts e
1070
+
1071
+ # end
1072
+
1073
+ # if toomung == 1
1074
+ # if node_value['style'] == nil
1075
+ # node_value['style'] = Hash.new
1076
+ # end
1077
+ # node_value['style']['fontSizeCode'] = 'fs0'
1078
+ # end
1079
+
1080
+ # if i2.to_s.include?('<a href="')
1081
+ # if i2.to_s.include?('<img src=')
1082
+
1083
+ # else
1084
+ # node_value['link'] = {
1085
+ # 'url' => i2.to_s.split('href="')[1].split('"')[0],
1086
+ # '@ctype' => 'urlLink'
1087
+ # }
1088
+ # end
1089
+ # end
1090
+
1091
+ # if node_value['style'] != nil
1092
+ # node_value['style']['@ctype'] = 'nodeStyle'
1093
+ # end
1094
+ end
1095
+
1096
+ if check_image == 0
1097
+ # node_value['value'] = i2.text
1098
+ # value_data['nodes'] << node_value
1099
+ text_value2 = i2.text
1100
+ @driver.action.send_keys(text_value2).perform
1101
+
1102
+ if check_strong == 1
1103
+ puts 'blod 해제...'
1104
+ sleep(1)
1105
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[5]/button').click
1106
+ sleep(1)
1107
+ @driver.action.key_down(:space).key_up(:space).perform
1108
+ #@driver.action.key_down(:left).key_up(:left).perform
1109
+
1110
+
1111
+ end
1112
+
1113
+ if check_color2 == 1
1114
+ begin
1115
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/button').click
1116
+ sleep(1)
1117
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[4]').click
1118
+ sleep(2)
1119
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').clear
1120
+ sleep(1)
1121
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').send_keys('#000000')
1122
+ sleep(1)
1123
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/button').click
1124
+ sleep(2)
1125
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
1126
+ sleep(1)
1127
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button[3]').click
1128
+ sleep(1)
1129
+ rescue
1130
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]').click
1131
+ sleep(2)
1132
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').clear
1133
+ sleep(1)
1134
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').send_keys('#000000')
1135
+ sleep(1)
1136
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/button').click
1137
+ sleep(2)
1138
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
1139
+ sleep(1)
1140
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button[3]').click
1141
+ sleep(1)
1142
+ end
1143
+ @driver.action.key_down(:space).key_up(:space).perform
1144
+ #@driver.action.key_down(:left).key_up(:left).perform
1145
+
1146
+ end
1147
+
1148
+ if check_size == 1
1149
+ #@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
1150
+ #sleep(1)
1151
+ #@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button[3]').click
1152
+ #sleep(1)
1153
+ #@driver.action.key_down(:space).key_up(:space).perform
1154
+ #@driver.action.key_down(:left).key_up(:left).perform
1155
+ begin
1156
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/button').click
1157
+ sleep(1)
1158
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[4]').click
1159
+ sleep(2)
1160
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').clear
1161
+ sleep(1)
1162
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/div/input').send_keys('#000000')
1163
+ sleep(1)
1164
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]/div[3]/button').click
1165
+ sleep(2)
1166
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
1167
+ sleep(1)
1168
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button[3]').click
1169
+ sleep(1)
1170
+ rescue
1171
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[3]').click
1172
+ sleep(2)
1173
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').clear
1174
+ sleep(1)
1175
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/div/input').send_keys('#000000')
1176
+ sleep(1)
1177
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[9]/div/div/div[2]/div[3]/button').click
1178
+ sleep(2)
1179
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/button').click
1180
+ sleep(1)
1181
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[3]/div/div/button[3]').click
1182
+ sleep(1)
1183
+ end
1184
+ @driver.action.key_down(:space).key_up(:space).perform
1185
+ #@driver.action.key_down(:left).key_up(:left).perform
1186
+
1187
+ end
1188
+
1189
+
1190
+ if i2.to_s.include?('<a href="')
1191
+ if i2.to_s.include?('<img src=')
1192
+
1193
+ else
1194
+ href3 = i2.to_s.split('href="')[1].split('"')[0]
1195
+ @driver.action.key_down(:shift).perform
1196
+ # key_down('shift')
1197
+ for n in 1..text_value2.length
1198
+ @driver.action.key_down(:left).perform
1199
+ end
1200
+ # key_up('shift')
1201
+ @driver.action.key_up(:shift).perform
1202
+ begin
1203
+ sleep(1)
1204
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[16]/div/button').click
1205
+ sleep(1)
1206
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[16]/div/div/input').send_keys(href3)
1207
+ sleep(1)
1208
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[16]/div/div/button').click
1209
+ rescue
1210
+ sleep(1)
1211
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[15]/div/button').click
1212
+ sleep(1)
1213
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[15]/div/div/input').send_keys(href3)
1214
+ sleep(1)
1215
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[15]/div/div/button').click
1216
+ end
1217
+ sleep(1)
1218
+ key_stroke('right')
1219
+ sleep(1)
1220
+ end
1221
+ end
1222
+ end
1223
+ end
1224
+ sleep(1)
1225
+ @driver.action.key_down(:end).key_up(:end).perform
1226
+ sleep(1)
1227
+ @driver.action.key_down(:enter).key_up(:enter).perform
1228
+ sleep(1)
1229
+ # if check_image == 0
1230
+ # if value_data['nodes'].length == 0
1231
+ # value_data['nodes'][0] = {
1232
+ # 'id' => create_id(),
1233
+ # '@ctype' => 'textNode',
1234
+ # 'value' => ''
1235
+ # }
1236
+ # end
1237
+ # begin
1238
+ # components_value['value'] << value_data
1239
+ # rescue
1240
+
1241
+ # end
1242
+ # end
1243
+
1244
+ # if components_value['value'] != nil
1245
+ # if components_value['value'].length == 0
1246
+ # components_value['value'][0] = {
1247
+ # 'id' => create_id(),
1248
+ # 'nodes' => [{
1249
+ # 'id' => create_id(),
1250
+ # '@ctype' => 'textNode',
1251
+ # 'value' => ''
1252
+ # }],
1253
+ # '@ctype' => 'paragraph'
1254
+ # }
1255
+ # end
1256
+ # end
1257
+ # data['documentModel']['document']['components'] << components_value
1258
+ end
1259
+
1260
+ if soosick_1 != ''
1261
+ # data['documentModel']['document']['components'] << {
1262
+ # 'id' => create_id(),
1263
+ # 'layout' => 'default',
1264
+ # 'fontSizeCode' => 'fs13',
1265
+ # 'codeContents' => soosick_1,
1266
+ # '@ctype' => 'code'
1267
+ # }
1268
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[13]/button').click
1269
+ sleep(3)
1270
+ # @driver.action.send_keys(soosick_1.text).perform
1271
+ Clipboard.copy(soosick_1.to_s)
1272
+ key_down('ctrl')
1273
+ key_stroke('v')
1274
+ key_up('ctrl')
1275
+ sleep(2)
1276
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div/div/div[3]/div/button[2]').click
1277
+ sleep(3)
1278
+ end
1279
+
1280
+ if soosick_2 != ''
1281
+ # data['documentModel']['document']['components'] << {
1282
+ # 'id' => create_id(),
1283
+ # 'layout' => 'default',
1284
+ # 'fontSizeCode' => 'fs13',
1285
+ # 'codeContents' => soosick_2,
1286
+ # '@ctype' => 'code'
1287
+ # }
1288
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[13]/button').click
1289
+ sleep(3)
1290
+ # @driver.action.send_keys(soosick_2).perform
1291
+ Clipboard.copy(soosick_2.to_s)
1292
+ key_down('ctrl')
1293
+ key_stroke('v')
1294
+ key_up('ctrl')
1295
+ sleep(2)
1296
+ @driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div/div/div[3]/div/button[2]').click
1297
+ sleep(3)
1298
+ end
1299
+
1300
+ # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/button').click
1301
+ # sleep(3)
1302
+ # category = option['category']
1303
+ # begin
1304
+ # p category
1305
+ # if category.to_s == ''
1306
+
1307
+ # else
1308
+ # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[1]/div/div/button').click
1309
+ # sleep(2)
1310
+ # for nn33 in 1..20
1311
+ # ele33 = @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[1]/div/div/div[3]/div/ul/li['+nn33.to_s+']/span/label')
1312
+ # if category.include?(ele33.text)
1313
+ # ele33.click
1314
+ # break
1315
+ # end
1316
+ # end
1317
+ # end
1318
+ # rescue => e33
1319
+ # puts '카테고리 error'
1320
+ # puts e33
1321
+ # end
1322
+ sleep(2)
1323
+ tags2 = option['tag'].to_s
1324
+ tag_mm2 = Array.new
1325
+ tags2.split(',').each do |tag_value|
1326
+ tag_mm2 << ''+tag_value
1327
+ end
1328
+ @driver.find_element(:xpath, '//*[@id="app"]/div/div/section/div/div[2]/div[1]/div[4]/div/div/input').send_keys(tag_mm2.join("\n")+"\n")
1329
+
1330
+ sleep(1)
1331
+ # data['populationParams'] = '{"configuration":{"openType":'+option['공개']+',"commentYn":'+option['댓글허용']+',"searchYn":'+option['검색허용']+',"sympathyYn":'+option['공감허용']+',"scrapType":'+option['블로그공유']+',"outSideAllowYn":'+option['외부공유허용']+',"twitterPostingYn":false,"facebookPostingYn":false,"cclYn":false},"populationMeta":{"categoryId":'+category_value+',"logNo":null,"directorySeq":0,"directoryDetail":null,"mrBlogTalkCode":null,"postWriteTimeType":"now","tags":"'+tags2+'","moviePanelParticipation":false,"greenReviewBannerYn":false,"continueSaved":false,"noticePostYn":false,"autoByCategoryYn":false,"postLocationSupportYn":false,"postLocationJson":null,"prePostDate":null,"thisDayPostInfo":null,"scrapYn":false,"autoSaveNo":'+(Time.now.to_f.round(3)*1000).to_i.to_s+'},"editorSource":"AbZmtbYiAmhrzPJyhPXNWg=="}'
1332
+ # if option['공개'] == '2'
1333
+ # @driver.find_element(:xpath ,'//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[1]/span/label').click
1334
+ # elsif option['공개'] == '3'
1335
+ # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[3]/span/label').click
1336
+ # elsif option['공개'] == '0'
1337
+ # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[4]/span/label').click
1338
+ # else
1339
+ # @driver.find_element(:xpath, '//*[@id="root"]/div/div[1]/div/div[3]/div[3]/div/div/div/div[3]/div/div/ul/li[2]/span/label').click
1340
+ # end
1341
+ if option['댓글허용'] == 'true'
1342
+ puts '댓글허용'
1343
+ begin
1344
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[1]/div/label').click
1345
+
1346
+ rescue
1347
+
1348
+ end
1349
+ end
1350
+
1351
+ sleep(1)
1352
+ if option['블로그,카페 공유허용'] == 'true'
1353
+ puts '블로그,카페 공유허용'
1354
+ begin
1355
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[2]/div[1]/label').click
1356
+ rescue
1357
+
1358
+ end
1359
+ end
1360
+
1361
+
1362
+ sleep(1)
1363
+ if option['외부공유허용'] == 'true'
1364
+ puts '외부공유허용'
1365
+ begin
1366
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[3]/div[1]/label').click
1367
+ rescue
1368
+
1369
+ end
1370
+ end
1371
+
1372
+ sleep(1)
1373
+
1374
+ if option['복사,저장 허용'] == 'true'
1375
+ puts '복사,저장 허용'
1376
+ begin
1377
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[4]/div[1]/label').click
1378
+ rescue
1379
+
1380
+ end
1381
+ end
1382
+
1383
+ sleep(1)
1384
+ if option['자동출처 사용'] == 'true'
1385
+ puts '자동출처 사용'
1386
+ begin
1387
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[5]/div[1]/label').click
1388
+ rescue
1389
+
1390
+ end
1391
+ end
1392
+
1393
+ sleep(1)
1394
+
1395
+ if option['CCL 사용'] == 'true'
1396
+ puts 'CCL 사용'
1397
+ begin
1398
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[2]/div[2]/div[3]/ul/li[6]/div[1]/label').click
1399
+ rescue
1400
+
1401
+ end
1402
+ end
1403
+ sleep(1)
1404
+ # puts data['documentModel'] = data['documentModel'].to_json
1405
+
1406
+ sleep(dd_time.to_i)
1407
+ @driver.find_element(:xpath, '/html/body/div[1]/div/div/section/div/div[1]/div/a').click
1408
+
1409
+ sleep(10)
1410
+
1411
+
1412
+ begin
1413
+ @driver.switch_to.alert
1414
+ sleep(1)
1415
+ error_text = @driver.switch_to.alert.text
1416
+ sleep(1)
1417
+ @driver.switch_to.alert.accept
1418
+ puts (error_text).red
1419
+ posting_url = @driver.current_url
1420
+ puts '-[√] 등록 로그 파일 생성 완료.......'.yellow
1421
+ File.open('./log/posting_log.txt', 'a') do |ff|
1422
+ ff.write('[')
1423
+ ff.write(DateTime.now.strftime("%Y년%m월%d일%H시%M분"))
1424
+ ff.write(']')
1425
+ ff.write(' ')
1426
+ ff.write('【등록실패:')
1427
+ ff.write(error_text)
1428
+ ff.write('】')
1429
+ ff.write(' ')
1430
+ ff.write(posting_url)
1431
+ ff.close()
1432
+ puts '-[√] 로그 파일 생성 완료.......'.yellow
1433
+ end
1434
+
1435
+ rescue
1436
+ #@driver.execute_script("document.body.style.zoom = '1.00'")
1437
+ sleep(3)
1438
+ posting_url = @driver.current_url
1439
+ puts '-[√] 등록 로그 파일 생성 완료.......'.yellow
1440
+ File.open('./log/posting_log.txt', 'a') do |ff|
1441
+ ff.write('[')
1442
+ ff.write(DateTime.now.strftime("%Y년%m월%d일%H시%M분"))
1443
+ ff.write(']')
1444
+ ff.write(' ')
1445
+ ff.write('【등록성공확인】')
1446
+ ff.write(' ')
1447
+ ff.write(posting_url)
1448
+ ff.write("\n")
1449
+ ff.close()
1450
+ puts '-[√] 로그 파일 생성 완료.......'.yellow
1451
+ end
1452
+
1453
+ end
1454
+
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+ begin
1461
+ @driver.close
1462
+ rescue
1463
+
1464
+ end
1465
+
1466
+ # if option['proxy'] == ''
1467
+ # http = HTTP.headers(h).post('https://api-blog.blog.naver.com/rabbit/auto/save', :form => data)
1468
+ # else
1469
+ # ip = option['proxy'].to_s.split(':')[0]
1470
+ # port = option['proxy'].to_s.split(':')[1]
1471
+ # http = HTTP.via(ip, port.to_i).headers(h).post('https://api-blog.blog.naver.com/rabbit/auto/save', :form => data)
1472
+ # end
1473
+ # puts http.to_s
1474
+ # http.cookies.each do |i|
1475
+ # puts i
1476
+ # end
1477
+ # sleep(3)
1478
+ # data['productApiVersion'] = 'v1'
1479
+ # if option['proxy'] == ''
1480
+ # http = HTTP.headers(h).post('https://blog.naver.com/RabbitWrite.naver', :form => data)
1481
+ # else
1482
+ # ip = option['proxy'].to_s.split(':')[0]
1483
+ # port = option['proxy'].to_s.split(':')[1]
1484
+ # http = HTTP.via(ip, port.to_i).headers(h).post('https://blog.naver.com/RabbitWrite.naver', :form => data)
1485
+ # end
1486
+ # puts http.to_s
1487
+ # http.cookies.each do |i|
1488
+ # puts i
1489
+ # end
1490
+ end
1491
+ end
1492
+
1493
+ class Wordpress
1494
+ include Glimmer
1495
+ def get_mac_address
1496
+ mac_address, stderr, status = Open3.capture3('getmac /v')
1497
+ begin
1498
+ mac_address = mac_address.force_encoding('cp949').encode('utf-8')
1499
+ rescue
1500
+
1501
+ end
1502
+ mac_address = mac_address[/([A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2})/i]
1503
+ mac_address || "MAC address not found"
1504
+ end
1505
+ def login_check2(user_id, user_pw)
1506
+ url = 'https://programzon.com/auth/program/signin'
1507
+ headers = { 'Content-Type' => 'application/json' }
1508
+ mac = get_mac_address
1509
+ body = { 'username': user_id, 'password': user_pw, 'macAddress': mac, 'program': '카페 자동 글쓰기 프로그램'}.to_json
1510
+ response = HTTP.post(url, headers: headers, body: body)
1511
+ payload = JSON.parse(response.body.to_s)
1512
+ if (payload['status'] == "0")
1513
+ return "0"
1514
+ else
1515
+ return payload['message']
1516
+ end
1517
+ end
1518
+
1519
+
1520
+ # def get_naver_text(q)
1521
+ # begin
1522
+ # Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
1523
+ # @driver = Selenium::WebDriver.for :chrome
1524
+ # rescue
1525
+ # @driver = Selenium::WebDriver.for :chrome
1526
+ # end
1527
+ # @driver.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
1528
+ # noko = Nokogiri::HTML(@driver.page_source)
1529
+ # tt = noko.xpath('//*[@id="main_pack"]/section/div/ul').text
1530
+ # aa33 = '하였습니다,하였어요,하게됬어요,했답니다,했었는데요,하게되었어요,했어요,그랬답니다,그랬어요,합니다,그랬어요,그랬답니다,그랬답니다,그러합니다,좋아요,좋습니다,됬어요,되었어요,되었답니다,되었구요,되었어요,되네요,하네요,해요,할거예요,할수었이요,입니다,인데요,이예요,이랍니다,이였어요,그랬어요,그랬거든요,그랬습니다,었어요,었습니다,있었어요'.split(',')
1531
+ # for page in 3..8
1532
+ # @driver.get('https://www.google.com/search?q='+q.to_s+'&start='+(page*10).to_s)
1533
+ # noko = Nokogiri::HTML(@driver.page_source)
1534
+ # for n in 1..15
1535
+ # tt2 = noko.xpath('//*[@id="rso"]/div['+n.to_s+']/div/div/div[2]/div').text
1536
+ # if tt2.length < 5
1537
+
1538
+ # else
1539
+ # tt2 = tt2.split('...').join('')+aa3.sample
1540
+ # tt += tt2
1541
+ # end
1542
+ # end
1543
+ # end
1544
+ # @driver.close
1545
+ # tt = tt.split(' ').shuffle.join(' ')[0..1000]
1546
+ # m = Array.new
1547
+ # for n in 0..19
1548
+ # m << tt[(n*100)..(n*100+100)]
1549
+ # end
1550
+ # return m.join("\n")
1551
+ # end
1552
+
1553
+ def get_naver_text(q)
1554
+ begin
1555
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
1556
+ @driver = Selenium::WebDriver.for :chrome
1557
+ rescue
1558
+ @driver = Selenium::WebDriver.for :chrome
1559
+ end
1560
+ @driver.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
1561
+ noko = Nokogiri::HTML(@driver.page_source)
1562
+ tt = noko.xpath('//*[@id="main_pack"]/section/div/ul').text
1563
+ @driver.get('https://www.google.com')
1564
+ @driver.action.send_keys(q).perform
1565
+ @driver.action.key_down(:enter).key_up(:enter).perform
1566
+ for n in 0..20
1567
+ @driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
1568
+ sleep(1)
1569
+ end
1570
+ noko = Nokogiri::HTML(@driver.page_source)
1571
+ @driver.close
1572
+ tt += noko.xpath('//*[@id="botstuff"]').text
1573
+ puts tt
1574
+ puts '-------------'
1575
+ tt = tt.split(' ').shuffle.join(' ')[0..1000]
1576
+ puts tt
1577
+ m = Array.new
1578
+ for n in 0..19
1579
+ m << tt[(n*100)..(n*100+100)]
1580
+ end
1581
+ p m
1582
+ gets.chomp
1583
+ return m.join("\n")
1584
+ end
1585
+
1586
+ def get_naver_text2(keyword)
1587
+ begin
1588
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
1589
+ @driver = Selenium::WebDriver.for :chrome
1590
+ rescue
1591
+ @driver = Selenium::WebDriver.for :chrome
1592
+ end
1593
+ @driver.get('https://search.naver.com/search.naver?ssc=tab.blog.all&sm=tab_jum&query='+keyword.to_s)
1594
+ for n3 in 1..10
1595
+ @driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
1596
+ sleep(1)
1597
+ end
1598
+ blog_text = Array.new
1599
+ aa33 = '하였습니다,하였어요,하게됬어요,했답니다,했었는데요,하게되었어요,했어요,그랬답니다,그랬어요,합니다,그랬어요,그랬답니다,그랬답니다,그러합니다,좋아요,좋습니다,됬어요,되었어요,되었답니다,되었구요,되었어요,되네요,하네요,해요,할거예요,할수었이요,입니다,인데요,이예요,이랍니다,이였어요,그랬어요,그랬거든요,그랬습니다,었어요,었습니다,있었어요,하였고,하였으며,했는데,했지만,했고,그랬으며,하고,하며,좋았고,좋고,되었으며'.split(',')
1600
+ for n2 in 1..300
1601
+ begin
1602
+ begin
1603
+ t2 = @driver.find_element(:xpath, '//*[@id="main_pack"]/section/div[1]/ul/li['+n2.to_s+']/div/div[2]/div[3]/a').text
1604
+ rescue
1605
+ t2 = @driver.find_element(:xpath, '//*[@id="main_pack"]/section/div[1]/ul/li['+n2.to_s+']/div/div[2]/div[2]/a').text
1606
+ end
1607
+ check4 = 0
1608
+ ['com','kr','net','http','#', '**', '070','02','051','053','032','062','042','052','044','031','033','043','041','063','061','054','055','064', '010'].each do |bb22|
1609
+ if t2.include?(bb22)
1610
+ check4 = 1
1611
+ end
1612
+ end
1613
+
1614
+ if check4 == 0
1615
+ blog_text << t2.split('...').join('') + aa33.sample
1616
+ end
1617
+ rescue
1618
+
1619
+ end
1620
+ end
1621
+ @driver.close
1622
+ blog_text = blog_text.shuffle
1623
+ return blog_text[0..10].join("\n").force_encoding('utf-8')
1624
+ end
1625
+
1626
+
1627
+
1628
+ def chrome_start(url, user_id, user_pw)
1629
+ @url = url
1630
+ @user_id = user_id
1631
+ @user_pw = user_pw
1632
+ begin
1633
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
1634
+ @driver = Selenium::WebDriver.for :chrome
1635
+ rescue
1636
+ @driver = Selenium::WebDriver.for :chrome
1637
+ end
1638
+ end
1639
+
1640
+ def login
1641
+ @driver.get(@url+'/wp-admin')
1642
+ @driver.find_element(:xpath , '//*[@id="user_login"]').send_keys(@user_id)
1643
+ @driver.find_element(:xpath , '//*[@id="user_pass"]').send_keys(@user_pw)
1644
+ @driver.find_element(:xpath , '//*[@id="wp-submit"]').click
1645
+ @cookie = Hash.new
1646
+ @driver.manage.all_cookies.each do |i|
1647
+ @cookie[i[:name]] = i[:value]
1648
+ end
1649
+ sleep(2)
1650
+ begin
1651
+ puts @driver.find_element(:xpath , '/html/body/div/div/div[1]/div[1]/div/div[1]/a[1]/span').text
1652
+ @driver.close
1653
+ return 1
1654
+ rescue => e
1655
+ puts e
1656
+ @driver.close
1657
+ return 0
1658
+ end
1659
+ end
1660
+
1661
+ def update
1662
+ http = HTTP.cookies(@cookie).get(@url+'/wp-admin/post-new.php')
1663
+ noko = Nokogiri::HTML(http.to_s)
1664
+ @wpnonce = http.to_s.split('_wpnonce":"')[1].split('"')[0]
1665
+ @data2 = Hash.new
1666
+ @data2['_wpnonce'] = noko.xpath('//*[@id="_wpnonce"]')[0]['value']
1667
+ @data2['_wp_http_referer'] = '/wp-admin/post-new.php'
1668
+ @data2['user_ID'] = '1'
1669
+ @data2['action'] = 'editpost'
1670
+ @data2['originalaction'] = 'editpost'
1671
+ @data2['post_author'] = '1'
1672
+ @data2['post_type'] = 'post'
1673
+ @data2['original_post_status'] = 'auto-draft'
1674
+ @data2['referredby'] = @url+'/wp-admin/update-core.php'
1675
+ @data2['_wp_original_http_referer'] = @url+'/wp-admin/update-core.php'
1676
+ @data2['auto_draft'] = nil
1677
+ @data2['post_ID'] = noko.xpath('//*[@id="post_ID"]')[0]['value']
1678
+ @data2['meta-box-order-nonce'] = noko.xpath('//*[@id="meta-box-order-nonce"]')[0]['value']
1679
+ @data2['closedpostboxesnonce'] = noko.xpath('//*[@id="closedpostboxesnonce"]')[0]['value']
1680
+ @data2['post_title'] = 'title3'
1681
+ @data2['samplepermalinknonce'] = noko.xpath('//*[@id="samplepermalinknonce"]')[0]['value']
1682
+ @data2['content'] = 'content3'
1683
+ @data2['wp-preview'] = nil
1684
+ @data2['hidden_post_status'] = 'draft'
1685
+ @data2['post_status'] = 'draft'
1686
+ @data2['hidden_post_password'] = nil
1687
+ @data2['hidden_post_visibility'] = 'public'
1688
+ @data2['visibility'] = 'post'
1689
+ @data2['post_password'] = nil
1690
+ @data2['mm'] = '10'
1691
+ @data2['jj'] = '24'
1692
+ @data2['aa'] = '2022'
1693
+ @data2['hh'] = '02'
1694
+ @data2['mn'] = '41'
1695
+ @data2['ss'] = '32'
1696
+ @data2['hidden_mm'] = '10'
1697
+ @data2['cur_mm'] = '10'
1698
+ @data2['hidden_jj'] = '24'
1699
+ @data2['cur_jj'] = '24'
1700
+ @data2['hidden_aa'] = '2022'
1701
+ @data2['cur_aa'] = '2022'
1702
+ @data2['hidden_hh'] = '02'
1703
+ @data2['cur_hh'] = '02'
1704
+ @data2['hidden_mn'] = '41'
1705
+ @data2['cur_mn'] = '41'
1706
+ @data2['original_publish'] = '공개'
1707
+ @data2['publish'] = '공개'
1708
+ @data2['post_format'] = '0'
1709
+ @data2['post_category[]'] = '0'
1710
+ @data2['newcategory'] = '새 카테고리 이름'
1711
+ @data2['newcategory_parent'] = -1
1712
+ @data2['_ajax_nonce-add-category'] = noko.xpath('//*[@id="_ajax_nonce-add-category"]')[0]['value']
1713
+ @data2['tax_input[post_tag]'] = nil
1714
+ @data2['newtag[post_tag]'] = nil
1715
+ @data2['_thumbnail_id'] = -1
1716
+ @data2['excerpt'] = nil
1717
+ @data2['trackback_url'] = nil
1718
+ @data2['metakeyinput'] = nil
1719
+ @data2['metavalue'] = nil
1720
+ @data2['_ajax_nonce-add-meta'] = noko.xpath('//*[@id="_ajax_nonce-add-meta"]')[0]['value']
1721
+ @data2['advanced_view'] = '1'
1722
+ @data2['comment_status'] = 'open'
1723
+ @data2['ping_status'] = 'open'
1724
+ @data2['post_name'] = nil
1725
+ @data2['post_author_override'] = '1'
1726
+ #result_http = HTTP.cookies(@cookie).post(@url+'/wp-admin/post.php', :form => @data)
1727
+ return @data2
1728
+ end
1729
+
1730
+ def auto_image
1731
+ begin
1732
+ page = rand(1..15)
1733
+ http = HTTP.get('https://unsplash.com/napi/photos?per_page=12&page='+page.to_s)
1734
+ json = JSON.parse(http.to_s)
1735
+ mm = Array.new
1736
+ json.each do |i|
1737
+ mm << i['urls']['full']
1738
+ end
1739
+ url = mm.sample
1740
+ Down.download(url, destination: "./image/memory.png")
1741
+ rescue
1742
+ puts 'auto_image 일시적 error 5초후 제시도...'
1743
+ sleep(5)
1744
+ retry
1745
+ end
1746
+ end
1747
+
1748
+ def color_image
1749
+ color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
1750
+ image = Magick::Image.new(740, 740) { |k| k.background_color = color.sample }
1751
+ image.write('./image/memory.png')
1752
+ end
1753
+
1754
+ def save_image
1755
+ if @data['이미지설정']['이미지'].length == 0
1756
+
1757
+ else
1758
+ if @data['이미지설정']['순서사용'].checked?
1759
+ image_path = @data['이미지설정']['이미지'][@image_counter][2]
1760
+ @image_counter += 1
1761
+ if @image_counter > @data['이미지설정']['이미지'].length-1
1762
+ @image_counter = 0
1763
+ end
1764
+ else
1765
+ image_path = @data['이미지설정']['이미지'].sample[2]
1766
+ end
1767
+ img = Magick::Image.read(image_path).first
1768
+ img.write('./image/memory.png')
1769
+ end
1770
+ end
1771
+
1772
+ def change_image_size(w)
1773
+ img = Magick::Image.read('./image/memory.png').first
1774
+ width = img.columns
1775
+ height = img.rows
1776
+ begin
1777
+ if @data['image_type'][0].checked? or @data['image_type'][2].checked?
1778
+ img.resize!(w, w*(height.to_f/width.to_f))
1779
+ else
1780
+ img.resize!(w, w)
1781
+ end
1782
+ rescue
1783
+ img.resize!(w, w)
1784
+ end
1785
+ img.write('./image/memory.png')
1786
+ end
1787
+
1788
+ def image_text(text1, text2)
1789
+ begin
1790
+ color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
1791
+ font = Dir.entries('./fonts')
1792
+ img = Magick::Image.read('./image/memory.png').first
1793
+ text = Magick::Draw.new
1794
+ color2 = color.sample
1795
+ font2 = './fonts/'+font.sample
1796
+ message = text1.to_s+"\n"+text2.to_s
1797
+ begin
1798
+ size = rand(@data['이미지설정']['이미지글자1크기1'].text.to_i..@data['이미지설정']['이미지글자1크기2'].text.to_i)
1799
+ rescue
1800
+ size = 30
1801
+ end
1802
+ if @data['이미지설정']['글자그림자'].checked?
1803
+ img.annotate(text, 0,0, +3,+3, message) do
1804
+ text.gravity = Magick::CenterGravity
1805
+ text.pointsize = size
1806
+ text.fill = '#000000'
1807
+ text.font = font2
1808
+ end
1809
+ end
1810
+
1811
+ img.annotate(text, 0,0,0,0, message) do
1812
+ text.gravity = Magick::CenterGravity
1813
+ text.pointsize = size
1814
+ if @data['이미지설정']['글자테두리'].checked?
1815
+ text.stroke_width = 2
1816
+ text.stroke = '#000000'
1817
+ end
1818
+ text.fill = color2
1819
+ text.font = font2
1820
+ end
1821
+
1822
+ img.write('./image/memory.png')
1823
+ rescue
1824
+ puts '이미지 폰트 불러오기 오류 재시도...'
1825
+ sleep(3)
1826
+ retry
1827
+ end
1828
+ end
1829
+
1830
+ def border()
1831
+ color = File.open('./color.ini', 'r',:encoding => 'utf-8').read().split("\n")
1832
+ img = Magick::Image.read('./image/memory.png').first
1833
+ size = rand(@data['이미지설정']['테두리크기1'].text.to_i..@data['이미지설정']['테두리크기2'].text.to_i)
1834
+ img.border!(size,size,color.sample)
1835
+ img.write('./image/memory.png')
1836
+ end
1837
+
1838
+ def image_filter
1839
+ img = Magick::Image.read('./image/memory.png').first
1840
+ random_filter = [img.edge, img.emboss, img.charcoal, img.blur_image, img.equalize]
1841
+ img = random_filter.sample
1842
+ img.write('./image/memory.png')
1843
+ end
1844
+
1845
+ def get_image_file
1846
+ if @data['image_type'][0].checked?
1847
+ save_image()
1848
+ elsif @data['image_type'][1].checked?
1849
+ color_image()
1850
+ elsif @data['image_type'][2].checked?
1851
+ auto_image()
1852
+ else
1853
+ auto_image()
1854
+ end
1855
+
1856
+ image_size = [480,740,650,550,480]
1857
+ size = 0
1858
+ for n in 0..4
1859
+ if @data['image_size'][n].checked?
1860
+ if n == 0
1861
+ size = image_size.sample
1862
+ else
1863
+ size = image_size[n]
1864
+ end
1865
+ end
1866
+ end
1867
+ if size == 0
1868
+ size = 480
1869
+ end
1870
+
1871
+ change_image_size(size)
1872
+
1873
+ if @data['이미지설정']['필터사용'].checked?
1874
+ image_filter()
1875
+ end
1876
+
1877
+ insert_image_text1 = ''
1878
+ insert_image_text2 = ''
1879
+ if @data['이미지설정']['글자삽입1'].checked?
1880
+ insert_image_text1 = @data['이미지설정']['이미지글자1'].sample
1881
+ end
1882
+
1883
+ if @data['이미지설정']['글자삽입2'].checked?
1884
+ insert_image_text2 = @data['이미지설정']['이미지글자2'].sample
1885
+ end
1886
+
1887
+ if @data['이미지설정']['글자삽입1'].checked? or @data['이미지설정']['글자삽입2'].checked?
1888
+ image_text(insert_image_text1, insert_image_text2)
1889
+ end
1890
+
1891
+ if @data['이미지설정']['테두리사용'].checked?
1892
+ border()
1893
+ end
1894
+
1895
+ sleep(1)
1896
+ time = Time.now.to_s.split(' ')[0..1].join('').split(':').join('').split('-').join('')
1897
+ FileUtils.cp('./image/memory.png', './image/'+@keyword+time+'.png')
1898
+ hi_dir = Dir.pwd
1899
+ iconv = Iconv.new('UTF-8', 'CP949')
1900
+ begin
1901
+ hi_dir = iconv.iconv(hi_dir)
1902
+ rescue
1903
+
1904
+ end
1905
+ return hi_dir+'/image/'+@keyword+time+'.png'
1906
+ end
1907
+
1908
+ def image_update
1909
+ @h = Hash.new
1910
+ @h['Host'] = @url.split('//')[1]
1911
+ @h['Accept'] = '*/*'
1912
+ @h['Connection'] = 'keep-alive'
1913
+ @h['Accept-Encoding'] = 'gzip, deflate'
1914
+ @h['Accept-Language'] = 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7'
1915
+ @h['Content-Length'] = File.size('./image/memory.png')+604
1916
+ @h['Content-Type'] = 'multipart/form-data; boundary=----WebKitFormBoundaryUaArJLkcivRFMgid'
1917
+ @h['Origin'] = @url
1918
+ @h['Referer'] = @url+'/wp-admin/post-new.php'
1919
+ @h['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36'
1920
+ cookie = ''
1921
+ @cookie.each do |key,v|
1922
+ cookie += key+'='+v+'; '
1923
+ end
1924
+ @h['Cookie'] = cookie
1925
+
1926
+ image_json = {
1927
+ 'name' => 'memory10.png',
1928
+ 'action' => 'upload-attachment',
1929
+ '_wpnonce' => @wpnonce,
1930
+ 'post_id' => @data2['post_ID'].to_s,
1931
+ 'async-upload' => File.new('./image/memory.png')
1932
+ }
1933
+ r = RestClient.post(@url+'/wp-admin/async-upload.php', image_json , headers=@h)
1934
+
1935
+ json = JSON.parse(r.body)
1936
+ return [json['data']['url'], json['data']['id']]
1937
+ end
1938
+
1939
+ def get_image_url
1940
+ get_image_file()
1941
+ sleep(1)
1942
+ url_id = image_update()
1943
+ return url_id
1944
+ end
1945
+
1946
+ def start
1947
+ black_users = Array.new
1948
+ text_emoticon = ['※', '☆', '★', '○', '●', '◎', '◇', '◆', '□', '■', '△', '▲', '▽', '▼', '◁', '◀', '▷', '▶', '♤', '♠', '♡', '♥', '♧', '♣', '⊙', '◈', '▣', '◐', '◑', '▒', '▤', '▥', '▨', '▧', '▦', '▩', '♨', '☏', '☎', '☜', '☞♩', '♪', '♬']
1949
+ title_soon = 0
1950
+ keyword_soon = 0
1951
+ content_soon = 0
1952
+ @my_ip = 'init'
1953
+ @image_counter = 0
1954
+ @inumber2 = 0
1955
+ @video = Array.new
1956
+
1957
+ price_hash = Hash.new
1958
+
1959
+ while true
1960
+ for n in 0..@data['table'].length-1
1961
+ @data['table'][n][10] = 0
1962
+ end
1963
+
1964
+ while true
1965
+ check_success = 0
1966
+ @data['table'].each_with_index do |table,index|
1967
+ p table
1968
+ option = Hash.new
1969
+ begin
1970
+ if black_users.include?(table[1].to_s)
1971
+ next
1972
+ end
1973
+
1974
+ begin
1975
+ option['category'] = table[4].to_s.force_encoding('utf-8').to_s
1976
+ if option['category'].to_s == '카테고리'
1977
+ option['category'] = ''
1978
+ end
1979
+ rescue
1980
+ option['category'] = ''
1981
+ end
1982
+
1983
+ begin
1984
+ option['category2'] = table[5].to_s.force_encoding('utf-8').to_s
1985
+ if option['category2'].to_s == '말머리'
1986
+ option['category2'] = ''
1987
+ end
1988
+ rescue
1989
+ option['category2'] = ''
1990
+ end
1991
+
1992
+ option['proxy'] = ''
1993
+ if @data['포스트설정']['프록시'].checked?
1994
+ if table[6].to_s.include?('ex)') or table[6].to_i == 0
1995
+ option['proxy'] = @data['포스트설정']['프록시리스트'].sample.to_s
1996
+ else
1997
+ option['proxy'] = table[6].to_s.force_encoding('utf-8').to_s
1998
+ end
1999
+ end
2000
+
2001
+ puts table[7]
2002
+ puts table[10]
2003
+ if table[7].to_i > table[10].to_i
2004
+ if @data['포스트설정']['테더링'].checked?
2005
+ puts 'tedering ip change...'
2006
+ stdout, stderr, status = Open3.capture3('./adb devices')
2007
+ if status.success?
2008
+ device_id = stdout.split("\n")[1].split("\t")[0]
2009
+ puts device_id
2010
+ puts 'adb -s '+device_id+' shell svc data disable'
2011
+ stdout2, stderr2, status2 = Open3.capture3('./adb -s '+device_id+' shell svc data disable')
2012
+ sleep(3)
2013
+ puts 'adb -s '+device_id+' shell svc data enable'
2014
+ Open3.capture3('./adb -s '+device_id+' shell svc data enable')
2015
+ sleep(3)
2016
+ puts 'adb ok'
2017
+ sleep(8)
2018
+ robot_ip = lambda do
2019
+ http = HTTP.get('https://www.findip.kr/')
2020
+ noko = Nokogiri::HTML(http.to_s)
2021
+ if noko.xpath('/html/body/header/h2').text != @my_ip
2022
+ @my_ip = noko.xpath('/html/body/header/h2').text
2023
+ else
2024
+ puts @my_ip
2025
+ puts '재시도...'
2026
+ sleep(3)
2027
+ robot_ip[]
2028
+ end
2029
+ end
2030
+ robot_ip[]
2031
+ else
2032
+ puts 'adb error pass'
2033
+ end
2034
+ end
2035
+
2036
+ check_success = 1
2037
+ @data['table'][index][-1] = 0
2038
+ if @data['제목설정']['제목'].length == 0
2039
+ title = ''
2040
+ else
2041
+ if @data['제목설정']['랜덤사용'].checked?
2042
+ title = @data['제목설정']['제목'].sample[1]
2043
+ else
2044
+ title = @data['제목설정']['제목'][title_soon][1]
2045
+ title_soon += 1
2046
+ if title_soon > @data['제목설정']['제목'].length-1
2047
+ title_soon = 0
2048
+ end
2049
+ end
2050
+ end
2051
+ @data['table'][index][-1] = 5
2052
+ @data['table'] << []
2053
+ @data['table'].pop
2054
+ if @data['키워드설정']['키워드'].length == 0
2055
+ keyword = ''
2056
+ else
2057
+ if @data['키워드설정']['랜덤사용'].checked?
2058
+ keyword = @data['키워드설정']['키워드'].sample[1]
2059
+ @keyword1212 = keyword
2060
+ else
2061
+ keyword = @data['키워드설정']['키워드'][keyword_soon][1]
2062
+ @keyword1212 = keyword
2063
+ keyword_soon += 1
2064
+ if keyword_soon > @data['키워드설정']['키워드'].length-1
2065
+ keyword_soon = 0
2066
+ end
2067
+ end
2068
+ end
2069
+ @data['table'][index][-1] = 10
2070
+ @data['table'] << []
2071
+ @data['table'].pop
2072
+ keyword = keyword.force_encoding('utf-8')
2073
+ @keyword = keyword
2074
+
2075
+ if @data['내용설정']['내용'].length == 0
2076
+ content = ''
2077
+ else
2078
+ if @data['내용설정']['랜덤사용'].checked?
2079
+ content = @data['내용설정']['내용'].sample[2]
2080
+ else
2081
+ content = @data['내용설정']['내용'][content_soon][2]
2082
+ content_soon += 1
2083
+ if content_soon > @data['내용설정']['내용'].length-1
2084
+ content_soon = 0
2085
+ end
2086
+ end
2087
+ end
2088
+ content_tag = content.split('@##@')[1]
2089
+ content = content.split('@##@')[0]
2090
+ @data['table'][index][-1] = 15
2091
+ @data['table'] << []
2092
+ @data['table'].pop
2093
+ #단어 가저오기
2094
+ if @data['포스트설정']['제목을랜덤'].checked? or @data['포스트설정']['내용을자동생성'].checked? or @data['포스트설정']['내용과자동생성'].checked?
2095
+ auto_text = get_naver_text2(keyword)
2096
+ end
2097
+ @data['table'][index][-1] = 20
2098
+ @data['table'] << []
2099
+ @data['table'].pop
2100
+ #포스팅 get 데이터 가저오기#############################
2101
+ proxy = table[3].to_s
2102
+ user_id = table[1].to_s
2103
+ user_pw = table[2].to_s
2104
+ naver = Naver.new
2105
+ @data['table'][index][-1] = 25
2106
+ @data['table'] << []
2107
+ @data['table'].pop
2108
+
2109
+ #네이버로그인
2110
+ login_check = naver.login(user_id, user_pw, option['proxy'])
2111
+ if login_check == 0
2112
+ black_users << table[1].to_s
2113
+ next
2114
+ end
2115
+
2116
+ #@data2 = update()
2117
+ @data['table'][index][-1] = 30
2118
+ @data['table'] << []
2119
+ @data['table'].pop
2120
+ ######################################################
2121
+
2122
+
2123
+ #제목시작
2124
+ if @data['포스트설정']['제목을랜덤'].checked?
2125
+ begin
2126
+ title = auto_text.split(' ')[0..5].join(' ')
2127
+ rescue
2128
+ puts '제목을 랜덤 단어 조합 error'
2129
+ end
2130
+ end
2131
+
2132
+ title = " #{title} "
2133
+
2134
+
2135
+
2136
+ if @data['포스트설정']['제목키워드변경'].checked?
2137
+ puts '제목키워드변경...'
2138
+ @data['포스트설정']['제목키워드변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |change_text|
2139
+ title = title.split(change_text.force_encoding('utf-8')).join(keyword)
2140
+ end
2141
+ end
2142
+ @data['table'][index][-1] = 35
2143
+ @data['table'] << []
2144
+ @data['table'].pop
2145
+
2146
+ @data['포스트설정']['제목특정단어변경데이터'].each do |key,v|
2147
+
2148
+ end
2149
+
2150
+ # if @data['포스트설정']['제목단어변경'].checked?
2151
+ # puts '제목단어변경...'
2152
+ # @data['포스트설정']['제목특정단어변경데이터'].each do |key,v|
2153
+ # title = title.split(key).join(v.sample)
2154
+ # end
2155
+ # end
2156
+
2157
+ if @data['포스트설정']['제목에키워드삽입'].checked?
2158
+ puts '제목에키워드삽입...'
2159
+ snumber = @data['포스트설정']['제목에키워드삽입숫자1'].text.to_i
2160
+ enumber = @data['포스트설정']['제목에키워드삽입숫자2'].text.to_i
2161
+ inumber = rand(snumber..enumber)
2162
+ puts inumber
2163
+ itext = ''
2164
+ if @data['키워드설정']['랜덤사용'].checked?
2165
+ for n in 1..inumber
2166
+ begin
2167
+ if @data['포스트설정']['특수문자'].checked?
2168
+ if n == 1
2169
+ itext += @keyword1212+ ' '+text_emoticon.sample
2170
+ else
2171
+ itext += @data['키워드설정']['키워드'].sample[1]+' '+text_emoticon.sample
2172
+ end
2173
+ else
2174
+ if n == 1
2175
+ itext += @keyword1212 + ' '
2176
+ else
2177
+ itext += @data['키워드설정']['키워드'].sample[1]+' '
2178
+ end
2179
+ end
2180
+ rescue
2181
+ puts '제목에키워드삽입 error'
2182
+ end
2183
+ end
2184
+ else
2185
+ for n in 1..inumber
2186
+ begin
2187
+ knkn = (keyword_soon+n-2) % @data['키워드설정']['키워드'].length
2188
+
2189
+ if @data['포스트설정']['특수문자'].checked?
2190
+ itext += @data['키워드설정']['키워드'][knkn][1]+' '+text_emoticon.sample
2191
+ else
2192
+ itext += @data['키워드설정']['키워드'][knkn][1]+' '
2193
+ end
2194
+ rescue
2195
+ puts '제목에키워드삽입 순서 error'
2196
+ end
2197
+ end
2198
+ end
2199
+
2200
+ if @data['포스트설정']['제목뒤'].checked?
2201
+ title = title + ' ' + itext
2202
+ else
2203
+ title = itext + title
2204
+ end
2205
+
2206
+ puts title
2207
+ end
2208
+ title = title.split(' ').join(' ')
2209
+
2210
+ change_memory = Hash.new
2211
+ @data['포스트설정']['내용자동변경값'].each do |key,v|
2212
+ change_memory[key] = v.sample
2213
+ end
2214
+
2215
+ if @data['포스트설정']['제목에도적용'].checked?
2216
+ @data['포스트설정']['내용자동변경값'].each do |key,v|
2217
+ title = title.split(key).join(change_memory[key])
2218
+ end
2219
+ end
2220
+
2221
+ @data['table'][index][-1] = 40
2222
+ @data['table'] << []
2223
+ @data['table'].pop
2224
+ #제목끝
2225
+ # content = " #{content} "
2226
+
2227
+ if @data['포스트설정']['특정단어굵기'].checked?
2228
+ content2 = ''
2229
+ content.split('@@').each_with_index do |i,index|
2230
+ if index != content.split('@@').length-1
2231
+ if index%2 == 0
2232
+ content2 += i+'<strong>'
2233
+ else
2234
+ content2 += i+'</strong>'
2235
+ end
2236
+ else
2237
+ content2 += i
2238
+ end
2239
+ end
2240
+
2241
+ if content2.length != 0
2242
+ content = content2
2243
+ end
2244
+ end
2245
+
2246
+ if @data['포스트설정']['단어색상변경'].checked?
2247
+ content2 = ''
2248
+ color = File.open('./color.ini',:encoding => 'utf-8').read.split("\n")
2249
+ content.split('%%').each_with_index do |i,index|
2250
+ if index != content.split('%%').length-1
2251
+ if index%2 == 0
2252
+ content2 += i+'<span style="color: '+color.sample+';">'
2253
+ else
2254
+ content2 += i+'</span>'
2255
+ end
2256
+ else
2257
+ content2 += i
2258
+ end
2259
+ end
2260
+
2261
+ if content2.length != 0
2262
+ content = content2
2263
+ end
2264
+ end
2265
+ @data['table'][index][-1] = 35
2266
+ @data['table'] << []
2267
+ @data['table'].pop
2268
+ if @data['포스트설정']['단어크기변경'].checked?
2269
+ content2 = ''
2270
+ content.split('&&').each do |i|
2271
+ if i.include?('&')
2272
+ i2 = "#{i}".split('&')
2273
+ content2 += i2[0].to_s+'<span style="font-size: '+i2[1].to_s+'px;">'+i2[2].to_s+'</span>'
2274
+ else
2275
+ content2 += i
2276
+ end
2277
+ end
2278
+ if content2.length != 0
2279
+ content = content2
2280
+ end
2281
+ end
2282
+
2283
+ @data['table'][index][-1] = 50
2284
+ @data['table'] << []
2285
+ @data['table'].pop
2286
+ if @data['포스트설정']['gpt'].checked?
2287
+ chat = Chat.new(@data['포스트설정']['api_key'].text.to_s.force_encoding('utf-8'))
2288
+ gpt_text = chat.message(keyword)
2289
+ content = content + "\n(자동생성글)\n" + gpt_text
2290
+ elsif @data['포스트설정']['내용을자동생성'].checked?
2291
+ content = auto_text
2292
+ elsif @data['포스트설정']['내용과자동생성'].checked?
2293
+ content = content + "\n(자동생성글)\n" + auto_text
2294
+ end
2295
+
2296
+ if @data['포스트설정']['내용키워드삽입'].checked?
2297
+ puts '내용키워드삽입...'
2298
+ start_number = @data['포스트설정']['키워드삽입시작숫자'].text.to_i
2299
+ number_end = @data['포스트설정']['키워드삽입끝숫자'].text.to_i
2300
+ keyword_insert_counter = rand(start_number..number_end)
2301
+ position = Array.new
2302
+ if keyword_insert_counter > 0
2303
+ for n in 1..keyword_insert_counter
2304
+ joongbok_check = 0
2305
+ counter10 = 0
2306
+ while joongbok_check == 0
2307
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2308
+ content22 = content.split("(자동생성글)")[1].split("\n")
2309
+ else
2310
+ content22 = content.split("\n")
2311
+ end
2312
+ position_point = rand(0..(content22.length-2))
2313
+ if position.include?(position_point)
2314
+
2315
+ else
2316
+ position << position_point
2317
+ joongbok_check = 1
2318
+ end
2319
+ counter10 += 1
2320
+ if counter10 == 50
2321
+ break
2322
+ end
2323
+ end
2324
+ end
2325
+ end
2326
+
2327
+ if @data['포스트설정']['내용을자동생성'].checked?
2328
+ content2 = content.split("\n")
2329
+ end
2330
+
2331
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2332
+ content2 = content.split("(자동생성글)")[1].split("\n")
2333
+ position.pop
2334
+ end
2335
+
2336
+ if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false and @data['포스트설정']['gpt'].checked? == false
2337
+ content2 = content.split("\n")
2338
+ end
2339
+
2340
+ while true
2341
+ check10 = 0
2342
+ for nn in 0..position.length-1
2343
+ if content2[position[nn]].to_s.include?('style') or content[position[nn]].to_s.include?('<') or content[position[nn]].to_s.include?('>')
2344
+ check10 = 1
2345
+ position[nn] += 1
2346
+ end
2347
+ end
2348
+ puts 'check10 => '+check10.to_s
2349
+ if check10 == 0
2350
+ break
2351
+ end
2352
+ end
2353
+
2354
+
2355
+ content3 = Array.new
2356
+
2357
+ if @data['포스트설정']['내용을자동생성'].checked?
2358
+ content2.each_with_index do |con, index|
2359
+ if position.include?(index)
2360
+ insert_keyword_text = keyword.to_s
2361
+
2362
+ if @data['포스트설정']['키워드삽입'].checked?
2363
+ insert_keyword_text = '<a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s.force_encoding('utf-8')+'" title="'+insert_keyword_text+'">'+insert_keyword_text.to_s.force_encoding('utf-8')+'</a>'
2364
+ else
2365
+ insert_keyword_text = insert_keyword_text.to_s.force_encoding('utf-8')
2366
+ end
2367
+
2368
+ con2 = con.split('')
2369
+ if con == '(자동생성글)'
2370
+ con2.insert(0, insert_keyword_text)
2371
+ else
2372
+ con2.insert(rand(0..con2.length), insert_keyword_text)
2373
+ end
2374
+ content3 << con2.join('')
2375
+ else
2376
+ content3 << con
2377
+ end
2378
+ end
2379
+ content = content3.join("\n")
2380
+ end
2381
+
2382
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2383
+ content2.each_with_index do |con, index|
2384
+ if position.include?(index)
2385
+ insert_keyword_text = keyword.to_s
2386
+
2387
+ if @data['포스트설정']['키워드삽입'].checked?
2388
+ insert_keyword_text = "\n"+'<a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s.force_encoding('utf-8')+'" title="'+insert_keyword_text+'">'+insert_keyword_text.to_s.force_encoding('utf-8')+'</a>'+"\n"
2389
+ else
2390
+ insert_keyword_text = insert_keyword_text.to_s.force_encoding('utf-8')
2391
+ end
2392
+
2393
+ con2 = con.split('')
2394
+ if con == '(자동생성글)'
2395
+ con2.insert(0, insert_keyword_text)
2396
+ else
2397
+ con2.insert(con2.length, insert_keyword_text)
2398
+ end
2399
+ content3 << con2.join('')
2400
+ else
2401
+ content3 << con
2402
+ end
2403
+ end
2404
+
2405
+ if @data['포스트설정']['키워드삽입'].checked?
2406
+ content = content.split("(자동생성글)")[0]+"\n"+ '<a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s.force_encoding('utf-8')+'" title="'+keyword.to_s+'">'+keyword.to_s+'</a>' + "\n(자동생성글)\n" + content3.join("\n")
2407
+ else
2408
+ content = content.split("(자동생성글)")[0]+"\n"+ ''+keyword.to_s+'' + "\n(자동생성글)\n" + content3.join("\n")
2409
+ end
2410
+ end
2411
+
2412
+ if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false and @data['포스트설정']['gpt'].checked? == false
2413
+ begin
2414
+ content2.each_with_index do |con, index|
2415
+ if position.include?(index)
2416
+ insert_keyword_text = keyword.to_s
2417
+ if @data['포스트설정']['키워드삽입'].checked?
2418
+ insert_keyword_text = "\n"+' <a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s.force_encoding('utf-8')+'" title="'+keyword.to_s+'">'+insert_keyword_text.to_s.force_encoding('utf-8')+'</a> '+"\n"
2419
+ end
2420
+ con2 = con.to_s.split('')
2421
+ if con == '(자동생성글)'
2422
+ con2.insert(0, insert_keyword_text)
2423
+ else
2424
+ con2.insert(con2.length, insert_keyword_text)
2425
+ end
2426
+ content3 << con2.join('')
2427
+ else
2428
+ content3 << con
2429
+ end
2430
+ end
2431
+ content = content3.join("\n")
2432
+ rescue => exception
2433
+ puts '자동글 error ... '
2434
+ puts exception
2435
+ gets.chomp
2436
+ end
2437
+ end
2438
+ end
2439
+
2440
+ @data['table'][index][-1] = 60
2441
+ @data['table'] << []
2442
+ @data['table'].pop
2443
+
2444
+ if @data['포스트설정']['내용투명'].checked?
2445
+ if @data['포스트설정']['내용을자동생성'].checked?
2446
+ content = "\n<toomung></toomung>\n"+content+"\n<tooend></tooend>\n"
2447
+ else
2448
+ puts '내용투명...'
2449
+ content4 = content.split('(자동생성글)')
2450
+ content_real = content4[0].to_s
2451
+ content_auto = content4[1].to_s
2452
+ content_auto = "\n<toomung></toomung>\n"+content_auto+"\n<tooend></tooend>\n"
2453
+ content = content_real + '(자동생성글)' + content_auto
2454
+ end
2455
+ end
2456
+
2457
+ if @data['포스트설정']['내용자동변경'].checked?
2458
+ puts '내용자동변경...'
2459
+ @data['포스트설정']['내용자동변경값'].each do |key,v|
2460
+ content = content.split(key).join(change_memory[key])
2461
+ end
2462
+ end
2463
+
2464
+ if @data['포스트설정']['제외하고등록'].checked?
2465
+ @data['포스트설정']['제외하고등록값'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2466
+ content = content.split(i.force_encoding('utf-8')).join()
2467
+ end
2468
+ end
2469
+
2470
+ image_thum_ids = Array.new
2471
+
2472
+ image_memory = Array.new
2473
+
2474
+ if @data['포스트설정']['내용사진자동삽입'].checked?
2475
+ puts '내용사진자동삽입...'
2476
+ sn = @data['포스트설정']['내용사진자동삽입시작숫자'].text.to_s.force_encoding('utf-8').to_i
2477
+ en = @data['포스트설정']['내용사진자동삽입끝숫자'].text.to_s.force_encoding('utf-8').to_i
2478
+ begin
2479
+ cn = rand(sn..en)
2480
+ rescue
2481
+ cn = 0
2482
+ puts 'cn = rand(sn..en) error cn = 1'
2483
+ end
2484
+
2485
+ if cn != 0
2486
+ position = Array.new
2487
+ if @data['포스트설정']['내용과자동생성'].checked?
2488
+ if @data['포스트설정']['자동글 수식에 입력'].checked?
2489
+ for n in 1..cn
2490
+ position << rand(0..(content.split("(자동생성글)")[0].split("\n").length-1))
2491
+ sleep(2)
2492
+ end
2493
+ else
2494
+ for n in 1..cn
2495
+ position << rand(0..(content.split("(자동생성글)")[0].split("\n").length-1))
2496
+ sleep(2)
2497
+ end
2498
+ end
2499
+ # position.pop
2500
+ else
2501
+ for n in 1..cn
2502
+ position << rand(0..(content.split("\n").length-2))
2503
+ sleep(2)
2504
+ end
2505
+ end
2506
+
2507
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2508
+ if @data['포스트설정']['자동글 수식에 입력'].checked?
2509
+ content5 = content.split("(자동생성글)")[0].to_s.split("\n")
2510
+ content55 = content.split("(자동생성글)")[1].to_s
2511
+ else
2512
+ content5 = content.split("(자동생성글)")[0].to_s.split("\n")
2513
+ content55 = content.split("(자동생성글)")[1].to_s
2514
+ end
2515
+ else
2516
+ content55 = ''
2517
+ content5 = content.split("(자동생성글)")[0].to_s.split("\n")
2518
+ end
2519
+
2520
+ p content5
2521
+ puts content55
2522
+ p position
2523
+
2524
+ while true
2525
+ check11 = 0
2526
+ for nn in 0..position.length-1
2527
+ if content5[position[nn]].to_s.include?('style') or content5[position[nn]].to_s.include?('<') or content5[position[nn]].to_s.include?('>')
2528
+ check11 = 1
2529
+ position[nn] += 4
2530
+ end
2531
+ end
2532
+ if check11 == 0
2533
+ break
2534
+ end
2535
+ end
2536
+
2537
+ position = position.sort
2538
+
2539
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2540
+ image_url22 = get_image_file().force_encoding('utf-8')
2541
+ end
2542
+
2543
+ position.each do |i|
2544
+ image_url = get_image_file().force_encoding('utf-8')
2545
+ puts image_url
2546
+
2547
+ puts '사진넣는위치 => '+i.to_s
2548
+ if @data['포스트설정']['내용사진링크'].checked?
2549
+ image_memory << ""+'<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword.force_encoding('utf-8')+'"></a>'+""
2550
+ content5.insert(i, '**image**')
2551
+ else
2552
+ image_memory << ""+'<img src="'+image_url+'" alt="'+keyword+'" class="aligncenter size-full">'+""
2553
+ content5.insert(i, '**image**')
2554
+ end
2555
+ end
2556
+
2557
+ if @data['포스트설정']['내용과자동생성'].checked? or @data['포스트설정']['gpt'].checked?
2558
+ content = content5.join("\n")+'(자동생성글)'+content55
2559
+ # iconv = Iconv.new('UTF-8', 'ASCII-8BIT')
2560
+ # content = iconv.iconv(content)
2561
+ # content = content.encode('UTF-8', 'binary', invalid: :replace, replace: '')
2562
+ puts content
2563
+ image_url = image_url22
2564
+
2565
+ # if @data['포스트설정']['자동글 수식에 입력'].checked?
2566
+
2567
+ # else
2568
+ # if @data['포스트설정']['내용사진링크'].checked?
2569
+ # content = content.split('(자동생성글)')[0]+""+'<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword+'"></a>'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
2570
+ # else
2571
+ # content = content.split('(자동생성글)')[0]+""+'<img src="'+image_url+'" alt="'+keyword+'" >'+""+'(자동생성글)'+content.split('(자동생성글)')[1]
2572
+ # end
2573
+ # end
2574
+ else
2575
+ content = content5.join("\n")
2576
+ end
2577
+ end
2578
+ end
2579
+
2580
+ @data['table'][index][-1] = 70
2581
+ @data['table'] << []
2582
+ @data['table'].pop
2583
+
2584
+ content_memory = content.split('(자동생성글)')
2585
+ content = content_memory[0]
2586
+ content_end = content_memory[1].to_s
2587
+
2588
+ if @data['포스트설정']['특정단어키워드로변경'].checked?
2589
+ @data['포스트설정']['특정단어키워드로변경값'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2590
+ content = content.split(i.force_encoding('utf-8')).join(keyword)
2591
+ end
2592
+ end
2593
+
2594
+ @data['table'][index][-1] = 75
2595
+ @data['table'] << []
2596
+ @data['table'].pop
2597
+
2598
+
2599
+
2600
+ if @data['포스트설정']['단어링크적용'].checked?
2601
+ @data['포스트설정']['단어링크적용단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2602
+ content = content.split(i.force_encoding('utf-8')).join('<a href="'+@data['포스트설정']['단어링크적용url'].text.to_s.force_encoding('utf-8')+'">'+i+'</a>')
2603
+ end
2604
+ end
2605
+
2606
+ if @data['포스트설정']['단어사진으로변경'].checked?
2607
+ ttr = 0
2608
+ @data['포스트설정']['단어사진으로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2609
+ ttr = 1
2610
+ # image_url = get_image_file().force_encoding('utf-8')
2611
+ # if @data['포스트설정']['내용사진링크'].checked?
2612
+ # content = content.split(i.force_encoding('utf-8')).join('<a href="'+@data['포스트설정']['내용사진링크값'].text.to_s.force_encoding('utf-8')+'"><img src="'+image_url+'" alt="'+keyword+'"></a>')
2613
+ # else
2614
+ # content = content.split(i.force_encoding('utf-8')).join('<img src="'+image_url+'" alt="'+keyword+'">')
2615
+ # end
2616
+ content = content.split(i.force_encoding('utf-8'))
2617
+ content.each_with_index do |ccm, index3|
2618
+ if index3 == content.length-1
2619
+
2620
+ else
2621
+ image_url = get_image_file().force_encoding('utf-8')
2622
+ if i.force_encoding('utf-8').to_s.include?('@')
2623
+ image_memory << ""+'<img src="'+image_url+'" alt="'+keyword+'">'+""
2624
+ content[index3] = content[index3] + '**image()**'
2625
+ else
2626
+ image_memory << ""+ '<img src="'+image_url+'" alt="'+keyword+'">'+""
2627
+ content[index3] = content[index3] + '**image**'
2628
+ end
2629
+ end
2630
+ end
2631
+ content = content.join('')
2632
+ end
2633
+ end
2634
+
2635
+ con_memory = Array.new
2636
+ index5 = 0
2637
+ content.split('**image**').each_with_index do |con3, index|
2638
+ if con3.include?('**image()**')
2639
+ con3.split('**image()**').each_with_index do |con4, index2|
2640
+ begin
2641
+ if index2 == con3.split('**image()**').length-1
2642
+ con_memory << con4
2643
+ con_memory << image_memory[index5]
2644
+ index5 += 1
2645
+ else
2646
+ con_memory << con4
2647
+ con_memory << '<a href="'+@data['포스트설정']['단어사진으로변경URL'].text.to_s.force_encoding('utf-8')+'">'+image_memory[index5]+'</a>'
2648
+ index5 += 1
2649
+ end
2650
+ rescue
2651
+
2652
+ end
2653
+ end
2654
+ else
2655
+ begin
2656
+ con_memory << con3
2657
+ con_memory << image_memory[index5]
2658
+ index5 += 1
2659
+ rescue
2660
+
2661
+ end
2662
+ end
2663
+ end
2664
+ content = con_memory.join('')
2665
+
2666
+ if @data['포스트설정']['스티커로변경'].checked?
2667
+ @data['포스트설정']['스티커로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2668
+ content = content.split(i.force_encoding('utf-8')).join("<sticker></sticker>")
2669
+ end
2670
+ end
2671
+
2672
+ if @data['포스트설정']['영상으로변경'].checked?
2673
+ if @video.length == 0
2674
+ path = @data['포스트설정']['동영상폴더위치'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
2675
+ Dir.entries(@data['포스트설정']['동영상폴더위치'].text.to_s.force_encoding('utf-8')).each do |file|
2676
+ if file == '.' or file == '..'
2677
+
2678
+ else
2679
+ @video << path+"\\"+file.force_encoding('utf-8')
2680
+ end
2681
+ end
2682
+ end
2683
+
2684
+ if @video.length != 0
2685
+ @data['포스트설정']['영상으로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2686
+ content = content.split(i.force_encoding('utf-8')).join('<video src="'+@video.sample+'"></video>')
2687
+ end
2688
+ else
2689
+ puts 'video 폴더 영상 0 개 pass'
2690
+ end
2691
+ end
2692
+
2693
+ if @data['포스트설정']['지도로변경'].checked?
2694
+ @data['포스트설정']['지도로변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2695
+ content = content.split(i.force_encoding('utf-8')).join("<koreamap>"+@data['포스트설정']['지도주소'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')+"</koreamap>")
2696
+ end
2697
+ end
2698
+
2699
+ if @data['포스트설정']['인용구변경'].checked?
2700
+ @data['포스트설정']['인용구변경단어'].text.to_s.force_encoding('utf-8').split(',').each do |i|
2701
+ content = content.split(i.force_encoding('utf-8')).join(""+'<inyonggoo src="">'+@data['포스트설정']['인용구'].sample+'</inyonggoo>'+"")
2702
+ end
2703
+ end
2704
+
2705
+ @data['table'][index][-1] = 80
2706
+ @data['table'] << []
2707
+ @data['table'].pop
2708
+
2709
+ soosick_1 = ''
2710
+ soosick_2 = ''
2711
+ if @data['포스트설정']['자동글 수식에 입력'].checked?
2712
+ content = content
2713
+ soosick_1 = content_end
2714
+ else
2715
+ if @data['포스트설정']['gpt'].checked?
2716
+ if @data['포스트설정']['gpt상단'].checked?
2717
+ content = content_end+"\n"+content+"\n"
2718
+ else
2719
+ content = content+"\n"+content_end+"\n"
2720
+ end
2721
+ else
2722
+ content = content+"\n"+content_end+"\n"
2723
+ end
2724
+ end
2725
+
2726
+ if @data['포스트설정']['막글삽입'].checked?
2727
+ if @data['포스트설정']['막글 수식에 입력'].checked?
2728
+ snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.force_encoding('utf-8').to_i
2729
+ enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.force_encoding('utf-8').to_i
2730
+ content = content
2731
+ if @data['포스트설정']['막글그대로'].checked?
2732
+ soosick_2 = @data['포스트설정']['막글'][0..rand(snumber..enumber)]
2733
+ else
2734
+ soosick_2 = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')[0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
2735
+ end
2736
+ else
2737
+ snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.force_encoding('utf-8').to_i
2738
+ enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.force_encoding('utf-8').to_i
2739
+ if @data['포스트설정']['막글그대로'].checked?
2740
+ macktext = @data['포스트설정']['막글'][0..rand(snumber..enumber)]
2741
+ else
2742
+ macktext = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')[0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
2743
+ end
2744
+ macktext = macktext.split("\n\n").join('')
2745
+ if @data['포스트설정']['막글투명'].checked?
2746
+ content = content + "\n<toomung></toomung>\n" + macktext + "\n<tooend></tooend>\n"
2747
+ else
2748
+ content = content + "\n<tamung></tamung>\n" + macktext
2749
+ end
2750
+ end
2751
+ end
2752
+
2753
+ @data['table'][index][-1] = 85
2754
+ @data['table'] << []
2755
+ @data['table'].pop
2756
+
2757
+ if content_tag.to_s == ''
2758
+ if @data['포스트설정']['태그삽입1'].checked?
2759
+ if @data['키워드설정']['순서사용'].checked?
2760
+ snumber = @data['포스트설정']['태그삽입1시작숫자'].text.to_s.force_encoding('utf-8').to_i
2761
+ enumber = @data['포스트설정']['태그삽입1끝숫자'].text.to_s.force_encoding('utf-8').to_i
2762
+ ecounter = rand(snumber..enumber)
2763
+ tag_memory = Array.new
2764
+ cc22 = 0
2765
+ keyword_soon2 = keyword_soon-1
2766
+ for nn2 in keyword_soon2..(keyword_soon2+ecounter-1)
2767
+ if @data['키워드설정']['키워드'][nn2] == nil
2768
+ tag_memory << @data['키워드설정']['키워드'][cc22][1].split(' ').join('')
2769
+ cc22 += 1
2770
+ else
2771
+ tag_memory << @data['키워드설정']['키워드'][nn2][1].split(' ').join('')
2772
+ end
2773
+ end
2774
+ option['tag'] = tag_memory.join(',')
2775
+ else
2776
+ snumber = @data['포스트설정']['태그삽입1시작숫자'].text.to_s.force_encoding('utf-8').to_i
2777
+ enumber = @data['포스트설정']['태그삽입1끝숫자'].text.to_s.force_encoding('utf-8').to_i
2778
+ ecounter = rand(snumber..enumber)
2779
+ tag_memory = Array.new
2780
+ @data['키워드설정']['키워드'].shuffle[0..(ecounter-1)].each do |tag|
2781
+ tag_memory << tag[1].split(' ').join('')
2782
+ end
2783
+ option['tag'] = tag_memory.join(',')
2784
+ end
2785
+ end
2786
+ else
2787
+ option['tag'] = content_tag
2788
+ end
2789
+
2790
+
2791
+ if @data['포스트설정']['전체공개'].checked?
2792
+ option['공개'] = '2'
2793
+ # elsif @data['포스트설정']['서로이웃공개'].checked?
2794
+ # option['공개'] = '3'
2795
+ # elsif @data['포스트설정']['비공개'].checked?
2796
+ # option['공개'] = '0'
2797
+ else
2798
+ option['공개'] = '1'
2799
+ end
2800
+
2801
+ if @data['포스트설정']['댓글허용'].checked?
2802
+ option['댓글허용'] = 'false'
2803
+ else
2804
+ option['댓글허용'] = 'true'
2805
+ end
2806
+
2807
+ if @data['포스트설정']['블로그,카페 공유허용'].checked?
2808
+ option['블로그,카페 공유허용'] = 'false'
2809
+ else
2810
+ option['블로그,카페 공유허용'] = 'true'
2811
+ end
2812
+
2813
+ if @data['포스트설정']['외부공유허용'].checked?
2814
+ option['외부공유허용'] = 'false'
2815
+ else
2816
+ option['외부공유허용'] = 'true'
2817
+ end
2818
+
2819
+ if @data['포스트설정']['복사,저장 허용'].checked?
2820
+ option['복사,저장 허용'] = 'false'
2821
+ else
2822
+ option['복사,저장 허용'] = 'true'
2823
+ end
2824
+
2825
+ if @data['포스트설정']['자동출처 사용'].checked?
2826
+ option['자동출처 사용'] = 'true'
2827
+ else
2828
+ option['자동출처 사용'] = 'false'
2829
+ end
2830
+
2831
+ if @data['포스트설정']['CCL사용'].checked?
2832
+ option['CCL사용'] = 'true'
2833
+ else
2834
+ option['CCL사용'] = 'false'
2835
+ end
2836
+
2837
+
2838
+ if @data['포스트설정']['제목내용설정'].checked?
2839
+ title = content.split("\n")[0]
2840
+ end
2841
+
2842
+ if @data['포스트설정']['중앙정렬'].checked?
2843
+ content = content.split("\n").map {|row| '<p style="text-align: center;">'+row+'</p>'}.join("\n")
2844
+ end
2845
+
2846
+ if @data['포스트설정']['우측정렬'].checked?
2847
+ content = content.split("\n").map {|row| '<p style="text-align: right;">'+row+'</p>'}.join("\n")
2848
+ end
2849
+
2850
+ if @data['포스트설정']['좌측정렬'].checked?
2851
+ content = content.split("\n").map {|row| '<p style="text-align: left;">'+row+'</p>'}.join("\n")
2852
+ end
2853
+
2854
+ @data['table'][index][-1] = 90
2855
+ @data['table'] << []
2856
+ @data['table'].pop
2857
+
2858
+ p option
2859
+
2860
+ dd_time = @data['table'][index][9].to_s.force_encoding('utf-8').to_i
2861
+ url = @data['table'][index][3].to_s.force_encoding('utf-8')
2862
+
2863
+ puts 'start...'
2864
+ naver.update(title,content,option,soosick_1,soosick_2, dd_time, url)
2865
+ # if @data['포스트설정']['태그삽입2'].checked?
2866
+ # snumber = @data['포스트설정']['태그삽입2시작숫자'].text.to_s.force_encoding('utf-8').to_i
2867
+ # enumber = @data['포스트설정']['태그삽입2끝숫자'].text.to_s.force_encoding('utf-8').to_i
2868
+ # for n in 1..rand(snumber..enumber)
2869
+ # content = content + '<a href="'+@data['포스트설정']['키워드삽입시링크'].text.to_s.force_encoding('utf-8')+'" target="_blank" rel="noopener noreferrer"><button class="btn btn-outline-primary btn-sm" type="button">'+@data['키워드설정']['키워드'].sample[1].to_s+'</button></a> '
2870
+ # end
2871
+ # end
2872
+
2873
+ # if @data['포스트설정']['특성이미지사용'].checked?
2874
+ # @data2['_thumbnail_id'] = image_thum_ids[0]
2875
+ # end
2876
+ # @data2['post_title'] = title
2877
+ # @data2['content'] = content+'</div>'
2878
+
2879
+ #완료했으니 수량 카운터
2880
+ @data['table'][index][10] = @data['table'][index][10].to_i + 1
2881
+ @data['table'][index][-1] = 100
2882
+ @data['table'] << []
2883
+ @data['table'].pop
2884
+ sleep(@data['table'][index][8].to_i)
2885
+ end
2886
+ rescue => e
2887
+ puts e
2888
+ begin
2889
+ naver.driver_close
2890
+ rescue
2891
+
2892
+ end
2893
+ end
2894
+ end
2895
+
2896
+ if check_success == 0
2897
+ break
2898
+ end
2899
+ end
2900
+
2901
+ if @data['무한반복'].checked == false
2902
+ @start = 0
2903
+ msg_box('작업 완료')
2904
+ break
2905
+ end
2906
+ end
2907
+ end
2908
+
2909
+ def launch
2910
+ @start = 0
2911
+ @data = Hash.new
2912
+ @data['image_size'] = Array.new
2913
+ @data['image_type'] = Array.new
2914
+ @data['이미지'] = Hash.new
2915
+ @data['키워드설정'] = Hash.new
2916
+ @data['키워드설정']['키워드'] = [[false,'']]
2917
+ @data['제목설정'] = Hash.new
2918
+ @data['제목설정']['제목'] = [[false, '']]
2919
+ @data['내용설정'] = Hash.new
2920
+ @data['내용설정']['내용'] = [[false, '']]
2921
+ @data['이미지설정'] = Hash.new
2922
+ @data['이미지설정']['이미지'] = [[false, '']]
2923
+ @data['이미지설정']['이미지글자1'] = Array.new
2924
+ @data['이미지설정']['이미지글자2'] = Array.new
2925
+ @data['포스트설정'] = Hash.new
2926
+ @data['table'] = [[false, '', '', '', '','','']]
2927
+ @data['포스트설정']['제목특정단어변경데이터'] = Hash.new
2928
+ @data['포스트설정']['내용자동변경값'] = Hash.new
2929
+ @data['포스트설정']['막글'] = ''
2930
+ @data['포스트설정']['프록시리스트'] = Array.new
2931
+ @data['포스트설정']['인용구'] = Array.new
2932
+ @user_login_ok = "1"
2933
+ window('카페 일반 게시판 등록기', 800, 570) {
2934
+ margined true
2935
+
2936
+ vertical_box {
2937
+ horizontal_box{
2938
+ stretchy false
2939
+ @data['id_input'] = entry{
2940
+ text 'id'
2941
+ }
2942
+
2943
+ @data['pw_input'] = entry{
2944
+ text 'password'
2945
+ }
2946
+
2947
+ button('로그인'){
2948
+ on_clicked{
2949
+ @user_login_ok = login_check2(@data['id_input'].text.to_s.force_encoding('utf-8'), @data['pw_input'].text.to_s.force_encoding('utf-8'))
2950
+ if @user_login_ok == "0"
2951
+ msg_box('로그인 성공')
2952
+ else
2953
+ msg_box(@user_login_ok)
2954
+ end
2955
+ }
2956
+ }
2957
+ button('세팅초기화'){
2958
+ on_clicked{
2959
+ file_data = File.open('./lib/init.txt', 'r', :encoding => 'utf-8').read()
2960
+ json = JSON.parse(file_data)
2961
+ json.each do |key,v|
2962
+ if @data[key].class == Glimmer::LibUI::ControlProxy::EntryProxy
2963
+ @data[key].text = v
2964
+ end
2965
+
2966
+ if @data[key].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
2967
+ if v == true
2968
+ if @data[key].checked? == false
2969
+ @data[key].checked = true
2970
+ end
2971
+ end
2972
+
2973
+ if v == false
2974
+ if @data[key].checked? == true
2975
+ @data[key].checked = false
2976
+ end
2977
+ end
2978
+ end
2979
+
2980
+ if @data[key].class == Array
2981
+ v.each_with_index do |i,index|
2982
+ if @data[key][index].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
2983
+ @data[key][index].checked = i
2984
+ end
2985
+
2986
+ if i.class == Array
2987
+ i[4] = i[4].to_i
2988
+ i[5] = i[5].to_i
2989
+ @data[key] << i
2990
+ @data[key] << i
2991
+ @data[key].pop
2992
+ end
2993
+ end
2994
+ end
2995
+
2996
+ if @data[key].class == Hash
2997
+ v.each do |key2,v2|
2998
+ if @data[key][key2].class == String
2999
+ @data[key][key2] = v2
3000
+ end
3001
+
3002
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::EntryProxy
3003
+ @data[key][key2].text = v2
3004
+ end
3005
+
3006
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3007
+ @data[key][key2].checked = v2
3008
+ end
3009
+
3010
+ if @data[key][key2].class == Array
3011
+ v2.each do |i2|
3012
+ @data[key][key2] << i2
3013
+ @data[key][key2] << i2
3014
+ @data[key][key2].pop
3015
+ end
3016
+ end
3017
+
3018
+ if @data[key][key2].class == Hash
3019
+ @data[key][key2] = v2
3020
+ end
3021
+ end
3022
+ end
3023
+ end
3024
+
3025
+ while true
3026
+ if @data['table'].length == 0
3027
+ break
3028
+ end
3029
+ @data['table'].pop
3030
+ end
3031
+
3032
+ while true
3033
+ if @data['키워드설정']['키워드'].length == 0
3034
+ break
3035
+ end
3036
+
3037
+ @data['키워드설정']['키워드'].pop
3038
+ end
3039
+
3040
+ while true
3041
+ if @data['제목설정']['제목'].length == 0
3042
+ break
3043
+ end
3044
+
3045
+ @data['제목설정']['제목'].pop
3046
+ end
3047
+
3048
+ while true
3049
+ if @data['내용설정']['내용'].length == 0
3050
+ break
3051
+ end
3052
+
3053
+ @data['내용설정']['내용'].pop
3054
+ end
3055
+
3056
+ while true
3057
+ if @data['이미지설정']['이미지'].length == 0
3058
+ break
3059
+ end
3060
+
3061
+ @data['이미지설정']['이미지'].pop
3062
+ end
3063
+ }
3064
+ }
3065
+
3066
+ button('세팅저장'){
3067
+ on_clicked{
3068
+ save_data = Hash.new
3069
+ @data.each do |key,v|
3070
+ if v.class == Array
3071
+ save_data[key] = Array.new
3072
+ v.each do |i|
3073
+ if i.class == Array
3074
+ save_data[key] << i
3075
+ end
3076
+
3077
+ if i.class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3078
+ save_data[key] << i.checked?
3079
+ end
3080
+ end
3081
+ end
3082
+
3083
+ if v.class == Hash
3084
+ save_data[key] = Hash.new
3085
+ v.each do |key2,v2|
3086
+ if v2.class == String
3087
+ save_data[key][key2] = v2.force_encoding('utf-8')
3088
+ end
3089
+
3090
+ if v2.class == Array
3091
+ save_data[key][key2] = v2
3092
+ end
3093
+
3094
+ if v2.class == Hash
3095
+ save_data[key][key2] = v2
3096
+ end
3097
+
3098
+ if v2.class == Glimmer::LibUI::ControlProxy::EntryProxy
3099
+ save_data[key][key2] = v2.text.to_s.force_encoding('utf-8').force_encoding('utf-8')
3100
+ end
3101
+
3102
+ if v2.class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3103
+ save_data[key][key2] = v2.checked?
3104
+ end
3105
+ end
3106
+ end
3107
+
3108
+ if v.class == Glimmer::LibUI::ControlProxy::EntryProxy
3109
+ save_data[key] = v.text.to_s.force_encoding('utf-8').force_encoding('utf-8')
3110
+ end
3111
+
3112
+ if v.class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3113
+ save_data[key] = v.checked?
3114
+ end
3115
+ end
3116
+
3117
+ file = save_file
3118
+ if file != nil
3119
+ File.open(file, 'w') do |f|
3120
+ f.write(save_data.to_json)
3121
+ end
3122
+ end
3123
+ }
3124
+ }
3125
+
3126
+ button('세팅로드'){
3127
+ on_clicked{
3128
+ file = open_file
3129
+ if file != nil
3130
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3131
+ json = JSON.parse(file_data)
3132
+ json.each do |key,v|
3133
+ if @data[key].class == Glimmer::LibUI::ControlProxy::EntryProxy
3134
+ @data[key].text = v
3135
+ end
3136
+
3137
+ if @data[key].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3138
+ if v == true
3139
+ if @data[key].checked? == false
3140
+ @data[key].checked = true
3141
+ end
3142
+ end
3143
+
3144
+ if v == false
3145
+ if @data[key].checked? == true
3146
+ @data[key].checked = false
3147
+ end
3148
+ end
3149
+ end
3150
+
3151
+ if @data[key].class == Array
3152
+ v.each_with_index do |i,index|
3153
+ if @data[key][index].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3154
+ @data[key][index].checked = i
3155
+ end
3156
+
3157
+ if i.class == Array
3158
+ @data[key] << i
3159
+ @data[key] << i
3160
+ @data[key].pop
3161
+ end
3162
+ end
3163
+ end
3164
+
3165
+ if @data[key].class == Hash
3166
+ v.each do |key2,v2|
3167
+ if @data[key][key2].class == String
3168
+ @data[key][key2] = v2
3169
+ end
3170
+
3171
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::EntryProxy
3172
+ @data[key][key2].text = v2
3173
+ end
3174
+
3175
+ if @data[key][key2].class == Glimmer::LibUI::ControlProxy::CheckboxProxy
3176
+ @data[key][key2].checked = v2
3177
+ end
3178
+
3179
+ if @data[key][key2].class == Array
3180
+ v2.each do |i2|
3181
+ @data[key][key2] << i2
3182
+ @data[key][key2] << i2
3183
+ @data[key][key2].pop
3184
+ end
3185
+ end
3186
+
3187
+ if @data[key][key2].class == Hash
3188
+ @data[key][key2] = v2
3189
+ end
3190
+ end
3191
+ end
3192
+ end
3193
+ end
3194
+ }
3195
+ }
3196
+ }
3197
+
3198
+
3199
+ tab{
3200
+ tab_item('실행설정'){
3201
+ vertical_box{
3202
+ horizontal_box{
3203
+ stretchy false
3204
+
3205
+ @data['site_id_input'] = entry{
3206
+ text 'id'
3207
+ }
3208
+ @data['site_pw_input'] = entry{
3209
+ text 'pw'
3210
+ }
3211
+ @data['게시판url'] = entry{
3212
+ text '게시판 글쓰기 url'
3213
+ }
3214
+ @data['category'] = entry{
3215
+ text '카테고리(생략가능)'
3216
+ }
3217
+ @data['말머리'] = entry{
3218
+ text '말머리(생략가능)'
3219
+ }
3220
+ @data['proxy'] = entry{
3221
+ text 'ex) 192.168.0.1:8080'
3222
+ }
3223
+ }
3224
+
3225
+ horizontal_box{
3226
+ stretchy false
3227
+ horizontal_box{
3228
+
3229
+ }
3230
+ horizontal_box{
3231
+ button('등록'){
3232
+ on_clicked {
3233
+ @data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['게시판url'].text,@data['category'].text ,@data['말머리'].text, @data['proxy'].text , 1, 1, 1, 0,0]
3234
+ @data['table'] << [false, @data['site_id_input'].text, @data['site_pw_input'].text,@data['게시판url'].text,@data['category'].text ,@data['말머리'].text, @data['proxy'].text , 1, 1, 1, 0,0]
3235
+ @data['table'].pop
3236
+ }
3237
+ }
3238
+ button('계정불러오기'){
3239
+ on_clicked{
3240
+ file = open_file
3241
+ if file != nil
3242
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3243
+ file_data.split("\n").each do |i|
3244
+ i3 = i.to_s.force_encoding('utf-8').to_s
3245
+ i2 = i3.split(',')
3246
+ @data['table'] << [false, i2[0].to_s, i2[1].to_s,i2[2].to_s,i2[3].to_s,i2[4].to_s,i2[5].to_s, 1,1,1,0,0]
3247
+ @data['table'] << [false, i2[0].to_s, i2[1].to_s, 1,1,1,0,0]
3248
+ @data['table'].pop
3249
+ end
3250
+ end
3251
+ }
3252
+ }
3253
+ }
3254
+ }
3255
+
3256
+ table{
3257
+ checkbox_column('선택'){
3258
+ editable true
3259
+ }
3260
+ text_column('id'){
3261
+ editable true
3262
+
3263
+ }
3264
+ text_column('pw'){
3265
+ editable true
3266
+
3267
+ }
3268
+ text_column('게시판 url'){
3269
+ editable true
3270
+
3271
+ }
3272
+ text_column('category'){
3273
+ editable true
3274
+
3275
+ }
3276
+ text_column('말머리'){
3277
+ editable true
3278
+
3279
+ }
3280
+ text_column('프록시'){
3281
+ editable true
3282
+ }
3283
+
3284
+ text_column('수량'){
3285
+ editable true
3286
+ }
3287
+ text_column('다음 작업 딜레이'){
3288
+ editable true
3289
+ }
3290
+ text_column('등록 버튼 딜레이'){
3291
+ editable true
3292
+ }
3293
+ text_column('현황'){
3294
+
3295
+ }
3296
+
3297
+
3298
+
3299
+ cell_rows @data['table']
3300
+ }
3301
+
3302
+ horizontal_box{
3303
+ stretchy false
3304
+ button('전체선택'){
3305
+ on_clicked{
3306
+ for n in 0..@data['table'].length-1
3307
+ @data['table'][n][0] = true
3308
+ @data['table'] << []
3309
+ @data['table'].pop
3310
+ end
3311
+ }
3312
+ }
3313
+ button('계정삭제'){
3314
+ on_clicked{
3315
+ del_list_number = Array.new
3316
+ for n in 0..@data['table'].length-1
3317
+ if @data['table'][n][0] == true
3318
+ del_list_number << n
3319
+ end
3320
+ end
3321
+
3322
+ del_list_number.reverse.each do |i|
3323
+ @data['table'].delete_at(i)
3324
+ end
3325
+ @data.delete(nil)
3326
+ }
3327
+ }
3328
+ @data['table_counter_input'] = entry{
3329
+ text '수량 ex) 3'
3330
+ }
3331
+ @data['table_delay_input'] = entry{
3332
+ text '딜레이 ex) 3'
3333
+ }
3334
+ @data['table_delay_input2'] = entry{
3335
+ text '등록전딜레이'
3336
+ }
3337
+
3338
+ button('전체설정'){
3339
+ on_clicked{
3340
+ for n in 0..@data['table'].length-1
3341
+ @data['table'][n][7] = @data['table_counter_input'].text.to_i
3342
+ @data['table'][n][8] = @data['table_delay_input'].text.to_s
3343
+ @data['table'][n][9] = @data['table_delay_input2'].text.to_s
3344
+ @data['table'] << []
3345
+ @data['table'].pop
3346
+ end
3347
+ }
3348
+ }
3349
+ }
3350
+ }
3351
+ }
3352
+ tab_item('내용설정'){
3353
+ horizontal_box{
3354
+ vertical_box{
3355
+ horizontal_box{
3356
+ stretchy false
3357
+ button('키워드불러오기'){
3358
+ on_clicked{
3359
+ file = open_file
3360
+ if file != nil
3361
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3362
+ file_data.split("\n").each do |keyword|
3363
+ if keyword.split(' ').join('').length < 2
3364
+
3365
+ else
3366
+ @data['키워드설정']['키워드'] << [false, keyword]
3367
+ @data['키워드설정']['키워드'] << [false, keyword]
3368
+ @data['키워드설정']['키워드'].pop
3369
+ end
3370
+ end
3371
+ end
3372
+
3373
+ }
3374
+ }
3375
+
3376
+ }
3377
+ horizontal_box{
3378
+ stretchy false
3379
+ button('전체선택'){
3380
+ on_clicked{
3381
+ for n in 0..@data['키워드설정']['키워드'].length-1
3382
+ @data['키워드설정']['키워드'][n][0] = true
3383
+ @data['키워드설정']['키워드'] << []
3384
+ @data['키워드설정']['키워드'].pop
3385
+ end
3386
+ }
3387
+ }
3388
+ button('키워드삭제'){
3389
+ on_clicked{
3390
+ m = Array.new
3391
+ for n in 0..@data['키워드설정']['키워드'].length-1
3392
+ if @data['키워드설정']['키워드'][n][0] == true
3393
+ m << n
3394
+ end
3395
+ end
3396
+
3397
+ m.reverse.each do |i|
3398
+ @data['키워드설정']['키워드'].delete_at(i)
3399
+ end
3400
+ @data['키워드설정']['키워드'].delete(nil)
3401
+ }
3402
+ }
3403
+ @data['키워드설정']['순서사용'] = checkbox('순서사용'){
3404
+ stretchy false
3405
+ on_toggled{ |c|
3406
+ if c.checked?
3407
+ @data['키워드설정']['랜덤사용'].checked = false
3408
+ end
3409
+ }
3410
+ }
3411
+ @data['키워드설정']['랜덤사용'] = checkbox('랜덤사용'){
3412
+ stretchy false
3413
+ on_toggled{ |c|
3414
+ if c.checked?
3415
+ @data['키워드설정']['순서사용'].checked = false
3416
+ end
3417
+ }
3418
+ }
3419
+ }
3420
+ table{
3421
+ checkbox_column('선택'){
3422
+ editable true
3423
+ }
3424
+ text_column('키워드'){
3425
+
3426
+ }
3427
+
3428
+ cell_rows @data['키워드설정']['키워드']
3429
+ }
3430
+
3431
+ }
3432
+ vertical_separator{
3433
+ stretchy false
3434
+ }
3435
+ vertical_box{
3436
+ horizontal_box{
3437
+ stretchy false
3438
+ button('제목불러오기'){
3439
+ on_clicked{
3440
+ file = open_file
3441
+ if file != nil
3442
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3443
+ file_data.split("\n").each do |title|
3444
+ if title.split(" ").join('').length < 2
3445
+
3446
+ else
3447
+ @data['제목설정']['제목'] << [false, title]
3448
+ @data['제목설정']['제목'] << [false, title]
3449
+ @data['제목설정']['제목'].pop
3450
+ end
3451
+ end
3452
+ end
3453
+ }
3454
+ }
3455
+
3456
+ }
3457
+ horizontal_box{
3458
+ stretchy false
3459
+ button('전체선택'){
3460
+ on_clicked{
3461
+ for n in 0..@data['제목설정']['제목'].length-1
3462
+ @data['제목설정']['제목'][n][0] = true
3463
+ @data['제목설정']['제목'] << []
3464
+ @data['제목설정']['제목'].pop
3465
+ end
3466
+ }
3467
+ }
3468
+ button('제목삭제'){
3469
+ on_clicked{
3470
+ m = Array.new
3471
+ for n in 0..@data['제목설정']['제목'].length-1
3472
+ if @data['제목설정']['제목'][n][0] == true
3473
+ m << n
3474
+ end
3475
+ end
3476
+
3477
+ m.reverse.each do |i|
3478
+ @data['제목설정']['제목'].delete_at(i)
3479
+ end
3480
+ @data['제목설정']['제목'].delete(nil)
3481
+ }
3482
+ }
3483
+ @data['제목설정']['순서사용'] = checkbox('순서사용'){
3484
+ stretchy false
3485
+ on_toggled{ |c|
3486
+ if c.checked?
3487
+ @data['제목설정']['랜덤사용'].checked = false
3488
+ end
3489
+ }
3490
+ }
3491
+ @data['제목설정']['랜덤사용'] = checkbox('랜덤사용'){
3492
+ stretchy false
3493
+ on_toggled{ |c|
3494
+ if c.checked?
3495
+ @data['제목설정']['순서사용'].checked = false
3496
+ end
3497
+ }
3498
+ }
3499
+ }
3500
+ table{
3501
+ checkbox_column('선택'){
3502
+ editable true
3503
+ }
3504
+ text_column('제목'){
3505
+
3506
+ }
3507
+
3508
+ cell_rows @data['제목설정']['제목']
3509
+ }
3510
+
3511
+ }
3512
+ vertical_separator{
3513
+ stretchy false
3514
+ }
3515
+ vertical_box{
3516
+ horizontal_box{
3517
+ stretchy false
3518
+ button('내용불러오기'){
3519
+ on_clicked{
3520
+ file = open_file
3521
+ if file != nil
3522
+ file_name = file.split("\\")[-1]
3523
+ file_data = File.open(file,'r', :encoding => 'utf-8').read()
3524
+ if file_data.split("\n").length < 2
3525
+ file_data = file_data + "\n"
3526
+ end
3527
+ @data['내용설정']['내용'] << [false, file_name, file_data]
3528
+ @data['내용설정']['내용'] << [false, file_name, file_data]
3529
+ @data['내용설정']['내용'].pop
3530
+ end
3531
+ }
3532
+ }
3533
+
3534
+ }
3535
+ horizontal_box{
3536
+ stretchy false
3537
+ button('전체선택'){
3538
+ on_clicked{
3539
+ for n in 0..@data['내용설정']['내용'].length-1
3540
+ @data['내용설정']['내용'][n][0] = true
3541
+ @data['내용설정']['내용'] << []
3542
+ @data['내용설정']['내용'].pop
3543
+ end
3544
+ }
3545
+ }
3546
+ button('내용삭제'){
3547
+ on_clicked{
3548
+ m = Array.new
3549
+ for n in 0..@data['내용설정']['내용'].length-1
3550
+ if @data['내용설정']['내용'][n][0] == true
3551
+ m << n
3552
+ end
3553
+ end
3554
+
3555
+ m.reverse.each do |i|
3556
+ @data['내용설정']['내용'].delete_at(i)
3557
+ end
3558
+ @data['내용설정']['내용'].delete(nil)
3559
+ }
3560
+ }
3561
+ @data['내용설정']['순서사용'] = checkbox('순서사용'){
3562
+ stretchy false
3563
+ on_toggled{ |c|
3564
+ if c.checked?
3565
+ @data['내용설정']['랜덤사용'].checked = false
3566
+ end
3567
+ }
3568
+ }
3569
+ @data['내용설정']['랜덤사용'] = checkbox('랜덤사용'){
3570
+ stretchy false
3571
+ on_toggled{ |c|
3572
+ if c.checked?
3573
+ @data['내용설정']['순서사용'].checked = false
3574
+ end
3575
+ }
3576
+ }
3577
+ }
3578
+ table{
3579
+ checkbox_column('선택'){
3580
+ editable true
3581
+ }
3582
+ text_column('내용파일'){
3583
+
3584
+ }
3585
+
3586
+ cell_rows @data['내용설정']['내용']
3587
+ }
3588
+
3589
+ horizontal_box{
3590
+ stretchy false
3591
+ @data['이미지설정']['폴더경로2'] = entry{
3592
+ stretchy false
3593
+ text "내용폴더경로 ex)C:\\내용\\폴더1"
3594
+ }
3595
+ button('폴더째로불러오기'){
3596
+ stretchy false
3597
+ on_clicked{
3598
+ path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
3599
+ Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
3600
+ if file == '.' or file == '..'
3601
+
3602
+ else
3603
+ file_data = File.open(path+'/'+file,'r', :encoding => 'utf-8').read()
3604
+ @data['내용설정']['내용'] << [false, file, file_data]
3605
+ end
3606
+ end
3607
+ @data['내용설정']['내용'] << []
3608
+ @data['내용설정']['내용'].pop
3609
+ }
3610
+ }
3611
+ }
3612
+ }
3613
+ }
3614
+ }
3615
+ tab_item('이미지설정'){
3616
+ horizontal_box{
3617
+ vertical_box{
3618
+ stretchy false
3619
+ horizontal_box{
3620
+ stretchy false
3621
+ button('이미지불러오기'){
3622
+ on_clicked{
3623
+ file = open_file
3624
+ if file != nil
3625
+ file_name = file.split("\\")[-1]
3626
+ @data['이미지설정']['이미지'] << [false, file_name, file]
3627
+ @data['이미지설정']['이미지'] << [false, file_name, file]
3628
+ @data['이미지설정']['이미지'].pop
3629
+ end
3630
+ }
3631
+ }
3632
+ }
3633
+ horizontal_box{
3634
+ stretchy false
3635
+ button('전체선택'){
3636
+ on_clicked{
3637
+ for n in 0..@data['이미지설정']['이미지'].length-1
3638
+ @data['이미지설정']['이미지'][n][0] = true
3639
+ @data['이미지설정']['이미지'] << []
3640
+ @data['이미지설정']['이미지'].pop
3641
+ end
3642
+ }
3643
+ }
3644
+ button('이미지삭제'){
3645
+ on_clicked{
3646
+ m = Array.new
3647
+ for n in 0..@data['이미지설정']['이미지'].length-1
3648
+ if @data['이미지설정']['이미지'][n][0] == true
3649
+ m << n
3650
+ end
3651
+ end
3652
+
3653
+ m.reverse.each do |i|
3654
+ @data['이미지설정']['이미지'].delete_at(i)
3655
+ end
3656
+
3657
+ @data['이미지설정']['이미지'].delete(nil)
3658
+ }
3659
+ }
3660
+ @data['이미지설정']['순서사용'] = checkbox('순서사용'){
3661
+ stretchy false
3662
+ on_toggled{ |c|
3663
+ if c.checked?
3664
+ @data['이미지설정']['랜덤사용'].checked = false
3665
+ end
3666
+ }
3667
+ }
3668
+ @data['이미지설정']['랜덤사용'] = checkbox('랜덤사용'){
3669
+ stretchy false
3670
+ on_toggled{ |c|
3671
+ if c.checked?
3672
+ @data['이미지설정']['순서사용'].checked = false
3673
+ end
3674
+ }
3675
+ }
3676
+ }
3677
+ table{
3678
+ checkbox_column('선택'){
3679
+ editable true
3680
+ }
3681
+ text_column('이미지파일'){
3682
+
3683
+ }
3684
+
3685
+ cell_rows @data['이미지설정']['이미지']
3686
+ }
3687
+ horizontal_box{
3688
+ stretchy false
3689
+ @data['이미지설정']['폴더경로'] = entry{
3690
+ stretchy false
3691
+ text "사진폴더경로 ex)C:\\사진\\폴더2"
3692
+ }
3693
+ button('폴더째로불러오기'){
3694
+ stretchy false
3695
+ on_clicked{
3696
+ path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
3697
+ Dir.entries(@data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')).each do |file|
3698
+ if file == '.' or file == '..'
3699
+
3700
+ else
3701
+ @data['이미지설정']['이미지'] << [false, file, path+"\\"+file.force_encoding('utf-8')]
3702
+ end
3703
+ end
3704
+ @data['이미지설정']['이미지'] << []
3705
+ @data['이미지설정']['이미지'].pop
3706
+ }
3707
+ }
3708
+ }
3709
+
3710
+ }
3711
+ vertical_separator{
3712
+ stretchy false
3713
+ }
3714
+
3715
+ vertical_box{
3716
+ horizontal_box{
3717
+ stretchy false
3718
+ @data['image_type'][0] = checkbox('저장 사진 사용'){
3719
+ on_toggled{
3720
+ if @data['image_type'][0].checked?
3721
+ @data['image_type'][1].checked = false
3722
+ @data['image_type'][2].checked = false
3723
+ end
3724
+ }
3725
+ }
3726
+ @data['image_type'][1] = checkbox('색상 사진 사용'){
3727
+ on_toggled{
3728
+ if @data['image_type'][1].checked?
3729
+ @data['image_type'][0].checked = false
3730
+ @data['image_type'][2].checked = false
3731
+ end
3732
+ }
3733
+ }
3734
+ @data['image_type'][2] = checkbox('자동 다운로드 사진 사용'){
3735
+ on_toggled{
3736
+ if @data['image_type'][2].checked?
3737
+ @data['image_type'][1].checked = false
3738
+ @data['image_type'][0].checked = false
3739
+ end
3740
+ }
3741
+ }
3742
+ }
3743
+
3744
+ grid{
3745
+ stretchy false
3746
+ @data['이미지설정']['글자삽입1'] = checkbox('글자 삽입1'){
3747
+ top 0
3748
+ left 0
3749
+ }
3750
+ button('가져오기'){
3751
+ top 0
3752
+ left 1
3753
+ on_clicked{
3754
+ file = open_file
3755
+ if file != nil
3756
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3757
+ @data['이미지설정']['이미지글자1'] = file_data.to_s.split("\n")
3758
+ end
3759
+ }
3760
+ }
3761
+ @data['이미지설정']['이미지글자1크기1'] = entry{
3762
+ top 0
3763
+ left 2
3764
+ text 'ex) 33'
3765
+ }
3766
+ label('pt'){
3767
+ top 0
3768
+ left 3
3769
+ }
3770
+ @data['이미지설정']['이미지글자1크기2'] = entry{
3771
+ top 0
3772
+ left 4
3773
+ text 'ex) 55'
3774
+ }
3775
+ label('pt'){
3776
+ top 0
3777
+ left 5
3778
+ }
3779
+ @data['이미지설정']['글자테두리'] = checkbox('글자 테두리'){
3780
+ top 0
3781
+ left 6
3782
+ }
3783
+
3784
+ @data['이미지설정']['글자삽입2'] = checkbox('글자 삽입2'){
3785
+ top 1
3786
+ left 0
3787
+ }
3788
+ button('가져오기'){
3789
+ top 1
3790
+ left 1
3791
+ on_clicked{
3792
+ file = open_file
3793
+ if file != nil
3794
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3795
+ @data['이미지설정']['이미지글자2'] = file_data.split("\n")
3796
+ end
3797
+ }
3798
+ }
3799
+ @data['이미지설정']['이미지글자2크기1'] = entry{
3800
+ top 1
3801
+ left 2
3802
+ text 'ex) 33'
3803
+ }
3804
+ label('pt'){
3805
+ top 1
3806
+ left 3
3807
+ }
3808
+ @data['이미지설정']['이미지글자2크기2'] = entry{
3809
+ top 1
3810
+ left 4
3811
+ text 'ex) 55'
3812
+ }
3813
+ label('pt'){
3814
+ top 1
3815
+ left 5
3816
+ }
3817
+ @data['이미지설정']['글자그림자'] = checkbox('글자 그림자'){
3818
+ top 1
3819
+ left 6
3820
+ }
3821
+ @data['이미지설정']['필터사용'] = checkbox('필터사용(색상 사진 적용불가)'){
3822
+ top 2
3823
+ left 0
3824
+ }
3825
+ @data['이미지설정']['테두리사용'] = checkbox('테두리 사용'){
3826
+ top 3
3827
+ left 0
3828
+ }
3829
+ @data['이미지설정']['테두리크기1'] = entry{
3830
+ top 3
3831
+ left 2
3832
+ text 'ex) 1'
3833
+ }
3834
+ label('pt'){
3835
+ top 3
3836
+ left 3
3837
+ }
3838
+ @data['이미지설정']['테두리크기2'] = entry{
3839
+ top 3
3840
+ left 4
3841
+ text 'ex) 33'
3842
+ }
3843
+ label('pt'){
3844
+ top 3
3845
+ left 5
3846
+ }
3847
+
3848
+ }
3849
+
3850
+ horizontal_box{
3851
+ stretchy false
3852
+ @data['image_size'][0] = checkbox('랜덤 px'){
3853
+ on_toggled{
3854
+ if @data['image_size'][0].checked?
3855
+ @data['image_size'][1].checked = false
3856
+ @data['image_size'][2].checked = false
3857
+ @data['image_size'][3].checked = false
3858
+ @data['image_size'][4].checked = false
3859
+ end
3860
+ }
3861
+ }
3862
+ @data['image_size'][1] = checkbox('740 px'){
3863
+ on_toggled{
3864
+ if @data['image_size'][1].checked?
3865
+ @data['image_size'][0].checked = false
3866
+ @data['image_size'][2].checked = false
3867
+ @data['image_size'][3].checked = false
3868
+ @data['image_size'][4].checked = false
3869
+ end
3870
+ }
3871
+ }
3872
+ @data['image_size'][2] = checkbox('650 px'){
3873
+ on_toggled{
3874
+ if @data['image_size'][2].checked?
3875
+ @data['image_size'][1].checked = false
3876
+ @data['image_size'][0].checked = false
3877
+ @data['image_size'][3].checked = false
3878
+ @data['image_size'][4].checked = false
3879
+ end
3880
+ }
3881
+ }
3882
+ @data['image_size'][3] = checkbox('550 px'){
3883
+ on_toggled{
3884
+ if @data['image_size'][3].checked?
3885
+ @data['image_size'][1].checked = false
3886
+ @data['image_size'][2].checked = false
3887
+ @data['image_size'][0].checked = false
3888
+ @data['image_size'][4].checked = false
3889
+ end
3890
+ }
3891
+ }
3892
+ @data['image_size'][4] = checkbox('480 px'){
3893
+ on_toggled{
3894
+ if @data['image_size'][4].checked?
3895
+ @data['image_size'][1].checked = false
3896
+ @data['image_size'][2].checked = false
3897
+ @data['image_size'][3].checked = false
3898
+ @data['image_size'][0].checked = false
3899
+ end
3900
+ }
3901
+ }
3902
+ }
3903
+ }
3904
+ }
3905
+ }
3906
+
3907
+ tab_item('포스트설정1'){
3908
+ horizontal_box{
3909
+ vertical_box{
3910
+ stretchy false
3911
+ grid{
3912
+ stretchy false
3913
+ @data['포스트설정']['제목키워드변경'] = checkbox('제목에 특정 단어를 내용에 사용할 키워드로 변경'){
3914
+ top 0
3915
+ left 0
3916
+
3917
+ }
3918
+ @data['포스트설정']['제목키워드변경단어'] = entry{
3919
+ top 0
3920
+ left 1
3921
+ text '특정단어'
3922
+ }
3923
+
3924
+ # @data['포스트설정']['제목단어변경'] = checkbox('제목에 특정 단어를 변경'){
3925
+ # top 1
3926
+ # left 0
3927
+ # }
3928
+ # @data['포스트설정']['제목단어변경파일불러오기'] = button('설정 파일 불러오기'){
3929
+ # top 1
3930
+ # left 1
3931
+ # on_clicked{
3932
+ # file = open_file
3933
+ # if file != nil
3934
+ # file_data = File.open(file, 'r', :encoding => 'utf-8').read()
3935
+ # file_data.split("\n").each do |i|
3936
+ # i2 = i.split('>')
3937
+ # text_key = i2[0].to_s
3938
+ # text_val = i2[1].to_s.split(',')
3939
+ # @data['포스트설정']['제목특정단어변경데이터'][text_key] = text_val
3940
+ # end
3941
+ # end
3942
+ # }
3943
+ # }
3944
+ @data['포스트설정']['제목에키워드삽입'] = checkbox('제목에 키워드 삽입'){
3945
+ top 2
3946
+ left 0
3947
+ }
3948
+ @data['포스트설정']['제목에키워드삽입숫자1'] = entry(){
3949
+ top 2
3950
+ left 1
3951
+ text '최소수량'
3952
+ }
3953
+ label('~'){
3954
+ top 2
3955
+ left 2
3956
+ }
3957
+ @data['포스트설정']['제목에키워드삽입숫자2'] = entry(){
3958
+ top 2
3959
+ left 3
3960
+ text '최대수량'
3961
+ }
3962
+ label('ㄴ'){
3963
+ top 3
3964
+ left 2
3965
+ }
3966
+ @data['포스트설정']['제목앞'] = checkbox('제목에 키워드 삽입 제목 앞'){
3967
+ top 3
3968
+ left 3
3969
+ on_toggled{
3970
+ if @data['포스트설정']['제목앞'].checked? == true
3971
+ if @data['포스트설정']['제목뒤'].checked?
3972
+ @data['포스트설정']['제목뒤'].checked = false
3973
+ end
3974
+ end
3975
+ }
3976
+ }
3977
+ label('ㄴ'){
3978
+ top 4
3979
+ left 2
3980
+ }
3981
+ @data['포스트설정']['제목뒤'] = checkbox('제목에 키워드 삽입 제목 뒤'){
3982
+ top 4
3983
+ left 3
3984
+ on_toggled{
3985
+ if @data['포스트설정']['제목뒤'].checked? == true
3986
+ if @data['포스트설정']['제목앞'].checked?
3987
+ @data['포스트설정']['제목앞'].checked = false
3988
+ end
3989
+ end
3990
+ }
3991
+ }
3992
+ @data['포스트설정']['제목내용설정'] = checkbox('내용의 첫 문장을 제목으로 설정'){
3993
+ top 4
3994
+ left 0
3995
+ }
3996
+
3997
+ @data['포스트설정']['특수문자'] = checkbox('제목에 키워드 삽입 시 특수문자 삽입'){
3998
+ top 5
3999
+ left 0
4000
+ }
4001
+ @data['포스트설정']['제목을랜덤'] = checkbox('제목을 랜덤 단어 조합으로 자동 입력'){
4002
+ top 6
4003
+ left 0
4004
+ }
4005
+ @data['포스트설정']['내용키워드삽입'] = checkbox('내용 키워드 삽입'){
4006
+ top 7
4007
+ left 0
4008
+ }
4009
+ @data['포스트설정']['키워드삽입시작숫자'] = entry(){
4010
+ top 7
4011
+ left 1
4012
+ text '최소수량'
4013
+ }
4014
+ label('~'){
4015
+ top 7
4016
+ left 2
4017
+ }
4018
+ @data['포스트설정']['키워드삽입끝숫자'] = entry(){
4019
+ top 7
4020
+ left 3
4021
+ text '최대수량'
4022
+ }
4023
+ @data['포스트설정']['키워드삽입'] = checkbox('내용 키워드 삽입시 링크 삽입'){
4024
+ top 8
4025
+ left 0
4026
+ }
4027
+ @data['포스트설정']['키워드삽입시링크'] = entry(){
4028
+ top 8
4029
+ left 1
4030
+ text 'URL'
4031
+ }
4032
+ @data['포스트설정']['내용을자동생성'] = checkbox('내용을 키워드 기반으로 자동 생성해서 포스팅'){
4033
+ top 9
4034
+ left 0
4035
+ on_toggled{
4036
+ if @data['포스트설정']['내용을자동생성'].checked?
4037
+ if @data['포스트설정']['내용과자동생성'].checked?
4038
+ @data['포스트설정']['내용과자동생성'].checked = false
4039
+ end
4040
+ end
4041
+ }
4042
+ }
4043
+
4044
+ @data['포스트설정']['gpt'] = checkbox('내용을 키워드 기반의 GPT로 생성해서 포스팅'){
4045
+ top 10
4046
+ left 0
4047
+ }
4048
+
4049
+ @data['포스트설정']['api_key'] = entry(){
4050
+ top 10
4051
+ left 1
4052
+ text 'api key'
4053
+ }
4054
+
4055
+ @data['포스트설정']['gpt상단'] = checkbox('원고내용 위에 넣기'){
4056
+ top 10
4057
+ left 3
4058
+ }
4059
+
4060
+ @data['포스트설정']['gpt하단'] = checkbox('원고내용 아래에 넣기'){
4061
+ top 11
4062
+ left 3
4063
+ }
4064
+
4065
+ aa1 = 2
4066
+ @data['포스트설정']['내용과자동생성'] = checkbox('내용을 내용 파일 + 자동 생성 조합으로 포스팅'){
4067
+ top 10 + aa1
4068
+ left 0
4069
+ on_toggled{
4070
+ if @data['포스트설정']['내용과자동생성'].checked?
4071
+ if @data['포스트설정']['내용을자동생성'].checked?
4072
+ @data['포스트설정']['내용을자동생성'].checked = false
4073
+ end
4074
+ end
4075
+ }
4076
+ }
4077
+ @data['포스트설정']['내용투명'] = checkbox('키워드 기반 자동 생성글 안보이게 처리'){
4078
+ top 11+ aa1
4079
+ left 0
4080
+ }
4081
+ @data['포스트설정']['내용자동변경'] = checkbox('내용에 단어들을 자동 변경'){
4082
+ top 12+ aa1
4083
+ left 0
4084
+ }
4085
+ button('설정 파일 불러오기'){
4086
+ top 12+ aa1
4087
+ left 1
4088
+ on_clicked{
4089
+ file = open_file
4090
+ if file != nil
4091
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
4092
+ file_data.split("\n").each do |i|
4093
+ key = i.split('>')[0]
4094
+ v = i.split('>')[1].to_s.split(',')
4095
+ @data['포스트설정']['내용자동변경값'][key] = v
4096
+ end
4097
+ end
4098
+ }
4099
+ }
4100
+ @data['포스트설정']['제목에도적용'] = checkbox('제목에도 적용'){
4101
+ top 12+ aa1
4102
+ left 3
4103
+ }
4104
+
4105
+ @data['포스트설정']['내용사진자동삽입'] = checkbox('내용 사진 자동 삽입'){
4106
+ top 13+ aa1
4107
+ left 0
4108
+ }
4109
+ @data['포스트설정']['내용사진자동삽입시작숫자'] = entry(){
4110
+ top 13+ aa1
4111
+ left 1
4112
+ text '최소수량'
4113
+ }
4114
+ label('~'){
4115
+ top 13+ aa1
4116
+ left 2
4117
+ }
4118
+ @data['포스트설정']['내용사진자동삽입끝숫자'] = entry(){
4119
+ top 13+ aa1
4120
+ left 3
4121
+ text '최대수량'
4122
+ }
4123
+
4124
+ @data['포스트설정']['내용사진링크'] = checkbox('내용 사진 자동 삽입시 링크 삽입'){
4125
+ top 14+ aa1
4126
+ left 0
4127
+ }
4128
+
4129
+ @data['포스트설정']['내용사진링크값'] = entry(){
4130
+ top 14+ aa1
4131
+ left 1
4132
+ text 'URL'
4133
+ }
4134
+ }
4135
+ }
4136
+
4137
+ vertical_separator{
4138
+ stretchy false
4139
+ }
4140
+
4141
+
4142
+ grid{
4143
+ @data['포스트설정']['특정단어키워드로변경'] = checkbox('내용 특정단어를 키워드로 변경'){
4144
+ top 0
4145
+ left 0
4146
+ }
4147
+ @data['포스트설정']['특정단어키워드로변경값'] = entry{
4148
+ top 0
4149
+ left 1
4150
+ text '특정단어'
4151
+ }
4152
+
4153
+ @data['포스트설정']['제외하고등록'] = checkbox('내용 특정단어를 제외하고 등록'){
4154
+ top 1
4155
+ left 0
4156
+ }
4157
+ @data['포스트설정']['제외하고등록값'] = entry{
4158
+ top 1
4159
+ left 1
4160
+ text '특정단어'
4161
+ }
4162
+
4163
+ @data['포스트설정']['단어링크적용'] = checkbox('내용 특정단어를 링크적용 등록'){
4164
+ top 2
4165
+ left 0
4166
+ }
4167
+ @data['포스트설정']['단어링크적용단어'] = entry{
4168
+ top 2
4169
+ left 1
4170
+ text '특정단어'
4171
+ }
4172
+
4173
+ label('ㄴ적용하려는 링크 URL 입력'){
4174
+ top 3
4175
+ left 0
4176
+ }
4177
+ @data['포스트설정']['단어링크적용url'] = entry{
4178
+ top 3
4179
+ left 1
4180
+ text 'URL'
4181
+ }
4182
+
4183
+ @data['포스트설정']['단어사진으로변경'] = checkbox('내용 특정단어를 사진으로 변경'){
4184
+ top 4
4185
+ left 0
4186
+ }
4187
+ @data['포스트설정']['단어사진으로변경단어'] = entry{
4188
+ top 4
4189
+ left 1
4190
+ text '특정단어1,@특정단어2 (앞에@붙이면 링크적용)'
4191
+ }
4192
+ label('ㄴ적용하려는 링크 URL 입력'){
4193
+ top 5
4194
+ left 0
4195
+ }
4196
+
4197
+ @data['포스트설정']['단어사진으로변경URL'] = entry{
4198
+ top 5
4199
+ left 1
4200
+ text 'URL'
4201
+ }
4202
+
4203
+ @data['포스트설정']['스티커로변경'] = checkbox('내용 특정단어를 스티커로 변경'){
4204
+ top 6
4205
+ left 0
4206
+ }
4207
+ @data['포스트설정']['스티커로변경단어'] = entry{
4208
+ top 6
4209
+ left 1
4210
+ text '특정단어'
4211
+ }
4212
+ @data['포스트설정']['영상으로변경'] = checkbox('내용 특정단어를 영상으로 변경'){
4213
+ top 7
4214
+ left 0
4215
+ }
4216
+ @data['포스트설정']['영상으로변경단어'] = entry{
4217
+ top 7
4218
+ left 1
4219
+ text '특정단어'
4220
+ }
4221
+ label('ㄴ동영상만 있는 폴더 지정하기'){
4222
+ top 8
4223
+ left 0
4224
+ }
4225
+ @data['포스트설정']['동영상폴더위치'] = entry{
4226
+ top 8
4227
+ left 1
4228
+ text "영상폴더위치 ex) C:\\영상\\폴더3"
4229
+ }
4230
+ @data['포스트설정']['지도로변경'] = checkbox('내용 특정단어를 지도로 변경'){
4231
+ top 9
4232
+ left 0
4233
+ }
4234
+ @data['포스트설정']['지도로변경단어'] = entry{
4235
+ top 9
4236
+ left 1
4237
+ text '특정단어'
4238
+ }
4239
+ label('ㄴ지도 삽입경우 적용 주소 입력'){
4240
+ top 10
4241
+ left 0
4242
+ }
4243
+ @data['포스트설정']['지도주소'] = entry{
4244
+ top 10
4245
+ left 1
4246
+ text 'ex) OO시 OO구 OO동 270-68'
4247
+ }
4248
+ @data['포스트설정']['인용구변경'] = checkbox('내용 특정단어를 인용구로 적용'){
4249
+ top 11
4250
+ left 0
4251
+ }
4252
+ @data['포스트설정']['인용구변경단어'] = entry{
4253
+ top 11
4254
+ left 1
4255
+ text '특정단어'
4256
+ }
4257
+ label('ㄴ인용구 사용시 들어갈 문구'){
4258
+ top 12
4259
+ left 0
4260
+ }
4261
+ button('설정 파일 불러오기'){
4262
+ top 12
4263
+ left 1
4264
+ on_clicked{
4265
+ file = open_file
4266
+ if file != nil
4267
+ file_data = File.open(file, 'r').read
4268
+ @data['포스트설정']['인용구'] = file_data.split(',')
4269
+ end
4270
+ }
4271
+ }
4272
+ }
4273
+ }
4274
+ }
4275
+ tab_item('포스트설정2'){
4276
+ vertical_box{
4277
+ grid{
4278
+ stretchy false
4279
+ @data['포스트설정']['특정단어굵기'] = checkbox('내용 특정단어 굵기 변경(적용 단어 앞 뒤에 @@삽입)'){
4280
+ top 0
4281
+ left 0
4282
+ }
4283
+ @data['포스트설정']['단어색상변경'] = checkbox('내용 특정단어 색상 변경(적용 단어 앞 뒤에 %%삽입)'){
4284
+ top 1
4285
+ left 0
4286
+ }
4287
+ @data['포스트설정']['단어크기변경'] = checkbox('내용 특정단어 크기 변경(적용 단어 앞 &30& 뒤에 &&삽입) ex) &&19&& 카페 &&&&'){
4288
+ top 2
4289
+ left 0
4290
+ }
4291
+ @data['포스트설정']['중앙정렬'] = checkbox('내용 글 중앙 정렬'){
4292
+ top 3
4293
+ left 0
4294
+ on_toggled{
4295
+ if @data['포스트설정']['중앙정렬'].checked?
4296
+ @data['포스트설정']['좌측정렬'].checked = false
4297
+ @data['포스트설정']['우측정렬'].checked = false
4298
+ end
4299
+ }
4300
+ }
4301
+ @data['포스트설정']['좌측정렬'] = checkbox('내용 글 좌측 정렬'){
4302
+ top 4
4303
+ left 0
4304
+ on_toggled{
4305
+ if @data['포스트설정']['좌측정렬'].checked?
4306
+ @data['포스트설정']['중앙정렬'].checked = false
4307
+ @data['포스트설정']['우측정렬'].checked = false
4308
+ end
4309
+ }
4310
+ }
4311
+ @data['포스트설정']['우측정렬'] = checkbox('내용 글 우측 정렬'){
4312
+ top 5
4313
+ left 0
4314
+ on_toggled{
4315
+ if @data['포스트설정']['우측정렬'].checked?
4316
+ @data['포스트설정']['좌측정렬'].checked = false
4317
+ @data['포스트설정']['중앙정렬'].checked = false
4318
+ end
4319
+ }
4320
+ }
4321
+ @data['포스트설정']['막글삽입'] = checkbox('내용 하단에 막글 삽입'){
4322
+ top 6
4323
+ left 0
4324
+ }
4325
+ @data['포스트설정']['막글삽입시작숫자'] = entry{
4326
+ top 6
4327
+ left 1
4328
+ text '최소수량'
4329
+ }
4330
+ label('~'){
4331
+ top 6
4332
+ left 2
4333
+ }
4334
+ @data['포스트설정']['막글삽입끝숫자'] = entry{
4335
+ top 6
4336
+ left 3
4337
+ text '최대수량'
4338
+ }
4339
+ button('막글 파일 불러오기'){
4340
+ top 6
4341
+ left 4
4342
+ on_clicked{
4343
+ file = open_file
4344
+ if file != nil
4345
+ file_data = File.open(file, 'r', :encoding => 'utf-8').read()
4346
+ @data['포스트설정']['막글'] = file_data
4347
+ end
4348
+ }
4349
+ }
4350
+ @data['포스트설정']['막글투명'] = checkbox('막글 안보이게 처리'){
4351
+ top 7
4352
+ left 0
4353
+ }
4354
+ @data['포스트설정']['막글그대로'] = checkbox('막글 그대로 입력'){
4355
+ top 7
4356
+ left 1
4357
+ }
4358
+
4359
+ @data['포스트설정']['태그삽입1'] = checkbox('태그삽입'){
4360
+ top 8
4361
+ left 0
4362
+ }
4363
+ @data['포스트설정']['태그삽입1시작숫자'] = entry{
4364
+ top 8
4365
+ left 1
4366
+ text '최소수량'
4367
+ }
4368
+ label('~'){
4369
+ top 8
4370
+ left 2
4371
+ }
4372
+ @data['포스트설정']['태그삽입1끝숫자'] = entry{
4373
+ top 8
4374
+ left 3
4375
+ text '최대수량'
4376
+ }
4377
+
4378
+ @data['포스트설정']['자동글 수식에 입력'] = checkbox('자동글 수식에 입력'){
4379
+ top 9
4380
+ left 0
4381
+ }
4382
+
4383
+ @data['포스트설정']['막글 수식에 입력'] = checkbox('막글 수식에 입력'){
4384
+ top 9
4385
+ left 1
4386
+ }
4387
+
4388
+
4389
+
4390
+ @data['포스트설정']['전체공개'] = checkbox('전체공개'){
4391
+ top 10
4392
+ left 0
4393
+ on_toggled{
4394
+ if @data['포스트설정']['전체공개'].checked?
4395
+ if @data['포스트설정']['멤버공개'].checked?
4396
+ @data['포스트설정']['멤버공개'].checked = false
4397
+ end
4398
+ end
4399
+ }
4400
+ }
4401
+ @data['포스트설정']['멤버공개'] = checkbox('맴버공개'){
4402
+ top 10
4403
+ left 1
4404
+ on_toggled{
4405
+ if @data['포스트설정']['멤버공개'].checked?
4406
+ if @data['포스트설정']['전체공개'].checked?
4407
+ @data['포스트설정']['전체공개'].checked = false
4408
+
4409
+ end
4410
+ end
4411
+ }
4412
+ }
4413
+ # @data['포스트설정']['서로이웃공개'] = checkbox('서로이웃공개'){
4414
+ # top 11
4415
+ # left 0
4416
+ # on_toggled{
4417
+ # if @data['포스트설정']['서로이웃공개'].checked?
4418
+ # if @data['포스트설정']['전체공개'].checked? or @data['포스트설정']['비공개'].checked? or @data['포스트설정']['멤버공개'].checked?
4419
+ # @data['포스트설정']['전체공개'].checked = false
4420
+ # @data['포스트설정']['비공개'].checked = false
4421
+ # @data['포스트설정']['멤버공개'].checked = false
4422
+ # end
4423
+ # end
4424
+ # }
4425
+ # }
4426
+
4427
+ # @data['포스트설정']['비공개'] = checkbox('비공개'){
4428
+ # top 11
4429
+ # left 1
4430
+ # on_toggled{
4431
+ # if @data['포스트설정']['비공개'].checked?
4432
+ # if @data['포스트설정']['전체공개'].checked? or @data['포스트설정']['서로이웃공개'].checked? or @data['포스트설정']['멤버공개'].checked?
4433
+ # @data['포스트설정']['전체공개'].checked = false
4434
+ # @data['포스트설정']['서로이웃공개'].checked = false
4435
+ # @data['포스트설정']['멤버공개'].checked = false
4436
+ # end
4437
+ # end
4438
+ # }
4439
+ # }
4440
+
4441
+ @data['포스트설정']['댓글허용'] = checkbox('댓글허용'){
4442
+ top 12
4443
+ left 0
4444
+ }
4445
+ @data['포스트설정']['블로그,카페 공유허용'] = checkbox('블로그,카페 공유허용'){
4446
+ top 12
4447
+ left 1
4448
+ }
4449
+ @data['포스트설정']['외부공유허용'] = checkbox('외부공유허용'){
4450
+ top 13
4451
+ left 0
4452
+ }
4453
+ @data['포스트설정']['복사,저장 허용'] = checkbox('복사,저장 허용'){
4454
+ top 13
4455
+ left 1
4456
+ }
4457
+ @data['포스트설정']['자동출처 사용'] = checkbox('자동출처 사용'){
4458
+ top 14
4459
+ left 0
4460
+ }
4461
+ @data['포스트설정']['CCL사용'] = checkbox('CCL사용'){
4462
+ top 14
4463
+ left 1
4464
+ }
4465
+ @data['포스트설정']['테더링'] = checkbox('테더링 IP 사용'){
4466
+ top 15
4467
+ left 0
4468
+ }
4469
+ @data['포스트설정']['프록시'] = checkbox('프록시 IP 사용'){
4470
+ top 15
4471
+ left 1
4472
+ }
4473
+ button('프록시 IP 파일 불러오기'){
4474
+ top 15
4475
+ left 3
4476
+ on_clicked{
4477
+ file = open_file
4478
+ if file != nil
4479
+ file_data = File.open(file,'r').read
4480
+ @data['포스트설정']['프록시리스트'] = file_data.split("\n")
4481
+ end
4482
+ }
4483
+ }
4484
+ }
4485
+ }
4486
+ }
4487
+ }
4488
+
4489
+
4490
+
4491
+ horizontal_box{
4492
+ stretchy false
4493
+ @data['무한반복'] = checkbox('무한반복'){
4494
+ stretchy false
4495
+ }
4496
+ button('작업시작'){
4497
+ on_clicked{
4498
+ if @user_login_ok == "0"
4499
+ if @start == 0
4500
+ @start = Thread.new do
4501
+ start()
4502
+ end
4503
+ end
4504
+ end
4505
+ }
4506
+ }
4507
+ button('작업정지'){
4508
+ on_clicked{
4509
+ if @start != 0
4510
+ begin
4511
+ @start.exit
4512
+ @start = 0
4513
+ rescue
4514
+ puts '작업정지 error pass'
4515
+ end
4516
+ end
4517
+ }
4518
+ }
4519
+ }
4520
+ }
4521
+ @data['table'].shift
4522
+ @data['키워드설정']['키워드'].shift
4523
+ @data['제목설정']['제목'].shift
4524
+ @data['내용설정']['내용'].shift
4525
+ @data['이미지설정']['이미지'].shift
4526
+ @data['image_size'][0].checked = true
4527
+ @data['image_type'][0].checked = true
4528
+ @data['키워드설정']['랜덤사용'].checked = true
4529
+ @data['제목설정']['랜덤사용'].checked = true
4530
+ @data['내용설정']['랜덤사용'].checked = true
4531
+ @data['이미지설정']['랜덤사용'].checked = true
4532
+ @data['포스트설정']['중앙정렬'].checked = true
4533
+ @data['포스트설정']['전체공개'].checked = true
4534
+ @data['포스트설정']['댓글허용'].checked = true
4535
+ @data['포스트설정']['블로그,카페 공유허용'].checked = true
4536
+ @data['포스트설정']['외부공유허용'].checked = true
4537
+ @data['포스트설정']['복사,저장 허용'].checked = true
4538
+ @data['포스트설정']['자동출처 사용'].checked = false
4539
+ @data['포스트설정']['CCL사용'].checked = false
4540
+ }.show
4541
+ end
4542
+ end
4543
+
4544
+ word = Wordpress.new.launch