so-c / nozomi_miraha Goto Github PK
View Code? Open in Web Editor NEWA Twitter bot @nozomi_miraha
A Twitter bot @nozomi_miraha
quoteしようとしたとき、エントリィにラベルがないと、下記エラーが発生する。
object has no attribute 'tags'
Traceback (most recent call last):
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1536, in call
rv = self.handle_exception(request, response, e)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1530, in call
rv = self.router.dispatch(request, response)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 1102, in call
return handler.dispatch()
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.1/webapp2.py", line 570, in dispatch
return method(_args, *_kwargs)
File "/base/data/home/apps/snozomi-miraha/1.364292949124139347/quote.py", line 12, in getnozomi-miraha/1.364292949124139347/models.py", line 144, in init
blog = Blog('http://mirahalibrary.blogspot.com/feeds/posts/default')
File "/base/data/home/apps/s
self.posts = [Post(p) for p in post_elems]
File "/base/data/home/apps/s~nozomi-miraha/1.364292949124139347/models.py", line 162, in __init
self.tags = [t.term for t in entry_elem.tags]
File "/base/data/home/apps/s~nozomi-miraha/1.364292949124139347/lib/feedparser.py", line 413, in __getattr
raise AttributeError, "object has no attribute '%s'" % key
AttributeError: object has no attribute 'tags'
CPUが50%に達しているので、間隔を狭める。
TwitterのAPI1.1に対応したTweepy2.0以上にアップデートする。
goodnight.py", line 28, in get
holiday = Holiday().isholiday(d)
File "/base/data/home/apps/s~nozomi-miraha/1.366480527280006219/util.py", line 47, in isholiday
return js['items'][0]['summary']
IndexError: list index out of range
XML or text declaration not at start of entity: line 2, column 0
Traceback (most recent call last):
File "/base/data/home/apps/snozomi-miraha/1.365658101151815855/hello.py", line 9, in getnozomi-miraha/1.365658101151815855/models.py", line 121, in init
weather = Weather(63, 'today')
File "/base/data/home/apps/s
下記を参考にして作りなおす。
Local Unit Testing for Python https://developers.google.com/appengine/docs/python/tools/localunittesting
おはようツイートなどを低レベルの文字列処理しているのを、クラスに置き換える。
定数リストに移すか、Twitter API経由で取得するようにする(こちらが推奨)。
TwitterのAPI制限にかかりにくくするために、同じタイミングで実施するリプライを扱うハンドラをまとめる。
おはようと同じようにおやすみもリプライするようにする。
#1 の後に追加する。
20時間くらい前(前日の朝)のにリプライしている。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.