- AskTheWorld - Table of Contents
- AskTheWorld - General Information
- AskTheWorld - Docs
This api allows the user to make quick anonymous surveys with random persons from all over the world answering their questions.
This tool is related to the movie "Unknown User: Dark Web", where a command tool named FlashVote lets people decide about the life of the main character Matias.
The server does not store any private information from users like their IPs so the surveys will be fully anonymous. Because of this AskTheWorld is not responsible for any contents of the questions nor the answers.
This api needs to be able to serve many users at the same time although running on a slow system (Raspberry Pi 4). For this reason the API will be written in Rust and utilizes the Actix web server, which currently is the fastest in the world.
If there are as many votes for yes as there are for no the api will randomly decide what to answer.
In question mode the user is able to enter a question which cannot be longer than a specific number of characters. The only available answers to these questions will be yes and no. The user can also specify a time limit after which the survey ends. This limit is being restricted by a limiting range specified in the configuration. After submiting his question the user can see the number of results and the time left until the survey ends. At the end he will only see the amount of received answers and the final result.
When the user enters answer mode he will be presented a randomly selected question and can decide between yes or no. He will also be able to see the remaining time so he does not run out of time before deciding.
Right now the main priority is developing the backend server as well as the api. This is probably going to be achieved by using Rust script which is running on a Raspberry Pi 4 server. The stability of this system is not great so the server will probably be changed as soon as there are more users. To further make it possible for the user to use this api, there will also be a command line tool written in Bash which can be used to send GET request to the api. After all of these programs work reliably there also might be a website where all users can use this tool, regardless of their Operating System and command line experience.
Minimum required duration in seconds to be specified for a question after which no answer can be submitted anymore. If duration is below MIN_TIME the DEFAULT_TIME will be used.
Maximum required duration in seconds to be specified for a question after which no answer can be submitted anymore. If duration is above MAX_TIME the DEFAULT_TIME will be used.
This is the default duration in seconds while which answers may be submitted for a question. If no duration is specified when the question is being submitted this time will be used.
This is the maximum lenght the question may have specified as the number of maximum characters. If the question is longer than this it will throw the 201 error.
This is the default time after which all questions will be deleted from the database. Please note, that it will be added to the time left to submit questions.
This is the user for the MongoDb, if none is specified, the user will stay empty and throw an error.
This is the clear text password to the corresponding MongoDb user. If none is specified an empty password will be used. Please note that unsecure MongoDb without users are not currently being supported by ATW.
This is the IP which leads to the MongoDb server. It can be a local or a public IP, depending on where the server is. If none is specified the default value is localhost
.
This is the port for the MongoDB server. In most cases you do not have to specify it because the default value 27017
is the default port of a MongoDb server. But if your server utilizes another port you can customize it through this environment variable.
This is the name of the database as a string where the collection containing the questions is on the mongodb server. The default value is atw
.
This is the selected collection for the currently selected database where the documents are being stored. The default value is questions
.
- Args:
- path: /api/submit/question/{question}/{time}
- String: question
- int: time until survey ends
- Output:
- ObjectId of question in database
- String: status
- 200 - everything worked fine
- 201 - question was longer than max_question_length
- 202 - no question submitted
- 203 - no time submitted, used DEFAULT_TIME instead
- 204 - submitted time was outside of possible range specified by MIN_TIME and MAX_TIME so DEFAULT_TIME was used
- 205 - could not find the question in the database, it might have already been deleted or the ObjectId has been wrong
- Args:
- path: /api/get/question
- Output:
- String: status
- 200 - everything worked fine
- ObjectId of question in database so an answer can be submitted
- String: question
- int: time left until no answers can be submitted in seconds
- String: status
- Args:
- path: /api/submit/answer/{answer}/{ObjectId}
- Bool: submitted answer, True for yes and False for no
- ObjectId of question to match the answer to the question
- Output:
- String: status
- 200 - everything worked fine
- 205 - could not find the question in the database, it might have already been deleted or the ObjectId has been wrong
- 206 - time of question ran out before answer has been submitted
- String: status
- Args:
- path: /api/get/answer/{ObjectId}
- ObjectId of the question
- Output:
- String: status
- 200 - everything worked fine
- 205 - could not find the question in the database, it might have already been deleted or the ObjectId has been wrong
- String: question
- int: time left until submitting is no longer possible in seconds
- Bool: answer for the question
- String: status
This is the ObjectId for the question in the bson format which has been assigned to a question automatically by mongodb.
This is the question which has been submitted.
This is the time the question has left for allowing answers. This will be added to the timestamp.
This is the amount of yes votes for this question.
This is the amount of no votes for this question.
This is the default answer which is being used when there is an equal amount of votes in favor of and against this question. It will be assigned to the question at the start and is being calculated by a 50/50 probability.