mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
removed rarely used files
This commit is contained in:
parent
73e7610f3f
commit
afc4ef9c25
9 changed files with 0 additions and 193 deletions
|
|
@ -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}")
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
requests
|
||||
colorama
|
||||
bs4
|
||||
|
|
@ -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}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue