@@ -63,7 +63,11 @@ A list of categories that the returned joke should fit in.
6363Options are:
6464` programming ` ,
6565` miscellaneous ` ,
66+ <<<<<<< HEAD
6667` dark ` ,
68+ =======
69+ ` dark `
70+ >>>>>>> 92362ac33602ee9d5baf7e11f93507b473ebe207
6771` pun `
6872
6973If left blank it will default to use ` Any ` .
@@ -107,15 +111,15 @@ Options are:
107111
108112If left blank it will default to ` json ` .
109113
110- #### Example
114+ ##### Example
111115
112116``` python
113117 joke = j.get_joke(response_format = " xml" ) # Will return a joke in xml format.
114118```
115119
116120---
117121
118- ### type
122+ #### type
119123
120124The type of joke returned.
121125Options are:
@@ -124,21 +128,21 @@ Options are:
124128
125129If left blank it will default to ` Any `
126130
127- #### Example
131+ ##### Example
128132
129133``` python
130134 joke = j.get_joke(type = " twopart" ) # Will return a twopart joke; both a setup and a delivery.
131135```
132136
133137---
134138
135- ### search_string
139+ #### search_string
136140
137141A string to search for in jokes.
138142
139143If left blank it will default to ` None `
140144
141- #### Example
145+ ##### Example
142146
143147``` python
144148 joke = j.get_joke(search_string = " the" ) # Will return a joke with the word "the" in it.
@@ -147,7 +151,7 @@ If left blank it will default to `None`
147151
148152---
149153
150- ### id_range
154+ #### id_range
151155
152156The range in which the selected joke should fall. ID's are decided by the order in which jokes are submitted.
153157The argument passes should be in form of list or tuple, and should not exceed length of 2 items. First item
@@ -156,36 +160,63 @@ should be minimum 0. Maximum value can be determined [here](https://sv443.net/jo
156160If left blank it will default to the maximum range.
157161
158162
159- #### Example
163+ ##### Example
160164
161165``` python
162166 joke = j.get_joke(id_range = [10 ,100 ]) # Will return a joke with the ID between 10 and 100.
163167```
164168
165169---
166170
167- ### auth_token
171+ #### amount
172+
173+ The amount of jokes you want the api to return. Will return them in a list. Maximum number is 10 jokes, and the
174+ api defaults to 1 if you use a number larger than the maximum. Defaults to 1.
175+
176+
177+ ##### Example
178+
179+ ``` python
180+ joke = j.get_joke(amount = 2 ) # Will return 2 jokes.
181+ ```
182+
183+ ---
184+
185+ #### lang
186+
187+ The language that the joke and response should be in. Currently supported languages are in the official api
188+ documentation. Defaults to en.
189+
190+ ##### Example
191+
192+ ``` python
193+ joke = j.get_joke(lang = " de" )
194+ ```
195+
196+ ---
197+
198+ #### auth_token
168199
169200A string token provided by the api owner. Using it will mean you are whitelisted by the api and can make
170201more requests than normal users. Defaults to None
171202
172203
173- #### Example
204+ ##### Example
174205
175206``` python
176207 joke = j.get_joke(auth_token = " aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbb" ) # Will send the token to the api in a header.
177208```
178209
179210---
180211
181- ### user_agent
212+ #### user_agent
182213
183214A string sent the the api that tells the api what browser you are (pretending to be). The default user agent
184215is Mozilla Firefox from Windows 10 and should work fine, but the functionality is provided in case you wish
185216to change it
186217
187218
188- #### Example
219+ ##### Example
189220
190221``` python
191222 joke = j.get_joke(user_agent = " Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0" )
@@ -195,19 +226,19 @@ to change it
195226
196227---
197228
198- ### return_headers
229+ #### return_headers
199230
200231A boolean value (True or False) that tells the wrapper if you wish to receive headers in the return from the function.
232+ Will return a list instead of a single value
201233Defaults to False.
202234
203235
204- #### Example
236+ ##### Example
205237
206238``` python
207239 response = j.get_joke(return_headers = True )
208240 joke = response[0 ]
209241 headers = response[1 ]
210- # The function returns the joke and then the headers using the "return x, y" syntax, so you can index it like a list or tuple.
211242
212243 print (f " Joke: { joke} " )
213244 print (f " Headers: { headers} " )
0 commit comments