{"id":44939132,"url":"https://github.com/gschizas/questionnaire-for-reddit","last_synced_at":"2026-02-18T08:04:19.788Z","repository":{"id":50097857,"uuid":"124404516","full_name":"gschizas/questionnaire-for-reddit","owner":"gschizas","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-06T20:08:32.000Z","size":1978,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-07T19:03:51.919Z","etag":null,"topics":["flask","python","questionnaire","reddit","reddit-application"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gschizas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-08T14:40:29.000Z","updated_at":"2024-05-07T19:03:51.920Z","dependencies_parsed_at":"2024-04-17T02:25:55.915Z","dependency_job_id":"a7cc4cab-c7b2-4f43-8cb0-8b4c8547493f","html_url":"https://github.com/gschizas/questionnaire-for-reddit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gschizas/questionnaire-for-reddit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gschizas%2Fquestionnaire-for-reddit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gschizas%2Fquestionnaire-for-reddit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gschizas%2Fquestionnaire-for-reddit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gschizas%2Fquestionnaire-for-reddit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gschizas","download_url":"https://codeload.github.com/gschizas/questionnaire-for-reddit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gschizas%2Fquestionnaire-for-reddit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29573419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T07:57:19.261Z","status":"ssl_error","status_checked_at":"2026-02-18T07:57:18.820Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","python","questionnaire","reddit","reddit-application"],"created_at":"2026-02-18T08:04:19.065Z","updated_at":"2026-02-18T08:04:19.779Z","avatar_url":"https://github.com/gschizas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Questionnaire For Reddit\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n## Requirements\n\nIn order to test this you will need:\n\n* [Python 3.10](https://www.python.org/downloads/release/python-3103/). This could probably be made to work with Python 2.7 as well or any Python 3.x, but I prefer Python 3.\n* Some PostgreSQL installation. You can use a portable installation as well:\n  * The easiest method would be to do a full installation of [PostgreSQL from the official site](https://www.postgresql.org/download/).\n  * For Windows or Linux, you can just download the relevant [PostgreSQL binaries](http://www.enterprisedb.com/products-services-training/pgbindownload).\n  * For macOS, you can use [Postgres.app](http://postgresapp.com/) \n* The libraries in [Pipfile](https://pipenv.readthedocs.io/)\n  * **Flask**: The base for the web site\n  * **praw**: For interaction with reddit\n  * **ruamel.yaml**: For YAML reading (much nicer than PyYAML)\n  * **gunicorn**: This is used from heroku as their web server\n  * **SQLAlchemy**: For database interaction\n  * **pg8000**: Since I'm using a postgres, we need to have a way to connect.\n  * **psycopg2**: I only use pg8000, but SQLAlchemy asks for this, too\n  * **flask_sqlalchemy**: A way to connect Flask with SQLAlchemy.\n\n## Setup\n\n### Reddit application \nBefore you start testing, you need to create a reddit application.\n\n1. Head over to [reddit app preferences](https://www.reddit.com/prefs/apps) and click on the \"are you a developer? create an app...\" (or \"create another app...\") button.\n    1. Put as name whatever you want (e.g. `questionnaire for /r/mysubreddit (in development)`). I put `in development` in there to separate it from when it goes live. \n    2. Leave (*) Web app selected.\n    3. Enter whatever you want in the description (or even nothing at all).\n    4. You can also leave the **about** field empty. Or put a `http://localhost:5000/about`\n    5. The only important part: In the redirect uri put `http://localhost:5000/authorize_callback`\n    6. Press the \"create app\" button\n2. Take note of the Client ID and the Client Secret\n    1. ClientID is immediately below the \"web app\" thingie\n    2. Secret is the first field below that.\n\nThat's it. I probably made it sound harder than it is.\n\nHere's the process in screenshots:\n\nGo to reddit app preferences (step 1 above):  \n![Go to prefs/apps page](static/images/setup_step1.png)\n\nFill in the values (step 1.1 through 1.5 above):  \n![Create an application](static/images/setup_step2.png)\n\nAfter pressing the \"create app button\" (step 1.6 above):  \n![Application done](static/images/setup_step3.png)\n\nNote the client id (yellow) and the client secret (orange) (step 2 above):  \n![Client ID and Client Secret](static/images/setup_step4.png)\n\n### Database\nOk, now you just need to create a new database to record any answers. This will only be for development, of course. \nIf/when you deploy to heroku, the database will be created from heroku itself.\n \nIf you have chosen to download the raw binaries (Windows or Linux), you should also run the following batch file \n(just put it on the folder you've unzipped the binaries)\n\n```cmd\n@ECHO OFF\nREM The script sets environment variables helpful for PostgreSQL\nSET PATH=\"%~dp0\\bin\";%PATH%\nSET PGDATA=%~dp0\\data\nSET PGDATABASE=postgres\nSET PGUSER=postgres\nSET PGPORT=5432\nSET PGLOCALEDIR=%~dp0\\share\\locale\nREM The line below is only needed the first time you run this\nIF NOT EXIST \"%PGDATA%\" (\n    \"%~dp0\\bin\\initdb\" -U postgres -A trust\n)\n\"%~dp0\\bin\\pg_ctl\" -D \"%~dp0/data\" -l logfile start\nECHO Press any key to stop server\nPAUSE\n\"%~dp0\\bin\\pg_ctl\" -D \"%~dp0/data\" stop\n```\n\nor, for Linux\n```bash\n#!/bin/sh\n# The script sets environment variables helpful for PostgreSQL\nexport PATH=$PATH:$(pwd)/bin\nexport PGDATA=$(pwd)/data\nexport PGDATABASE=postgres\nexport PGUSER=postgres\nexport PGPORT=5432\nexport PGLOCALEDIR=$(pwd)/share/locale\necho $PATH\necho $PGDATA\n# The line below is only needed the first time you run this\nif [ ! -d \"$PGDATA\" ]; then\n    $(pwd)/bin/initdb -U postgres -A trust\nfi\n$(pwd)/bin/pg_ctl -D $(pwd)/data -l logfile start\nread -p \"Press [Enter] to stop server.\" key\n$(pwd)/bin/pg_ctl -D $(pwd)/data stop\n```\n\n## Environment variables:\n\nWhen developing, you need to set up the following environment variables (either at system level, or set them up in a batch file).\n\n* **REDDIT_OAUTH_CLIENT_ID**: Fill that in from the https://www.reddit.com/prefs/apps page\n* **REDDIT_OAUTH_CLIENT_SECRET**: Ditto\n* **REDDIT_OAUTH_REDIRECT_URL**: While you're doing development, this should be http://localhost:5000/authorize_callback\n* **DATABASE_URL**: If you have a local database, this should be something like `postgresql+pg8000://postgres@localhost/questionnaire` \n* **QUESTIONNAIRE_URL**: You can use your official one (for example https://www.reddit.com/r/your_subreddit/wiki/questionnaire.json) or a local file (file:///somewhere/on/your/disk/questionnaire.yml)\n* **FLASK_SECRET_KEY**: Any random string (I use `python -c \"import base64,os;print(base64.b64encode(os.urandom(48)).decode())\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgschizas%2Fquestionnaire-for-reddit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgschizas%2Fquestionnaire-for-reddit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgschizas%2Fquestionnaire-for-reddit/lists"}