File tree Expand file tree Collapse file tree 7 files changed +58
-0
lines changed Expand file tree Collapse file tree 7 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ import requests
2
+
3
+ URL = 'https://www.boredapi.com/api/activity/'
4
+
5
+
6
+ def get_Idea ():
7
+ print ("Wait! Let me Think ...\n " )
8
+ response = requests .get (URL )
9
+ if response .status_code == 200 :
10
+ print ('--------------------------------------------------' )
11
+ print ("Type : " ,response .json ()['type' ])
12
+ print ("Activity :" ,response .json ()['activity' ])
13
+ if (response .json ()['participants' ]> 1 ):
14
+ print ('You might need help from {} of your friends to complete this !' .format (response .json ()['participants' ]- 1 ))
15
+ print ('--------------------------------------------------' )
16
+ return
17
+ print ("Ahh ! Sorry I could not think anything, My brain couldn't be accessed." )
18
+
19
+ print ("\n " )
20
+ print ("Hello , I'm here to help you get out of the boredom !" )
21
+ print (" * Just type \" ImBored\" to see some intresting things you can do." )
22
+ print (" * Just press \" q\" to quit anytime you want." )
23
+ print ("\n " )
24
+ flag = True
25
+ while (flag ):
26
+ bored = input ()
27
+ if bored == 'q' :
28
+ break
29
+ elif bored == "ImBored" :
30
+ get_Idea ()
31
+ print ("\n " )
32
+ print ("I hope this my get you out of boredom. If not feel free to try again! " )
33
+ print ("\n " )
34
+ else :
35
+ print ("Oops! I think you got the wrong spelling! Try Again !" )
36
+
Original file line number Diff line number Diff line change
1
+ # ImBored - Get Random Suggestions.
2
+
3
+ ## Aim
4
+ To get some intresting ideas to try when you get bored.
5
+ ## Setup instructions
6
+
7
+ Install Python
8
+ Install all requirements by pip install -r requirements.py
9
+ Run python ImBored.py
10
+
11
+ ## Output
12
+
13
+
14
+
15
+ ## API Source
16
+ [ boredapi ] ( http://https://www.boredapi.com " boredapi ")
17
+
18
+
19
+
20
+ Happy coding 🤟
Original file line number Diff line number Diff line change
1
+ Requirements :
2
+ - requests library
You can’t perform that action at this time.
0 commit comments