Code Monkey home page Code Monkey logo

quantifiedself's Introduction

Stories in Ready

Quantified Self

Install

First, make sure you have pip installed for python3 and gulp,

$ curl 'https://bootstrap.pypa.io/get-pip.py' | sudo python3 -
$ sudo npm install -g gulp

Now, install all the dependencies,

$ sudo pip3 install -r requirements.txt

Compile the front-end code,

$ cd web
$ npm install
$ gulp production
$ cd ..

Lastly, you'll want to decrypt the config files. Simply run,

$ python3 config_packer.py decrypt config.conf.enc > config.conf

Similarly, if you changed the config.conf file, run the following to encrypt your changes,

$ python3 config_packer.py encrypt config.conf > config.conf.enc

Finally, run the script,

$ python3 api.py

Dev Notes

Normally when creating a showtime, we take the passphrase that encrypts that show and split it into shares. At least 2 of these shares are required to decrypt the contents of that show. If you set share_threshold in config to 1, we instead just send out the passphrase to make development easier. The ShowtimeAccessTokens endpoint will take either multiple shares (as we would expect in production) or a passphrase option for the dev case. Just remember to change the dev:shares_email config field in config.conf so that you get the e-mail with the passphrase!

quantifiedself's People

Contributors

leif-waldner avatar mynameisfiber avatar peymanmortazavi avatar slsp8752 avatar waffle-iron avatar wannabecitizen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quantifiedself's Issues

Fix ticket confirmation process

Currently we need to fix the dates and times for the tickets and verify that the /tickets API is working so the front-end can grab ticket times live. Also want to close the loop in creating a confirmation number and fix the process to delete expired tickets every 15 mins instead of 10 seconds.

Finish authentication flow

  • send out secret shares by e-mail when a show time has been created
  • save people's choices NOT to authenticate with us
  • trigger some API call to scrape users data when they click "finish" (differing until scrapers/processors are written)
  • easier way to share config.conf

Twitter Auth can't find cookie

When running on production, after a user finalizes their auth decision via Twitter, the redirect to our server throws a 500 error. This ONLY happens with the Twitter Auth! The error is:

Traceback (most recent call last):
      File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 1401, in _stack_context_handle_exception
        raise_exc_info((type, value, traceback))
      File "<string>", line 3, in raise_exc_info
      File "/usr/local/lib/python3.4/dist-packages/tornado/stack_context.py", line 314, in wrapped
        ret = fn(*args, **kwargs)
      File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 1613, in future_complete
        f.result()
      File "/usr/local/lib/python3.4/dist-packages/tornado/concurrent.py", line 232, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "/usr/local/lib/python3.4/dist-packages/tornado/gen.py", line 282, in wrapper
        yielded = next(result)
      File "/web/quantifiedSelf/lib/basehandler.py", line 93, in get
        user_id = self.get_secure_cookie("user_id", None)
      File "/web/quantifiedSelf/lib/basehandler.py", line 79, in get_secure_cookie
        return result.decode()
    AttributeError: 'NoneType' object has no attribute 'decode'

We have already verified that the 'Cookie' Header is indeed being sent just like on every other request. It doesn't make sense why in this one case get_secure_cookie fails. @mynameisfiber any help would be amazing. We've banged our head on this and everything (including the environment that the request has during processing) says the cookie should be there. Why would this / could this fail in this lone context?

Spotify Mixin throws exception on auth call back

Here is the output

