discord-tweet-collector's People
discord-tweet-collector's Issues
DB連携
正規表現による抽出機能
removeコマンドが動作しない
tweepyのハッシュ値指定
最新版利用のためtweepyライブラリをmasterブランチ指定しているが,固定バージョンを指定すべきのため修正対応する.
Tweepy Stream動作中にrequests.exceptions.ChunkedEncodingErrorが発生し,Botがツイートを拾わなくなる
事象発生時のログ
2021-02-20T02:19:57.118450+00:00 app[worker.1]: Tweepy Stream: Stream encountered an exception
2021-02-20T02:19:57.118462+00:00 app[worker.1]: Traceback (most recent call last):
2021-02-20T02:19:57.118464+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/urllib3/response.py", line 438, in _error_catcher
2021-02-20T02:19:57.118465+00:00 app[worker.1]: yield
2021-02-20T02:19:57.118465+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/urllib3/response.py", line 764, in read_chunked
2021-02-20T02:19:57.118466+00:00 app[worker.1]: self._update_chunk_length()
2021-02-20T02:19:57.118467+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/urllib3/response.py", line 694, in _update_chunk_length
2021-02-20T02:19:57.118467+00:00 app[worker.1]: line = self._fp.fp.readline()
2021-02-20T02:19:57.118468+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/socket.py", line 704, in readinto
2021-02-20T02:19:57.118468+00:00 app[worker.1]: return self._sock.recv_into(b)
2021-02-20T02:19:57.118469+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/ssl.py", line 1241, in recv_into
2021-02-20T02:19:57.118469+00:00 app[worker.1]: return self.read(nbytes, buffer)
2021-02-20T02:19:57.118470+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/ssl.py", line 1099, in read
2021-02-20T02:19:57.118470+00:00 app[worker.1]: return self._sslobj.read(len, buffer)
2021-02-20T02:19:57.118471+00:00 app[worker.1]: ConnectionResetError: [Errno 104] Connection reset by peer
2021-02-20T02:19:57.118472+00:00 app[worker.1]:
2021-02-20T02:19:57.118472+00:00 app[worker.1]: During handling of the above exception, another exception occurred:
2021-02-20T02:19:57.118472+00:00 app[worker.1]:
2021-02-20T02:19:57.118473+00:00 app[worker.1]: Traceback (most recent call last):
2021-02-20T02:19:57.118473+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py", line 753, in generate
2021-02-20T02:19:57.118473+00:00 app[worker.1]: for chunk in self.raw.stream(chunk_size, decode_content=True):
2021-02-20T02:19:57.118474+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/urllib3/response.py", line 572, in stream
2021-02-20T02:19:57.118474+00:00 app[worker.1]: for line in self.read_chunked(amt, decode_content=decode_content):
2021-02-20T02:19:57.118474+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/urllib3/response.py", line 793, in read_chunked
2021-02-20T02:19:57.118475+00:00 app[worker.1]: self._original_response.close()
2021-02-20T02:19:57.118475+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/contextlib.py", line 135, in __exit__
2021-02-20T02:19:57.118475+00:00 app[worker.1]: self.gen.throw(type, value, traceback)
2021-02-20T02:19:57.118476+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/urllib3/response.py", line 455, in _error_catcher
2021-02-20T02:19:57.118476+00:00 app[worker.1]: raise ProtocolError("Connection broken: %r" % e, e)
2021-02-20T02:19:57.118478+00:00 app[worker.1]: urllib3.exceptions.ProtocolError: ("Connection broken: ConnectionResetError(104, 'Connection reset by peer')", ConnectionResetError(104, 'Connection reset by peer'))
2021-02-20T02:19:57.118478+00:00 app[worker.1]:
2021-02-20T02:19:57.118478+00:00 app[worker.1]: During handling of the above exception, another exception occurred:
2021-02-20T02:19:57.118479+00:00 app[worker.1]:
2021-02-20T02:19:57.118479+00:00 app[worker.1]: Traceback (most recent call last):
2021-02-20T02:19:57.118479+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/tweepy/streaming.py", line 93, in _connect
2021-02-20T02:19:57.118480+00:00 app[worker.1]: for line in resp.iter_lines(
2021-02-20T02:19:57.118480+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py", line 797, in iter_lines
2021-02-20T02:19:57.118481+00:00 app[worker.1]: for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode):
2021-02-20T02:19:57.118481+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py", line 756, in generate
2021-02-20T02:19:57.118482+00:00 app[worker.1]: raise ChunkedEncodingError(e)
2021-02-20T02:19:57.118482+00:00 app[worker.1]: requests.exceptions.ChunkedEncodingError: ("Connection broken: ConnectionResetError(104, 'Connection reset by peer')", ConnectionResetError(104, 'Connection reset by peer'))
Heroku上での実行用スクリプト
テストコードの追加
環境変数利用モードの追加
現状,Heroku上で実行させるには認証トークン等を含めたファイルをリポジトリ管理下に置く必要がある.
上記はセキュリティ上の問題を孕むため,認証トークン等の情報を環境変数から読み取れるモードを実装する.
Herokuではアプリ毎に環境変数を設定可能なため,環境変数に認証トークン等の情報を設定した上でBotを起動する運用を目指す.
スレッド数の削減
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.