Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
53 lines (40 sloc) 1.58 KB
# Google API Key
AIzaSyArPcOPqon_MSxFKkB41qCexrCVZ5AHfoU
# Search Engine ID
001954664739637419008:prvczty2gta
# Functions
### getQuestion
- Input (category, difficulty, nrQuestions = 1, qSource = "opentDB")
To get a random category or difficulty ("" or "Any" or "Random")
Source can be: opentDB, Birthday, History or Quote
- Output ([questionsSet])
A list of dictionaries with the keys: Type, Question, A, B, C, D and corrAnswer all as string for multiple choice questions
Type, Question, A, B and corrAnswer all as string for true or false questions
Type, Question and corrAnswer all as string for birthday, history and quote questions
### getCategories
- Input (onlyCategories = False, , nrCat = 0)
True returns categories without ID numbers
nrCat returns a set number of random categories
- Output (categories)
A list with the choosen number of categories
### getBirthday
- No Input
- Output
A dictionary of a radom birthday with the keys: Type, Name, Date, Question, corrAnswer all as string
### getHistory
- No Input
- Output
A dictionary of a radom birthday with the keys: Type, Event, Date, Question, corrAnswer all as string
### getQuote
- No Input
- Output
A dictionary of a radom birthday with the keys: Type, Name, Quote, Question, corrAnswer all as string
#### Error Codes
0 - There was an error opening the URL
1 - Error reading JSON data
2 - The number of questions requested not valid
3 - Category not valid
4 - Difficulty not valid
5 - No results were found
6 - Invalid parameter
7 - Token not found or all available question were used
You can’t perform that action at this time.