[E 151001 11:12:29 web:1496] Uncaught exception GET /auth/spotify?code=AQC9tHbiqpP57fivqFCtZAzw41U1p1nLSKvhIrHsA4IFcALBMlT0yJjcfeQ1rrE0jJktTWkrroSOABqr-Yy1rNUS_EgrGRMV5N71jiECiwgfJ6_H-rXxe6hlohyLZDLP_PTm4XYKQ47YDjlLURrIdN-bG6fJEaNok3Vu_ZRB78WWan_roD_dgQMG7gjAsSh4zOwkcSL04_-xWlT5gm72pwMH9IHfhnvUL8PZFKYvODqvREUl4kjhJfRk3EDDgW5jWrx-g8VqBB8LTILcAVVm1oMVCO6Lf4rD4jEkcpO_ha_Bb6JHwyBL_mJSqpQx5BRREbGf7XQJkWofDrronF6gPQSyAnpOWpfFJUyDh_9JdQBVdUv9NY6w (::1)
HTTPServerRequest(protocol='https', host='localhost:6060', method='GET', uri='/auth/spotify?code=AQC9tHbiqpP57fivqFCtZAzw41U1p1nLSKvhIrHsA4IFcALBMlT0yJjcfeQ1rrE0jJktTWkrroSOABqr-Yy1rNUS_EgrGRMV5N71jiECiwgfJ6_H-rXxe6hlohyLZDLP_PTm4XYKQ47YDjlLURrIdN-bG6fJEaNok3Vu_ZRB78WWan_roD_dgQMG7gjAsSh4zOwkcSL04_-xWlT5gm72pwMH9IHfhnvUL8PZFKYvODqvREUl4kjhJfRk3EDDgW5jWrx-g8VqBB8LTILcAVVm1oMVCO6Lf4rD4jEkcpO_ha_Bb6JHwyBL_mJSqpQx5BRREbGf7XQJkWofDrronF6gPQSyAnpOWpfFJUyDh_9JdQBVdUv9NY6w', version='HTTP/1.1', remote_ip='::1', headers={'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip, deflate, sdch', 'Host': 'localhost:6060', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36', 'Connection': 'keep-alive', 'Referer': 'http://localhost:6060/signup', 'Upgrade-Insecure-Requests': '1'})
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/tornado/web.py", line 1369, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "/Library/Python/2.7/site-packages/tornado/stack_context.py", line 314, in wrapped
ret = fn(_args, *_kwargs)
File "/Library/Python/2.7/site-packages/tornado/web.py", line 1581, in future_complete
f.result()
File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/Library/Python/2.7/site-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(_exc_info)
File "/Users/peyman/Projects/quantifiedSelf/app/spotify_auth.py", line 22, in get
code=self.get_argument('code'))
File "/Library/Python/2.7/site-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/Library/Python/2.7/site-packages/tornado/auth.py", line 140, in wrapper
f(args, **kwargs)
File "/Users/peyman/Projects/quantifiedSelf/app/spotifyMix.py", line 27, in get_authenticated_user
http = self.get_auth_http_client()
AttributeError: 'SpotifyAuth' object has no attribute 'get_auth_http_client'
[E 151001 11:12:29 web:1908] 500 GET /auth/spotify?code=AQC9tHbiqpP57fivqFCtZAzw41U1p1nLSKvhIrHsA4IFcALBMlT0yJjcfeQ1rrE0jJktTWkrroSOABqr-Yy1rNUS_EgrGRMV5N71jiECiwgfJ6_H-rXxe6hlohyLZDLP_PTm4XYKQ47YDjlLURrIdN-bG6fJEaNok3Vu_ZRB78WWan_roD_dgQMG7gjAsSh4zOwkcSL04
-xWlT5gm72pwMH9IHfhnvUL8PZFKYvODqvREUl4kjhJfRk3EDDgW5jWrx-g8VqBB8LTILcAVVm1oMVCO6Lf4rD4jEkcpO_ha_Bb6JHwyBL_mJSqpQx5BRREbGf7XQJkWofDrronF6gPQSyAnpOWpfFJUyDh_9JdQBVdUv9NY6w (::1) 2.90ms

Add mailing list

Create a way to get added to a mailing list (front page) and a wait list button (in the signup flow).

Deal with people who don't give data

We are going to score the different sharing possibilities:

Google = 10
Facebook = 7
Twitter = 5
Tumblr = 3
Reddit = 3
Instagram = 2
Spotify = 2

Only users who give us 10 sharing points will get a guaranteed ticket. Otherwise, they will go into the bin of select tickets for people who don't share. (5 per show)

Minor Changes to Website

General (to apply to all pages):

  • - Tiny logo in tab to green and gold?
  • - "Black Box" Theater instead of "Blackbox"
  • - "Theatre" when the performance and "theater" just for the black box
  • Links to other sites should be yellow instead of blue?

News page:

  • - EEF winners post: misspelled "engineering"
  • - Knight winners post: "into the creation" sounds strange...
  • - Open Exhibit: maybe ask people to add themselves to the mailing list here, since we'll probably want to have specific hours for the open exhibition (so we can be there, running surveys)

Front page:

  • - "Learn More" button doesn't go to text
  • Initial text and "Learn More" button don't stay with their section when screen size changes

Tickets page:

About Page:

  • - add link to EEF in first paragraph
  • - in overview: "Engineering" is spelled incorrectly
  • Add link to the Black Box Theater
  • Paul, Sam, and Michael Aaron are missing on the team list
  • Should we add our advisors (e.g. Tom, Hilary, Michael...) to the Team page? Or acknowledgements to Gary and Bret for their help.
  • Add JP to the About Page

Privacy Page:

  • - may look nice to reduce paragraph font
  • - in overview: add comma after Tom Yeh's Sikuli Lab
  • - in Article 3: bullet points 4 and 5 are the same
  • - Article 3, bullet 6: what is "re require"
  • - inconsistent between "sign up" and "sign-up" -- pick one for all
  • - Identification: should this include the CU Fund or Knight??

Handle special codes

We should be able to create promotional codes and verify them to let people into sold-out shows. May want it such that we can make a code specific to a night or specific to a person.

Add ability to have limited tickets for non-data tickets

There should be a certain number of tickets per night allocated to users who don't provide enough data. This should be first-come first-serve and trigger if the tokens provided don't meet a pre-specified threshold.

  • Javascript check for the quality/number of oauth tokens provided
  • Additional page in registration flow to ask you to fill out survey (or go back and add more tokens) if the user doesn't give enough data AND there are non-data tickets available for that night (if there are none, maybe find a night that there are?)
  • Save survey results somewhere and mark the user as a special non-data ticket type

Fix some website issues

Fonts on privacy page, get rid of quicksand thick font, a warning about how we use gmail data that reminds you no human will look at it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.