Skip to content

Commit bed0dd7

Browse files
committed
Added ImBored API Scripts
1 parent d878f67 commit bed0dd7

File tree

7 files changed

+58
-0
lines changed

7 files changed

+58
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

APIScripts/.DS_Store

8 KB
Binary file not shown.

APIScripts/ImBored/.DS_Store

6 KB
Binary file not shown.

APIScripts/ImBored/ImBored.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+

APIScripts/ImBored/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 🤟

APIScripts/ImBored/demo.png

41.6 KB
Loading

APIScripts/ImBored/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Requirements:
2+
- requests library

0 commit comments

Comments
 (0)