modified: install/fedora.sh
deleted: install/j.sh modified: install/tree_cpy.sh new file: usr/bin/search-google modified: usr/home/.bashrc modified: usr/sbin/brc
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import argparse
|
||||
from time import sleep
|
||||
import random
|
||||
from googlesearch import search
|
||||
|
||||
def google_search(query, num_results):
|
||||
# Effectuer une recherche Google et récupérer les 5 premiers résultats
|
||||
results = search(query, num_results=num_results)
|
||||
return results
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Effectuer une recherche Google.")
|
||||
parser.add_argument("query", help="La requête de recherche (peut contenir des espaces)", nargs='+')
|
||||
parser.add_argument("-n", "--num_results", type=int, default=1, help="Nombre de resultats a generer")
|
||||
args = parser.parse_args()
|
||||
num_results = args.num_results
|
||||
query = ' '.join(args.query)
|
||||
sleep(random.randint(100,1700) / 1000000)
|
||||
sleep(random.randint(1,4))
|
||||
results = google_search(query, num_results)
|
||||
|
||||
#for idx, result in enumerate(results, 1):
|
||||
# print(f"{idx}. {result}")
|
||||
for result in results:
|
||||
print(f"{result}")
|
||||
@@ -9,6 +9,9 @@ if [ -f /etc/env ]; then
|
||||
set +a
|
||||
fi
|
||||
|
||||
export SBIN_DIR=/svr/usr/sbin
|
||||
export BIN_DIR=/svr/usr/bin
|
||||
|
||||
set -o vi
|
||||
export EDITOR="vim"
|
||||
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@ MACHINE_DIR=${1:$MACHINE_DIR}
|
||||
MACHINE_DIR=${MACHINE_DIR:-"/svr"}
|
||||
F_NAME=".bashrc";
|
||||
cd "$MACHINE_DIR/usr/home";
|
||||
commit_if_modified "$F_NAME"
|
||||
vim "$F_NAME"
|
||||
cp -f $F_NAME /home/$F_NAME;
|
||||
cd -
|
||||
|
||||
Reference in New Issue
Block a user