-
Notifications
You must be signed in to change notification settings - Fork 0
/
fast-but-not-furious-firefox.sh
117 lines (102 loc) · 3.2 KB
/
fast-but-not-furious-firefox.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
BLUE="\x1b[38;2;40;177;249m"
GREEN="\x1b[38;2;80;200;120m"
YELLOW="\x1b[38;2;253;253;150m"
RESET="\e[0m"
# To implement flags like :
# 1. flag -o : Search in other blockchains eg. ethereum
# 2. flag -rc : relaychain - only Polkadot related searches
# 3. flag -p : parachains - executes also parachain related searches
# Add Search for
# Polkadot Watercooler element room
# Parachain Technical
# Substrate Technical (Public)
printf $YELLOW
cat ascii.txt
printf $RESET
i=0
for var in "$@"
do
KEYWORDS[$i]=$var
i=$(($i+1))
done
# Define the organizations
ORGS=('paritytech' 'polkadot-js' 'substrate-developer-hub')
# Repos in the Parity tech org
PARITY_TECH=('substrate' 'polkadot' 'txwrapper-core' 'substrate-api-sidecar')
# Repos to search in the Substrate Developer Hub org
DEVHUB=('substrate-docs' 'awesome-substrate')
# When searching on the web, include also this keyword to specify the search
WEB=('substrate' 'polkadot+wiki' 'polkadot-js' 'substrate+dev+hub')
/Applications/Firefox.app/Contents/MacOS/firefox --new-window
printf "\n$BLUE Searching in Github Repos $RESET \n"
for org in "${ORGS[@]}";
do
printf "$GREEN Org : $org $RESET \n"
# Searching in Parity Tech Repos
if [[ "$org" == "paritytech" ]]; then
for repo in "${PARITY_TECH[@]}";
do
for keyword in "${KEYWORDS[@]}";
do
argsRepos="https://github.com/$org/$repo/search?q=$keyword"
sleep 0.5
/Applications/Firefox.app/Contents/MacOS/firefox --new-tab $argsRepos
printf " $argsRepos \n"
done
done
fi
# Searching in Polkadot JS Repos
if [[ "$org" == "polkadot-js" ]]; then
for keyword in "${KEYWORDS[@]}";
do
argsRepos="https://github.com/$org/api/search?q=$keyword"
sleep 0.5
/Applications/Firefox.app/Contents/MacOS/firefox --new-tab $argsRepos
printf " $argsRepos \n"
done
fi
# Searching in Substrate Developer Hub Repos
if [[ "$org" == "substrate-developer-hub" ]]; then
for repo in "${DEVHUB[@]}";
do
for keyword in "${KEYWORDS[@]}";
do
argsRepos="https://github.com/$org/$repo/search?q=$keyword"
sleep 0.5
/Applications/Firefox.app/Contents/MacOS/firefox --new-tab $argsRepos
printf " $argsRepos \n"
done
done
fi
done
# Searching in the web
printf "\n$BLUE Searching in the WEB $RESET \n"
for search in "${WEB[@]}";
do
for keyword in "${KEYWORDS[@]}";
do
argsSearchs="https://duckduckgo.com/?q=$search+$keyword"
sleep 0.5
/Applications/Firefox.app/Contents/MacOS/firefox --new-tab $argsSearchs
printf " $argsSearchs \n"
done
done
# Searching in Substrate Stack Exchange
printf "\n$BLUE Searching in Substrate Stack Exchange $RESET \n"
for keyword in "${KEYWORDS[@]}";
do
argsSearchs="https://substrate.stackexchange.com/search?q=$keyword"
sleep 0.5
/Applications/Firefox.app/Contents/MacOS/firefox --new-tab $argsSearchs
printf " $argsSearchs \n"
done
# Searching in Parity's Forum
printf "\n$BLUE Searching in Parity's Forum $RESET \n"
for keyword in "${KEYWORDS[@]}";
do
argsSearchs="https://forum.parity.io/search?q=$keyword"
sleep 0.5
/Applications/Firefox.app/Contents/MacOS/firefox --new-tab $argsSearchs
printf " $argsSearchs \n"
done