removed rarely used files

This commit is contained in:
Léana 江 2024-01-08 22:34:32 +01:00 committed by Léana 江
parent 73e7610f3f
commit afc4ef9c25
9 changed files with 0 additions and 193 deletions

View file

@ -1,25 +0,0 @@
#!/usr/bin/env python3
import requests
import random
from colorama import Fore, Style
from bs4 import BeautifulSoup
URL = "https://www.mon-poeme.fr/citation-du-jour/"
response = requests.get(URL)
content = response.content
soup = BeautifulSoup(content, "html.parser")
blockquote = soup.find_all('blockquote')
figcaption = soup.find_all('figcaption')
cs = zip(
map(lambda x: x.p.span.text, blockquote),
map(lambda x: (x.span.a.text, x.span.cite.text), figcaption),
)
c = random.choice(list(cs))
print(f"{Style.BRIGHT}« {c[0]} »{Style.RESET_ALL}")
print(f"{Style.DIM}~ {c[1][0]} - {c[1][1]}{Style.RESET_ALL}")

View file

@ -1,3 +0,0 @@
requests
colorama
bs4

View file

@ -1,50 +0,0 @@
#!/usr/bin/env python3
import argparse
import os
SEARX = "https://searxng.earth2077.fr/search?q=%s"
INVIDIOUS = "https://invidious.earth2077.fr/search?q=%s"
GITHUB = "https://github.com/search?q=%s&type=repositories"
FORGEJO = "https://git.earth2077.fr/explore/repos?sort=recentupdate&language=&q=%s&only_show_relevant=false"
WIKIPEDIA = "https://wikipedia.org/w/index.php?search=%s"
YANDEX = "https://yandex.com/search?text=%s"
GENIUS = "https://genius.com/search?q=%s"
HOOGLE = "https://hoogle.haskell.org/?hoogle=%s"
parser = argparse.ArgumentParser(description="Search the web, simply")
parser.add_argument("-m", "--motor", type=str, nargs=1, help="motor")
parser.add_argument("query", type=str, nargs="*", help="query")
args = parser.parse_args()
motor = ""
if not args.motor:
motor = SEARX
else:
match args.motor[0]:
case "yt":
motor = INVIDIOUS
case "fg":
motor = FORGEJO
case "gh":
motor = GITHUB
case "wk":
motor = WIKIPEDIA
case "yd":
motor = YANDEX
case "ge":
motor = GENIUS
case "hg":
motor = HOOGLE
case _:
motor = SEARX
query = " ".join(args.query).replace(" ", "%20")
link = motor[:].replace("%s", query)
# make the system go
print(link)
os.system(f"open {link}")