diff --git a/Gemfile b/Gemfile index fa27e43c..056f2616 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ gem 'bootsnap', require: false gem 'coffee-rails' gem 'devise' gem 'draper' -gem 'google-cloud-storage' # }}} # h,i,j,k,l,m,n {{{ gem 'kaminari' @@ -39,7 +38,6 @@ gem 'sinatra' gem 'slim-rails' gem 'ts_routes' gem 'turbolinks' -gem 'twitter' # }}} # v,w,x,y,z {{{ gem 'webpacker' diff --git a/Gemfile.lock b/Gemfile.lock index 56bf0f93..3d0e5b4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,7 +84,6 @@ GEM bindex (0.8.1) bootsnap (1.13.0) msgpack (~> 1.2) - buftok (0.2.0) builder (3.2.4) bullet (7.0.3) activesupport (>= 3.0.0) @@ -112,7 +111,6 @@ GEM crack (0.4.5) rexml crass (1.0.6) - declarative (0.0.20) devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -121,11 +119,7 @@ GEM warden (~> 1.2.3) diff-lcs (1.5.0) digest (3.1.0) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) draper (4.0.2) actionpack (>= 5.0) activemodel (>= 5.0) @@ -133,7 +127,6 @@ GEM activesupport (>= 5.0) request_store (>= 1.0) ruby2_keywords - equalizer (0.0.11) erubi (1.11.0) et-orbi (1.2.7) tzinfo @@ -148,62 +141,13 @@ GEM ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.0) ffi (1.17.0) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) - rake fugit (1.7.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) globalid (1.0.0) activesupport (>= 5.0) - google-apis-core (0.9.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.14.0) - google-apis-core (>= 0.7.2, < 2.a) - google-apis-storage_v1 (0.17.0) - google-apis-core (>= 0.7, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.41.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.17.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.2.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) hashdiff (1.0.1) hashie (5.0.0) - http (4.4.1) - addressable (~> 2.3) - http-cookie (~> 1.0) - http-form_data (~> 2.2) - http-parser (~> 1.2.0) - http-cookie (1.0.5) - domain_name (~> 0.5) - http-form_data (2.3.0) - http-parser (1.2.3) - ffi-compiler (>= 1.0, < 2.0) - http_parser.rb (0.6.0) - httpclient (2.8.3) i18n (1.12.0) concurrent-ruby (~> 1.0) json (2.6.2) @@ -231,21 +175,15 @@ GEM mini_mime (>= 0.1.1) marcel (1.0.2) matrix (0.4.2) - memoist (0.16.2) - memoizable (0.4.2) - thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) mini_magick (4.11.0) mini_mime (1.1.5) mini_portile2 (2.8.4) minitest (5.16.3) msgpack (1.5.6) - multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.2.3) mustermann (2.0.2) ruby2_keywords (~> 0.0.1) - naught (1.1.0) nested_form (0.3.2) net-imap (0.2.3) digest @@ -288,7 +226,6 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) - os (1.1.4) parallel (1.22.1) parser (3.1.2.1) ast (~> 2.4.1) @@ -367,16 +304,11 @@ GEM tilt redis (4.8.0) regexp_parser (2.8.2) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) request_store (1.5.1) rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) - retriable (3.1.2) rexml (3.2.6) rolify (6.0.1) rspec-core (3.11.0) @@ -453,12 +385,6 @@ GEM sidekiq-prometheus-exporter (0.1.17) rack (>= 1.6.0) sidekiq (>= 3.3.1) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simple_oauth (0.3.1) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) @@ -493,10 +419,8 @@ GEM strscan (3.0.4) temple (0.8.2) thor (1.2.1) - thread_safe (0.3.6) tilt (2.0.11) timeout (0.3.0) - trailblazer-option (0.1.2) ts_routes (1.0.3) railties (>= 4.0) turbo-rails (1.1.1) @@ -506,23 +430,8 @@ GEM turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - twitter (7.0.0) - addressable (~> 2.3) - buftok (~> 0.2.0) - equalizer (~> 0.0.11) - http (~> 4.0) - http-form_data (~> 2.0) - http_parser.rb (~> 0.6.0) - memoizable (~> 0.4.0) - multipart-post (~> 2.0) - naught (~> 1.0) - simple_oauth (~> 0.3.0) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) unicode-display_width (2.3.0) uniform_notifier (1.16.0) vcr (6.1.0) @@ -547,7 +456,6 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - webrick (1.7.0) websocket (1.2.10) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) @@ -569,7 +477,6 @@ DEPENDENCIES devise draper factory_bot_rails - google-cloud-storage json_expressions kaminari listen @@ -610,7 +517,6 @@ DEPENDENCIES spring-commands-rspec ts_routes turbolinks - twitter vcr web-console webdrivers diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index c8c3e352..510d9b27 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -16,7 +16,7 @@ def create Slack::MessageDispatcher.send(message.id) flash[:notice] = '承りました。対応はしばしお待ちください。' else - flash[:danger] = '何らかの不具合で送信できていません。Twitterなどにご連絡下さい。' + flash[:danger] = '何らかの不具合で送信できていません。Xなどにご連絡下さい。' end redirect_to root_path end diff --git a/app/views/messages/new.html.slim b/app/views/messages/new.html.slim index a9c8d63f..f4e6e771 100644 --- a/app/views/messages/new.html.slim +++ b/app/views/messages/new.html.slim @@ -8,10 +8,10 @@ section.accordions button.toggle aria-label='toggle' .accordion-body .accordion-content - p 以下の手順でTwitterで連絡してください。 + p 以下の手順でXで連絡してください。 blockquote.twitter-tweet data-lang='ja' p lang='ja' dir='ltr' - a href='https://twitter.com/sukemasa_P' + a href='https://x.com/sukemasa_P' | @sukemasa_P | お問い合わせありがとうございます。本人確認のため a href='https://t.co/btjiBmWBvp' @@ -21,17 +21,17 @@ section.accordions br | 削除することもできますし、dm経由で一時的なパスワードに変更することも可能です。 | — IIDX☆12参考表 (@IIDX_12) - a href='https://twitter.com/IIDX_12/status/774630178425155584' + a href='https://x.com/IIDX_12/status/774630178425155584' | 2016年9月10日 - script src='//platform.twitter.com/widgets.js' charset='utf-8' async=true + script src='//platform.x.com/widgets.js' charset='utf-8' async=true .content ul li 既にiidxidが使われている li 何らかの不具合やバグ報告など | 対応は - = link_to 'http://twitter.com/IIDX_12' - = icon 'twitter', 'Twitter', style: 'fab' + = link_to 'http://x.com/IIDX_12' + = icon 'twitter', 'X', style: 'fab' | のほうが迅速なことが多いです。 br font color='red' diff --git a/lib/irt/sync.rb b/lib/irt/sync.rb index 5faa5e40..dfbeccf9 100644 --- a/lib/irt/sync.rb +++ b/lib/irt/sync.rb @@ -1,14 +1,10 @@ # frozen_string_literal: true -require 'twitter_dispatcher' - module Irt class Sync def self.run hash = fetch Ability.sync(hash) - twitter = TwitterDispatcher.new - twitter.tweet('地力値表を更新しました') end def self.fetch diff --git a/lib/twitter_dispatcher.rb b/lib/twitter_dispatcher.rb deleted file mode 100644 index ef5460ec..00000000 --- a/lib/twitter_dispatcher.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class TwitterDispatcher - def initialize - tokens = ENV['TWITTER_TOKENS'].split(',') - @client = Twitter::REST::Client.new do |config| - config.consumer_key = tokens[0] - config.consumer_secret = tokens[1] - config.access_token = tokens[2] - config.access_token_secret = tokens[3] - end - end - - def tweet(text) - @client.update(text) - end -end