Skip to content

Commit 5017e5d

Browse files
committed
Keyword generator
1 parent 1b641b2 commit 5017e5d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

keywordGenerator.sh

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

0 commit comments

Comments
 (0)