Skip to content

Commit d8c3a05

Browse files
committed
2 parents 3f49e3f + 7cd99a7 commit d8c3a05

File tree

1,904 files changed

+658766
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,904 files changed

+658766
-0
lines changed

.deepsource.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version = 1
2+
3+
[[analyzers]]
4+
name = "python"
5+
enabled = true
6+
7+
[analyzers.meta]
8+
runtime_version = "3.x.x"
9+
10+
[[transformers]]
11+
name = "autopep8"
12+
enabled = true
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
```markdown
3+
# Google Search Bot
4+
5+
This is a Python script that allows you to perform Google searches and display the search results. It uses the `googlesearch` library to interact with the Google search engine.
6+
7+
## Usage
8+
9+
1. Set the number of search results to display.
10+
2. Enter the keyword to search on Google.
11+
3. Perform the Google search.
12+
4. Print the search results obtained.
13+
14+
## Getting Started
15+
16+
To get started with the Google Search Bot, follow these steps:
17+
18+
1. Clone the repository:
19+
20+
```bash
21+
git clone https://github.com/your-username/google-search-bot.git
22+
```
23+
24+
2. Install the required dependencies:
25+
26+
```bash
27+
pip install googlesearch
28+
```
29+
30+
3. Run the script:
31+
32+
```bash
33+
python google_search_bot.py
34+
```
35+
36+
## Contributing
37+
38+
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please create an issue or submit a pull request.
39+
40+
## License
41+
42+
This project is licensed under the [MIT License](LICENSE).
43+
```
44+
45+
You can save this content in a file named `README.md` in your GitHub repository. Remember to replace `your-username` in the repository URL with your actual GitHub username.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
from googlesearch import search
2+
import sys
3+
4+
class googlesearch:
5+
6+
def __init__(self):
7+
self.search_count = None
8+
self.keyword_to_search = None
9+
self.search_results = None
10+
11+
def set_search_count(self):
12+
# Set the number of search results to display
13+
print("Enter the count of search results you want to display:")
14+
count = int(input())
15+
self.search_count = count
16+
17+
def set_search_text(self):
18+
# Set the keyword to search on Google
19+
print("Enter the text you want to search on Google:")
20+
text = input()
21+
self.keyword_to_search = text
22+
23+
def perform_search(self):
24+
try:
25+
# Perform the Google search
26+
results = search(self.keyword_to_search, num_results=self.search_count)
27+
self.search_results = results
28+
except Exception as e:
29+
print(e)
30+
print("Google search faced an exception")
31+
32+
print("Google search performed successfully")
33+
34+
def print_search_res(self):
35+
print("The search results for {} keyword are:".format(self.keyword_to_search))
36+
37+
count = 1
38+
for search_res in self.search_results:
39+
# Print the search results
40+
print("Search No {}: {}".format(count, search_res))
41+
count += 1
42+
43+
44+
def main():
45+
google_search_bot = googlesearch()
46+
47+
while True:
48+
print("Select any one of the valid operations which are listed below:")
49+
print("1. To set the number of searches we need to display for each Google Search.")
50+
print("2. To enter the keyword for the Google Search.")
51+
print("3. To perform Google Search for the keyword entered by the user.")
52+
print("4. To print the Google search results obtained after searching.")
53+
print("5. To exit from the code execution.")
54+
55+
choice = int(input(''))
56+
57+
if choice == 1:
58+
google_search_bot.set_search_count()
59+
elif choice == 2:
60+
google_search_bot.set_search_text()
61+
elif choice == 3:
62+
google_search_bot.perform_search()
63+
elif choice == 4:
64+
google_search_bot.print_search_res()
65+
else choice == 5:
66+
sys.exit()
67+
68+
print("To continue with the code execution, enter 'y' or 'n':")
69+
continue_or_exit = input()
70+
71+
if continue_or_exit == 'n' or continue_or_exit == 'N':
72+
sys.exit()
73+
74+
if __name__ == '__main__':
75+
main()

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: avinashkranjan
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# File Downloader
2+
3+
This script allows you to easily download files from a given URL and save them to a local directory. It utilizes the `requests` library to handle the HTTP requests and provide a convenient way to download files.
4+
5+
## Prerequisites
6+
7+
Before running this script, ensure that you have the following installed:
8+
9+
- Python 3.x
10+
- The `requests` library. You can install it by running the following command:
11+
12+
```
13+
pip install requests
14+
```
15+
16+
## Usage
17+
18+
1. Import the `requests` library:
19+
20+
```python
21+
import requests
22+
```
23+
24+
2. Define the `download_file` function, which takes three parameters: `url`, `save_path`, and `file_name`. This function downloads the file from the provided URL and saves it to the specified location.
25+
26+
```python
27+
def download_file(url, save_path, file_name):
28+
response = requests.get(url)
29+
file_path = save_path + "\\" + file_name
30+
with open(file_path, 'wb') as file:
31+
file.write(response.content)
32+
print("File downloaded successfully!")
33+
```
34+
35+
3. Provide the necessary information:
36+
37+
- Specify the URL of the file you want to download:
38+
39+
```python
40+
file_url = "https://files.ceenaija.com/wp-content/uploads/music/2022/09/Keane_-_Somewhere_Only_We_Know_CeeNaija.com_.mp3"
41+
```
42+
43+
- Set the save path where you want to store the file. Replace `YOUR_SAVE_PATH` with the desired directory path:
44+
45+
```python
46+
save_path = r"YOUR_SAVE_PATH"
47+
```
48+
49+
- Prompt the user to enter the desired file name:
50+
51+
```python
52+
file_name = input("Enter the file name: ")
53+
```
54+
55+
4. Download the file by calling the `download_file` function with the provided parameters:
56+
57+
```python
58+
download_file(file_url, save_path, file_name)
59+
```
60+
61+
The file will be downloaded and saved to the specified location. You can customize the script to fit your specific needs by modifying the URL, save path, and file name.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import requests
2+
3+
def download_file(url, save_path, file_name):
4+
"""
5+
Download a file from a given URL and save it to a specified directory.
6+
7+
Parameters:
8+
- url (str): The URL of the file to be downloaded.
9+
Get the URL of download button through it's inspect button.
10+
- save_path (str): The directory path where the file will be saved.
11+
- file_name (str): The name to be used for the downloaded file.
12+
"""
13+
response = requests.get(url)
14+
file_path = save_path + "\\" + file_name
15+
with open(file_path, 'wb') as file:
16+
file.write(response.content)
17+
print("File downloaded successfully!")
18+
19+
# Example URL
20+
file_url = "https://files.ceenaija.com/wp-content/uploads/music/2022/09/Keane_-_Somewhere_Only_We_Know_CeeNaija.com_.mp3"
21+
22+
# Example save path
23+
save_path = r"C:\Users\hp\Music"
24+
25+
# Prompt user for file name
26+
file_name = input("Enter the file name: ")
27+
28+
# Download the file
29+
download_file(file_url, save_path, file_name)

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: 🐛 Bug Report
2+
description: Report a bug report
3+
title: '[Bug]: '
4+
labels: ['🔧 goal: fix']
5+
body:
6+
- type: textarea
7+
id: what-happened
8+
attributes:
9+
label: Describe the bug
10+
placeholder: A clear and concise description of what the bug is.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: steps-to-reproduce
15+
attributes:
16+
label: Steps to reproduce the behavior
17+
placeholder: |
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
validations:
23+
required: false
24+
- type: textarea
25+
id: expected-behaviour
26+
attributes:
27+
label: Expected behavior
28+
placeholder: A clear and concise description of what you expected to happen.
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: screenshots
33+
attributes:
34+
label: Screenshots
35+
placeholder: If applicable, add screenshots to help explain your problem.
36+
validations:
37+
required: false
38+
- type: dropdown
39+
id: device
40+
attributes:
41+
label: Device?
42+
multiple: true
43+
options:
44+
- Desktop
45+
- Mobile
46+
- type: dropdown
47+
id: operating-system
48+
attributes:
49+
label: Which OS are affected?
50+
multiple: true
51+
options:
52+
- Mac
53+
- Windows
54+
- Linux
55+
- type: textarea
56+
id: version
57+
attributes:
58+
label: Enter the version of your web browser
59+
placeholder: Version
60+
validations:
61+
required: true
62+
- type: dropdown
63+
id: browsers
64+
attributes:
65+
label: Which browsers are affected?
66+
multiple: true
67+
options:
68+
- Firefox
69+
- Chrome
70+
- Safari
71+
- Microsoft Edge
72+
- Brave
73+
- Other
74+
- type: textarea
75+
id: additional-info
76+
attributes:
77+
label: Additional context
78+
placeholder: Add any other context about the problem here.
79+
validations:
80+
required: false
81+
- type: checkboxes
82+
id: terms
83+
attributes:
84+
label: 'Record'
85+
options:
86+
- label: I agree to follow this project's Code of Conduct
87+
required: true
88+
- label: I'm a GSSoC'23 contributor
89+
- label: I want to work on this issue
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ✨ Feature Request
2+
description: Suggest a feature request
3+
title: '[Feat]: '
4+
labels: ['⭐ goal: addition']
5+
body:
6+
- type: textarea
7+
id: what-feature
8+
attributes:
9+
label: Is your feature request related to a problem? Please describe.
10+
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: solution
15+
attributes:
16+
label: Describe the solution you'd like.
17+
placeholder: A clear and concise description of what you want to happen.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Describe alternatives you've considered.
24+
placeholder: A clear and concise description of any alternative solutions or features you've considered.
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: screenshots
29+
attributes:
30+
label: Show us the magic with screenshots
31+
placeholder: Attach screenshots to visualize your idea
32+
validations:
33+
required: false
34+
- type: checkboxes
35+
id: terms
36+
attributes:
37+
label: 'Record'
38+
options:
39+
- label: I agree to follow this project's Code of Conduct
40+
required: true
41+
- label: I'm a GSSoC'23 contributor
42+
- label: I want to work on this issue
43+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ✨ Script Addition
2+
description: Describe this Script you want to add
3+
title: '[Script]: '
4+
labels: ['⭐ goal: Script-addition']
5+
body:
6+
- type: textarea
7+
id: Aim
8+
attributes:
9+
label: Aim
10+
placeholder: What is the objective of the Script
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: Details
15+
attributes:
16+
label: Details
17+
placeholder: What the features will your script have
18+
validations:
19+
required: true
20+
- type: checkboxes
21+
id: terms
22+
attributes:
23+
label: 'Record'
24+
options:
25+
- label: I agree to follow this project's Code of Conduct
26+
required: true
27+
- label: I'm a GSSoC'23 contributor
28+
- label: I want to work on this issue
29+
30+

0 commit comments

Comments
 (0)