w-martin / mindfulness Goto Github PK
View Code? Open in Web Editor NEWMakes us mindful
License: MIT License
Makes us mindful
License: MIT License
For conda requirements
For 're-run' situations
Web page will get more hits during mindfulness, display the currently playing song
Since YT link is being inserted as a string, input sanitation (or lack thereof) does not filter the nasty symbols out, allowing shell commands to be executed.
E.g. ; cat /etc/fstab >> /home/datascience/fstab --
will do cat /etc/fstab >> /home/datascience/fstab
: semi-colon ends the youtube-dl
part and --
escapes the --no-warnings
suffix.
Suggested by @tomwdrake
Too many -1's and the song is removed. No more green day please
b'Dream Theater - The Dance Of Eternity\n'
Potential fixes: decode utf8, or strip
[2018-03-12 15:14:49,826] ERROR in app: Exception on /add-entry/ [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "/opt/mindfulness/src/web.py", line 61, in add_entry
song = util.remove_commas_from_string(request.form["songName"])
File "/opt/mindfulness/src/util.py", line 27, in remove_commas_from_string
return str(input_string).translate(None, ',')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
Suggested by @tomwdrake
To avoid iterating through the same user's songs daily
Instead of csv
Songs are typically specified as " - <Title>". However, in the discord mindfulness notification, they appear without this hyphen separating artist and title, making the text harder to parse.
Songs count on web page seems to include the header row
Allow users to mark themselves as 'on holiday' so that their songs won't play
Suggested by @tomwdrake
To prevent csv fields from crossing over into others
This would be helpful logging, as well as the song before it plays
because it's also used for our morning standups, verv's office speaker is usually set to max volume. this is too high for most downloaded songs; they usually come out noisy and sound a bit distorted
[2017-12-04 15:56:18,526] ERROR in app: Exception on /add-entry/ [POST] Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/opt/mindfulness/src/web.py", line 67, in add_entry database.add_song(db, link, song, user_id, month=12 if festive else None) File "/home/datascience/PyCharm/mindfulness/src/database.py", line 115, in add_song db.execute(query_str) ProgrammingError: syntax error at or near "Christmas" LINE 1: ...ngs (title,url,user_id) select 'Do they Know it's Christmas ...
Dependency missing
Suggested by @tomwdrake
Like...Friday.
grep ',False' playlist.csv | wc -l
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.