-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeywordGenerator.sh
More file actions
executable file
·40 lines (31 loc) · 1.01 KB
/
keywordGenerator.sh
File metadata and controls
executable file
·40 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "Python is not installed. Please install Python using 'brew install python'."
exit 1
fi
# Check if pip is installed
if ! command -v pip3 &> /dev/null; then
echo "pip is not installed. Please install pip for Python using 'brew install pip'."
exit 1
fi
# Check if googlesearch module is installed
if ! python3 -c "import googlesearch" &> /dev/null; then
echo "googlesearch module is not installed. Installing..."
pip3 install googlesearch-python
fi
# Prompt user for input
read -p "Enter a seed keyword to search: " seed_keyword
# Use Python script to fetch related keywords
related_keywords=$(python3 - <<END
from googlesearch import search
seed_keyword = "$seed_keyword"
related_keywords = []
for keyword in search(seed_keyword, num=10, stop=10, pause=2):
related_keywords.append(keyword)
print("\n".join(related_keywords))
END
)
# Display related keywords
echo "Related Keywords:"
echo "$related_keywords"