search-duckduck wait a bit
This commit is contained in:
@@ -57,7 +57,6 @@ def recherche_duckduckgo(session, query, n):
|
|||||||
if link:
|
if link:
|
||||||
results.append((title, link))
|
results.append((title, link))
|
||||||
|
|
||||||
time.sleep(random.uniform(1.5, 3.5))
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
@@ -89,6 +88,7 @@ def main(argc, argv):
|
|||||||
print(f"URL: {link}")
|
print(f"URL: {link}")
|
||||||
snippet = extract_text(session, link, args.chars)
|
snippet = extract_text(session, link, args.chars)
|
||||||
print(f"Extrait: {snippet}")
|
print(f"Extrait: {snippet}")
|
||||||
|
time.sleep(random.uniform(1.5, 3.5))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Executable
+25
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
|
||||||
|
echo "Usage: $0 arg1 [arg2] [arg3]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# interactive session check
|
||||||
|
if [ -t 0 ]; then
|
||||||
|
echo -n "Delete existing output files? [y/N]: "
|
||||||
|
read ans
|
||||||
|
case "$ans" in
|
||||||
|
y|Y) rm -f *.school ;;
|
||||||
|
*) echo "Aborted"; exit 0 ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# process input file
|
||||||
|
while IFS= read -r line; do
|
||||||
|
new_f="${line%.*}.school"
|
||||||
|
f > "$new_f"
|
||||||
|
done < "$FILE"
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
Reference in New Issue
Block a user