swdyh / goodbye_chatwork

Chatwork(chatwork.com) log downloader
MIT License
67 stars 24 forks source link

Complying with kddi chatwork #4

Closed hirokishirai closed 8 years ago

hirokishirai commented 8 years ago

This PR enables using goodbye_chatwork with KDDI ChatWork.

I ran goodbye_chatwork -i hoge@fuga.com -p piyopiyopass and goodbye_chatwork raised "no token"(RuntimeError) in 'login' method.

% goodbye_chatwork -i hoge@fuga.com -p piyopiyopass
2016-07-15T14:41:52+09:00 login as hoge@fuga.com ...
/Users/hirokishirai/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/goodbye_chatwork-0.0.3/lib/goodbye_chatwork.rb:36:in `login': no token (RuntimeError)
    from /Users/hirokishirai/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/goodbye_chatwork-0.0.3/bin/goodbye_chatwork:37:in `<top (required)>'
    from /Users/hirokishirai/.rbenv/versions/2.3.1/bin/goodbye_chatwork:23:in `load'
    from /Users/hirokishirai/.rbenv/versions/2.3.1/bin/goodbye_chatwork:23:in `<main>'

This Exception is due to 302 redirect to KDDI ChatWork. KDDI ChatWork is plan of chatwork for enterprises.

For now, KDDI ChatWork's URL is "https://kcw.kddi.ne.jp". but, this URL might change by system owner. So, I use regexp to get redirect URL.

swdyh commented 8 years ago

@hirokishirai Because I do not have a KDDI's account I will not be able to try it. Thank you PR.