Compare commits
323 Commits
Author | SHA1 | Date |
---|---|---|
Ben Busby | 9bfdd88a5e | 2 months ago |
Ben Busby | 37ff61dfac | 2 months ago |
David Shen | 80e41e6b44 | 2 months ago |
David Shen | f18bf07ac3 | 2 months ago |
David Shen | fd20135af0 | 2 months ago |
Ben Busby | 7a1ebfe975 | 3 months ago |
Ben Busby | efbbd6b9d6 | 3 months ago |
Ben Busby | 4d1d3f4984 | 3 months ago |
Ben Busby | c389c26220 | 3 months ago |
Ben Busby | ef54f00212 | 3 months ago |
dependabot[bot] | af60509a8d | 3 months ago |
Ben Busby | 2395bb7a6a | 3 months ago |
dependabot[bot] | c216c033ef | 4 months ago |
Ben Busby | aaf90b52bb | 5 months ago |
Ben Busby | 7313edff46 | 6 months ago |
Ben Busby | cdbe550737 | 6 months ago |
Vivek | 70dc750c7a | 6 months ago |
Ben Busby | b5ae07613b | 6 months ago |
Ben Busby | 166b28040a | 6 months ago |
dependabot[bot] | 57398a9b3b | 6 months ago |
Ben Busby | b97f3dd4c0 | 7 months ago |
Ben Busby | 9f68c843d6 | 7 months ago |
dependabot[bot] | 2a0b9a47b2 | 7 months ago |
dependabot[bot] | 1644a4a04e | 7 months ago |
Zhiyong Dou | 6a10efbd9e | 7 months ago |
Gautam Korlam | 9cc1004fb8 | 7 months ago |
Ben Busby | cdf0b50284 | 8 months ago |
Ben Busby | 2950aa869b | 8 months ago |
Ben Busby | 7bda165ca3 | 8 months ago |
Ben Busby | 81b7fd1876 | 8 months ago |
Ben Busby | a7e937f7c6 | 8 months ago |
Ben Busby | c2873190c9 | 8 months ago |
Ben Busby | f7513bab69 | 8 months ago |
Ben Busby | 330ae964f3 | 8 months ago |
Ben Busby | 67b6110087 | 8 months ago |
Ben Busby | 4292ec7f63 | 8 months ago |
Ben Busby | 3ef191b5d8 | 8 months ago |
Ben Busby | c36396e9cb | 8 months ago |
dependabot[bot] | 0d013c788f | 8 months ago |
AlekseiKondrashov | ec05f8d52f | 8 months ago |
AlekseiKondrashov | e2070045bf | 8 months ago |
dependabot[bot] | b093d39ed1 | 8 months ago |
Ben Busby | e9c4ed6399 | 9 months ago |
Ben Busby | 8b99a87020 | 9 months ago |
Ben Busby | 3a2e0b262e | 9 months ago |
Anton Mironov | 8830615abc | 9 months ago |
MoistCat | 693ca3a9a8 | 9 months ago |
Ben Busby | a35b1dabbc | 9 months ago |
Ben Busby | a623210244 | 9 months ago |
Ben Busby | abbe29d9d3 | 9 months ago |
satoru | 19be033ba2 | 9 months ago |
Ben Busby | 92e8ede24e | 10 months ago |
Ahmad Alkadri | 4a0089686e | 10 months ago |
Fabian Wunsch | a40b98341b | 10 months ago |
Ben Busby | 18fc14dc5b | 10 months ago |
dependabot[bot] | 8a3c9ea397 | 10 months ago |
dependabot[bot] | ee25d3a23d | 10 months ago |
PrivacyDevel | c705bc7391 | 10 months ago |
cgi-bin/ | 2ac9e37696 | 10 months ago |
Simon Rusinov | 6f9d11a6ed | 10 months ago |
Ben Busby | 63a2ea56ed | 11 months ago |
Ben Busby | 4962659acb | 12 months ago |
Cx | 8a2a6f3265 | 12 months ago |
PrivacyDevel | 1b4e4e144e | 12 months ago |
Andiru | 29992985bc | 12 months ago |
Ben Busby | 179fc5e020 | 12 months ago |
Ben Busby | 421a8ac054 | 1 year ago |
Ben Busby | 0003da4bb9 | 1 year ago |
dependabot[bot] | 2b8d100cfb | 1 year ago |
fredster33 | f0a1223f40 | 1 year ago |
Felix | 958f74e1f5 | 1 year ago |
Ben Busby | 08732fac9e | 1 year ago |
Ben Busby | f65529f328 | 1 year ago |
Ben Busby | f213a2a64a | 1 year ago |
Roman Štefko | 2cb4b9e3ca | 1 year ago |
Ben Busby | 17dd1f1df1 | 1 year ago |
xatier | 4b7ab3b283 | 1 year ago |
Abhishek M J | 349b87ec18 | 1 year ago |
Ben Busby | 1eb8e04ed1 | 1 year ago |
No-Logs.com | 74a5e24901 | 1 year ago |
João | bf6c2505b1 | 1 year ago |
Ben Busby | 9d9022ed99 | 1 year ago |
Ben Busby | 25e7134bef | 1 year ago |
Ben Busby | 5ae9160d38 | 1 year ago |
Ben Busby | 076948dd0e | 1 year ago |
Ben Busby | b39ba0533a | 1 year ago |
PrivacyDevel | 229c9388cf | 1 year ago |
xatier | f970b62f12 | 1 year ago |
xatier | 31feb7228f | 1 year ago |
xatier | b1e468ff01 | 1 year ago |
Ben Busby | 8c426ab180 | 1 year ago |
Ben Busby | f7c4381ba6 | 1 year ago |
João | baa8bd0eb4 | 1 year ago |
Ben Busby | 1759c119a8 | 1 year ago |
Ben Busby | 74f7975e62 | 1 year ago |
Ben Busby | 0c65eb9616 | 1 year ago |
Ben Busby | 3f827bbf19 | 1 year ago |
Ben Busby | fb8a2ea325 | 1 year ago |
Ben Busby | 6b56dab4c1 | 1 year ago |
elliot | 7ca69e752d | 1 year ago |
dependabot[bot] | da53db2a81 | 1 year ago |
dependabot[bot] | c4c32a4bcc | 1 year ago |
Ben Busby | 991fe6d910 | 1 year ago |
Ben Busby | fab65d720d | 1 year ago |
Ben Busby | df760ffbae | 1 year ago |
test2user-aqil | 09db4ff730 | 1 year ago |
Ahmad Alkadri | 16794df68d | 1 year ago |
George T | 94b208dd3f | 1 year ago |
Ben Busby | 12ce174b9a | 1 year ago |
Ben Busby | e318594d9b | 1 year ago |
satoru | 026714bb84 | 1 year ago |
Ahmad Alkadri | e5a5aad997 | 1 year ago |
Dominick Peluso | ccf9f06f2f | 1 year ago |
Ben Busby | 6955ec6161 | 1 year ago |
Ben Busby | fdc63b862e | 1 year ago |
Ben Busby | aa54491ae0 | 1 year ago |
Charles Zawacki | cec10e81d3 | 1 year ago |
Ben Busby | 2827a4ef47 | 1 year ago |
Charles Zawacki | a760476d1b | 1 year ago |
Dominick Peluso | 4f77f3680d | 1 year ago |
fiestasiesta | 253ea62f8f | 1 year ago |
Ben Busby | c24caceb03 | 1 year ago |
Ben Busby | 4f85076a2b | 1 year ago |
Ben Busby | 76c78d8584 | 1 year ago |
Ahmad Alkadri | 3dda8b25ef | 1 year ago |
MoistCat | 08aa1ab8f1 | 1 year ago |
fiestasiesta | 7041b43db9 | 1 year ago |
Ben Busby | 424e6dd341 | 1 year ago |
Ben Busby | c9c197bb5f | 1 year ago |
Ben Busby | 7a852aa876 | 2 years ago |
Cx | 8fbbdf2cec | 2 years ago |
Ben Busby | 3dc6d14377 | 2 years ago |
dependabot[bot] | cd7fce2822 | 2 years ago |
Ben Busby | fd85f1573a | 2 years ago |
Ben Busby | 0310f0f542 | 2 years ago |
PrivacyDevel | 1226b8db9c | 2 years ago |
Raistlingru | cde05ea55d | 2 years ago |
Ben Busby | 3bd785b9b7 | 2 years ago |
Ben Busby | 33742ce247 | 2 years ago |
Anna | 08b16f5a0c | 2 years ago |
Ben Busby | d099b46336 | 2 years ago |
Ben Busby | 09a90ec46a | 2 years ago |
Xabi | 6bd48e40a7 | 2 years ago |
curlpipe | 2d23e0e952 | 2 years ago |
xatier | 1a66b195d4 | 2 years ago |
Ben Busby | a7fe1fd0df | 2 years ago |
Ben Busby | abbf037115 | 2 years ago |
Ben Busby | 06fd29f663 | 2 years ago |
Ben Busby | 7494a14bc2 | 2 years ago |
Ben Busby | 6696f2b12b | 2 years ago |
João | 77884d05f2 | 2 years ago |
João | 3e39e0e041 | 2 years ago |
João | 2a37619028 | 2 years ago |
Abir10101 | 75682de892 | 2 years ago |
João | e99db8db26 | 2 years ago |
HPD47 | 6ca51ecdcb | 2 years ago |
Shrirang Kahale | a3fa999b0d | 2 years ago |
Ben Busby | 70df88b825 | 2 years ago |
Arya K | 4d7254e74d | 2 years ago |
watchakorn-18k | 4b2b0bf3c9 | 2 years ago |
watchakorn-18k | 3943b2bc2c | 2 years ago |
João | 219fc58401 | 2 years ago |
João | 74503d542e | 2 years ago |
Biên | 11275a7796 | 2 years ago |
João | c42640e21c | 2 years ago |
João | 1aad47f2af | 2 years ago |
Cx | 6bb9c8448b | 2 years ago |
João | 8f59b7c340 | 2 years ago |
Ben Busby | 32ad39d0e1 | 2 years ago |
Ben Busby | 77f617e984 | 2 years ago |
Ben Busby | 81a802e3fc | 2 years ago |
Ben Busby | a6a97aa9c7 | 2 years ago |
Ben Busby | cab1105169 | 2 years ago |
Ben Busby | 2eee0b87d5 | 2 years ago |
Ben Busby | aa198ed562 | 2 years ago |
Ben Busby | 3f363b0175 | 2 years ago |
Ben Busby | 8e867a5ace | 2 years ago |
Ben Busby | 73dd5b80b5 | 2 years ago |
Ben Busby | 839683b4e1 | 2 years ago |
Ben Busby | 78614877f2 | 2 years ago |
Ben Busby | bf92944b95 | 2 years ago |
Ben Busby | fde2c4db1e | 2 years ago |
Ben Busby | 96b9cce70c | 2 years ago |
Ben Busby | 75a57ede07 | 2 years ago |
Ben Busby | a1adf60b30 | 2 years ago |
Ben Busby | 5db72a9552 | 2 years ago |
Kian-Meng Ang | 2a8519be30 | 2 years ago |
MadcowOG | 03eeb3fad1 | 2 years ago |
Ben Busby | f688b88bd8 | 2 years ago |
J2D9 | 7164d066c3 | 2 years ago |
J2D9 | 4473f8ee1d | 2 years ago |
MadcowOG | 6a24a785ee | 2 years ago |
Marcell Fülöp | ee2d3726af | 2 years ago |
Ben Busby | c1d9373d55 | 2 years ago |
Ben Busby | a51fbb1b0e | 2 years ago |
Ben Busby | cada4efe1d | 2 years ago |
Joao A. Candido Ramos | 0d2d5fff5d | 2 years ago |
jan Anja | 90e160094d | 2 years ago |
CAB233 | 877785c3ca | 2 years ago |
Joao A. Candido Ramos | d05ec08abf | 2 years ago |
Joao A. Candido Ramos | ddb8931e68 | 2 years ago |
jan Anja | 194b2eae74 | 2 years ago |
Ben Busby | 966644baa0 | 2 years ago |
Ben Busby | ddc73a53fe | 2 years ago |
Ben Busby | cb5557cc2e | 2 years ago |
MadcowOG | c9ee9dcc8b | 2 years ago |
Ben Busby | dc03022e27 | 2 years ago |
Ben Busby | b03fe74f10 | 2 years ago |
Rajesh Rajendran | 2600ad5a05 | 2 years ago |
Ben Busby | d512745767 | 2 years ago |
Ben Busby | d51be4f529 | 2 years ago |
Ben Busby | 35ac5ac82f | 2 years ago |
Ben Busby | 65796fd1a5 | 2 years ago |
Ben Busby | a9e1f0d1bc | 2 years ago |
Ben Busby | f9ff781df3 | 2 years ago |
Ben Busby | 47df4da4b5 | 2 years ago |
Ben Busby | f22e5ac171 | 2 years ago |
Ben Busby | ef98d85dc5 | 2 years ago |
dependabot[bot] | 57d9ae9351 | 2 years ago |
PrivacyDevel | ce477ef997 | 2 years ago |
Joao A. Candido Ramos | fb6627a9cc | 2 years ago |
invis-z | 9bcd9931f7 | 2 years ago |
Ben Busby | fb600d6fc8 | 2 years ago |
Ben Busby | f5d599e7d2 | 2 years ago |
Nico | 5d521be5d9 | 2 years ago |
invis-z | 0f6226ce51 | 2 years ago |
Ben Busby | 194ddc33f3 | 2 years ago |
hoschi1337 | b809c88fa5 | 2 years ago |
xatier | 7486697d41 | 2 years ago |
invis-z | afc93b8a21 | 2 years ago |
invis-z | b4d9f1f5e5 | 2 years ago |
Sandro | ad112e236e | 2 years ago |
Ben Busby | 8a0b872337 | 2 years ago |
Ben Busby | 2490089645 | 2 years ago |
Ben Busby | 62d7491936 | 2 years ago |
Ben Busby | abc30d7da3 | 2 years ago |
Warren Spits | d62ceb8423 | 2 years ago |
Ben Busby | b2c524bc3e | 2 years ago |
Ben Busby | a9b675cd24 | 2 years ago |
Ben Busby | 5c8be4428b | 2 years ago |
Ben Busby | 7688c1a233 | 2 years ago |
gdm85 | 6d362ca5c7 | 2 years ago |
gdm85 | 94b4eb08a2 | 2 years ago |
Ilya Prokopenko | cded1e0272 | 2 years ago |
glitsj16 | ca80bb0caa | 2 years ago |
Ben Busby | 9317d9217f | 2 years ago |
gdm85 | 7d01620316 | 2 years ago |
gdm85 | 739a5092cc | 2 years ago |
Ben Busby | 2fcfeacd44 | 2 years ago |
Ben Busby | 0e5630f33a | 2 years ago |
Ben Busby | 470e2932ad | 2 years ago |
Ben Busby | 797372ecaa | 2 years ago |
Ben Busby | 788730cdc2 | 2 years ago |
green1052 | 0d6901aaa2 | 2 years ago |
138138138 | 5ecd4fe931 | 2 years ago |
xatier | e575fad324 | 2 years ago |
domokosdcs0 | 4c91667b6f | 2 years ago |
Ben Busby | 3ec1f46fe8 | 2 years ago |
Ben Busby | 73ab9f29a5 | 2 years ago |
Ben Busby | f5c47234de | 2 years ago |
dependabot[bot] | 605338e998 | 2 years ago |
Peter Bottenberg | 9c4351a174 | 2 years ago |
Ben Busby | 0048c2f9aa | 2 years ago |
Ben Busby | a58f70ca7e | 2 years ago |
Ben Busby | 2a0ad8796c | 2 years ago |
Ben Busby | f7e3650728 | 2 years ago |
Ben Busby | 69f845a047 | 2 years ago |
Ben Busby | 809520ec70 | 2 years ago |
Ben Busby | b28fa86e33 | 2 years ago |
jan Anja | 5069838e69 | 2 years ago |
Albony Cal | c3634a5135 | 2 years ago |
Ben Busby | e72d8437f7 | 2 years ago |
Ben Busby | 9984158ec1 | 2 years ago |
Nitish Yadav | 0e711beca7 | 2 years ago |
Ben Busby | 23402e27e1 | 2 years ago |
Ben Busby | d33e8241dc | 2 years ago |
DUO Labs | b2c048af92 | 2 years ago |
DUO Labs | 7c5094d37b | 2 years ago |
Ben Busby | c6c9965335 | 2 years ago |
Kainoa Kanter | 4eafe0a5b0 | 2 years ago |
Ben Busby | 070c327642 | 2 years ago |
Esmail EL BoB | 558a627a73 | 2 years ago |
DUO Labs | 502067addc | 2 years ago |
Joao A. Candido Ramos | 11099f7b1d | 2 years ago |
සයුරි | Sayuri | 4aa94a5d75 | 2 years ago |
DUO Labs | 500942cb99 | 2 years ago |
Ben Busby | b393e68d1d | 2 years ago |
Ben Busby | 63301efb28 | 2 years ago |
Ben Busby | e3394e29dd | 2 years ago |
Ben Busby | 9ba73331aa | 2 years ago |
Ben Busby | 33f56bb0cb | 2 years ago |
Ben Busby | fef280a0c9 | 2 years ago |
Ben Busby | df6aa59fbf | 2 years ago |
Ben Busby | 3918c60d87 | 2 years ago |
Ben Busby | 1af4566991 | 2 years ago |
Ben Busby | 4dd2c581ac | 2 years ago |
Ben Busby | 9cbd7bd9d3 | 2 years ago |
Ben Busby | 2e3c647591 | 2 years ago |
Ben Busby | 863cbb2b8d | 2 years ago |
Ben Busby | 72e5a227c8 | 2 years ago |
Ben Busby | 6d178342ee | 2 years ago |
nakoo | 0b70962e0c | 2 years ago |
ras07 | ecb4277e69 | 2 years ago |
ras07 | 09a0039a38 | 2 years ago |
Nitish Yadav | fc50359752 | 2 years ago |
DUO Labs | 257e3f33ef | 2 years ago |
Ben Busby | 4dd01cdfda | 2 years ago |
DUO Labs | 74cb48086c | 2 years ago |
Ben Busby | ded787547a | 2 years ago |
domokosdcs0 | 31f4c00aee | 2 years ago |
Ben Busby | f4b65be876 | 2 years ago |
Ben Busby | 362b6a75c8 | 2 years ago |
Ben Busby | 8c92b381a2 | 2 years ago |
Ben Busby | 95be59eaab | 3 years ago |
Ben Busby | a2d5a23c43 | 3 years ago |
Ben Busby | d02a7d90b9 | 3 years ago |
Ben Busby | 6d9df65d02 | 3 years ago |
Ben Busby | b745460a87 | 3 years ago |
Albony Cal | fd802aac06 | 3 years ago |
Roy Zuo | dec6d80dda | 3 years ago |
Nuño Sempere | f6c0843183 | 3 years ago |
glitsj16 | c637eb28dd | 3 years ago |
Ben Busby | 119437a07c | 3 years ago |
@ -0,0 +1,28 @@
|
||||
name: docker_main
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["tests"]
|
||||
branches: [main]
|
||||
types:
|
||||
- completed
|
||||
|
||||
# TODO: Needs refactoring to use reusable workflows and share w/ docker_tests
|
||||
jobs:
|
||||
on-success:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: build and test (docker)
|
||||
run: |
|
||||
docker build --tag whoogle-search:test .
|
||||
docker run --publish 5000:5000 --detach --name whoogle-search-nocompose whoogle-search:test
|
||||
sleep 15
|
||||
docker exec whoogle-search-nocompose curl -f http://localhost:5000/healthz || exit 1
|
||||
- name: build and test (docker-compose)
|
||||
run: |
|
||||
docker rm -f whoogle-search-nocompose
|
||||
WHOOGLE_IMAGE="whoogle-search:test" docker-compose up --detach
|
||||
sleep 15
|
||||
docker exec whoogle-search curl -f http://localhost:5000/healthz || exit 1
|
@ -1,21 +1,26 @@
|
||||
name: docker_tests
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["tests"]
|
||||
branches: [main]
|
||||
types:
|
||||
- completed
|
||||
push:
|
||||
branches: main
|
||||
pull_request:
|
||||
branches: main
|
||||
|
||||
jobs:
|
||||
on-success:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: build and test
|
||||
- name: build and test (docker)
|
||||
run: |
|
||||
docker build --tag whoogle-search:test .
|
||||
docker run --publish 5000:5000 --detach --name whoogle-search whoogle-search:test
|
||||
docker run --publish 5000:5000 --detach --name whoogle-search-nocompose whoogle-search:test
|
||||
sleep 15
|
||||
docker exec whoogle-search-nocompose curl -f http://localhost:5000/healthz || exit 1
|
||||
- name: build and test (docker-compose)
|
||||
run: |
|
||||
docker rm -f whoogle-search-nocompose
|
||||
WHOOGLE_IMAGE="whoogle-search:test" docker-compose up --detach
|
||||
sleep 15
|
||||
docker exec whoogle-search curl -f http://localhost:5000/healthz || exit 1
|
||||
|
@ -1,21 +0,0 @@
|
||||
name: pep8
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pycodestyle
|
||||
- name: Run pycodestyle
|
||||
run: |
|
||||
pycodestyle --show-source --show-pep8 app/*
|
||||
pycodestyle --show-source --show-pep8 test/*
|
@ -0,0 +1,19 @@
|
||||
name: scan
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the container image
|
||||
run: |
|
||||
docker build --tag whoogle-search:test .
|
||||
- name: Initiate grype scan
|
||||
run: |
|
||||
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b .
|
||||
chmod +x ./grype
|
||||
./grype whoogle-search:test --only-fixed
|
@ -1,3 +1 @@
|
||||
language = "bash"
|
||||
run = "killall -q python3 > /dev/null 2>&1; pip install -r requirements.txt && ./run"
|
||||
onBoot = "killall -q python3 > /dev/null 2>&1; pip install -r requirements.txt && ./run"
|
||||
entrypoint = "misc/replit.py"
|
||||
|
@ -0,0 +1,47 @@
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
class GClasses:
|
||||
"""A class for tracking obfuscated class names used in Google results that
|
||||
are directly referenced in Whoogle's filtering code.
|
||||
|
||||
Note: Using these should be a last resort. It is always preferred to filter
|
||||
results using structural cues instead of referencing class names, as these
|
||||
are liable to change at any moment.
|
||||
"""
|
||||
main_tbm_tab = 'KP7LCb'
|
||||
images_tbm_tab = 'n692Zd'
|
||||
footer = 'TuS8Ad'
|
||||
result_class_a = 'ZINbbc'
|
||||
result_class_b = 'luh4td'
|
||||
scroller_class = 'idg8be'
|
||||
|
||||
result_classes = {
|
||||
result_class_a: ['Gx5Zad'],
|
||||
result_class_b: ['fP1Qef']
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def replace_css_classes(cls, soup: BeautifulSoup) -> BeautifulSoup:
|
||||
"""Replace updated Google classes with the original class names that
|
||||
Whoogle relies on for styling.
|
||||
|
||||
Args:
|
||||
soup: The result page as a BeautifulSoup object
|
||||
|
||||
Returns:
|
||||
BeautifulSoup: The new BeautifulSoup
|
||||
"""
|
||||
result_divs = soup.find_all('div', {
|
||||
'class': [_ for c in cls.result_classes.values() for _ in c]
|
||||
})
|
||||
|
||||
for div in result_divs:
|
||||
new_class = ' '.join(div['class'])
|
||||
for key, val in cls.result_classes.items():
|
||||
new_class = ' '.join(new_class.replace(_, key) for _ in val)
|
||||
div['class'] = new_class.split(' ')
|
||||
return soup
|
||||
|
||||
def __str__(self):
|
||||
return self.value
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"!i": {
|
||||
"url": "search?q={}&tbm=isch",
|
||||
"suggestion": "!i (Whoogle Images)"
|
||||
},
|
||||
"!v": {
|
||||
"url": "search?q={}&tbm=vid",
|
||||
"suggestion": "!v (Whoogle Videos)"
|
||||
},
|
||||
"!n": {
|
||||
"url": "search?q={}&tbm=nws",
|
||||
"suggestion": "!n (Whoogle News)"
|
||||
}
|
||||
}
|
@ -1,11 +1,67 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const advSearchToggle = document.getElementById("adv-search-toggle");
|
||||
const advSearchDiv = document.getElementById("adv-search-div");
|
||||
const searchBar = document.getElementById("search-bar");
|
||||
const countrySelect = document.getElementById("result-country");
|
||||
const timePeriodSelect = document.getElementById("result-time-period");
|
||||
const arrowKeys = [37, 38, 39, 40];
|
||||
let searchValue = searchBar.value;
|
||||
|
||||
searchBar.addEventListener("keyup", function (event) {
|
||||
if (event.keyCode !== 13) {
|
||||
handleUserInput(searchBar);
|
||||
countrySelect.onchange = () => {
|
||||
let str = window.location.href;
|
||||
n = str.lastIndexOf("/search");
|
||||
if (n > 0) {
|
||||
str = str.substring(0, n) + `/search?q=${searchBar.value}`;
|
||||
str = tackOnParams(str);
|
||||
window.location.href = str;
|
||||
}
|
||||
}
|
||||
|
||||
timePeriodSelect.onchange = () => {
|
||||
let str = window.location.href;
|
||||
n = str.lastIndexOf("/search");
|
||||
if (n > 0) {
|
||||
str = str.substring(0, n) + `/search?q=${searchBar.value}`;
|
||||
str = tackOnParams(str);
|
||||
window.location.href = str;
|
||||
}
|
||||
}
|
||||
|
||||
function tackOnParams(str) {
|
||||
if (timePeriodSelect.value != "") {
|
||||
str = str + `&tbs=${timePeriodSelect.value}`;
|
||||
}
|
||||
if (countrySelect.value != "") {
|
||||
str = str + `&country=${countrySelect.value}`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
const toggleAdvancedSearch = on => {
|
||||
if (on) {
|
||||
advSearchDiv.style.maxHeight = "70px";
|
||||
} else {
|
||||
advSearchDiv.style.maxHeight = "0px";
|
||||
}
|
||||
localStorage.advSearchToggled = on;
|
||||
}
|
||||
|
||||
try {
|
||||
toggleAdvancedSearch(JSON.parse(localStorage.advSearchToggled));
|
||||
} catch (error) {
|
||||
console.warn("Did not recover advanced search toggle state");
|
||||
}
|
||||
|
||||
advSearchToggle.onclick = () => {
|
||||
toggleAdvancedSearch(advSearchToggle.checked);
|
||||
}
|
||||
|
||||
searchBar.addEventListener("keyup", function(event) {
|
||||
if (event.keyCode === 13) {
|
||||
document.getElementById("search-form").submit();
|
||||
} else if (searchBar.value !== searchValue && !arrowKeys.includes(event.keyCode)) {
|
||||
searchValue = searchBar.value;
|
||||
handleUserInput();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,44 +1,62 @@
|
||||
(function () {
|
||||
let searchBar, results;
|
||||
const keymap = {
|
||||
ArrowUp: goUp,
|
||||
ArrowDown: goDown,
|
||||
k: goUp,
|
||||
j: goDown,
|
||||
'/': focusSearch,
|
||||
};
|
||||
let activeIdx = -1;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
searchBar = document.querySelector('#search-bar');
|
||||
results = document.querySelectorAll('#main>div>div>div>a');
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.target.tagName === 'INPUT') return true;
|
||||
if (typeof keymap[e.key] === 'function') {
|
||||
e.preventDefault();
|
||||
keymap[e.key]();
|
||||
}
|
||||
});
|
||||
|
||||
function goUp () {
|
||||
if (activeIdx > 0) focusResult(activeIdx - 1);
|
||||
else focusSearch();
|
||||
}
|
||||
|
||||
function goDown () {
|
||||
if (activeIdx < results.length - 1) focusResult(activeIdx + 1);
|
||||
}
|
||||
|
||||
function focusResult (idx) {
|
||||
activeIdx = idx;
|
||||
results[activeIdx].scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' });
|
||||
results[activeIdx].focus();
|
||||
}
|
||||
|
||||
function focusSearch () {
|
||||
activeIdx = -1;
|
||||
searchBar.focus();
|
||||
}
|
||||
let searchBar, results;
|
||||
let shift = false;
|
||||
const keymap = {
|
||||
ArrowUp: goUp,
|
||||
ArrowDown: goDown,
|
||||
ShiftTab: goUp,
|
||||
Tab: goDown,
|
||||
k: goUp,
|
||||
j: goDown,
|
||||
'/': focusSearch,
|
||||
};
|
||||
let activeIdx = -1;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
searchBar = document.querySelector('#search-bar');
|
||||
results = document.querySelectorAll('#main>div>div>div>a');
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Shift') {
|
||||
shift = true;
|
||||
}
|
||||
|
||||
if (e.target.tagName === 'INPUT') return true;
|
||||
if (typeof keymap[e.key] === 'function') {
|
||||
e.preventDefault();
|
||||
|
||||
keymap[`${shift && e.key == 'Tab' ? 'Shift' : ''}${e.key}`]();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keyup', (e) => {
|
||||
if (e.key === 'Shift') {
|
||||
shift = false;
|
||||
}
|
||||
});
|
||||
|
||||
function goUp () {
|
||||
if (activeIdx > 0) focusResult(activeIdx - 1);
|
||||
else focusSearch();
|
||||
}
|
||||
|
||||
function goDown () {
|
||||
if (activeIdx < results.length - 1) focusResult(activeIdx + 1);
|
||||
}
|
||||
|
||||
function focusResult (idx) {
|
||||
activeIdx = idx;
|
||||
results[activeIdx].scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' });
|
||||
results[activeIdx].focus();
|
||||
}
|
||||
|
||||
function focusSearch () {
|
||||
if (window.usingCalculator) {
|
||||
// if this function exists, it means the calculator widget has been displayed
|
||||
if (usingCalculator()) return;
|
||||
}
|
||||
activeIdx = -1;
|
||||
searchBar.focus();
|
||||
}
|
||||
}());
|
||||
|
@ -0,0 +1,32 @@
|
||||
{
|
||||
"all": {
|
||||
"tbm": null,
|
||||
"href": "search?q={query}",
|
||||
"name": "All",
|
||||
"selected": true
|
||||
},
|
||||
"images": {
|
||||
"tbm": "isch",
|
||||
"href": "search?q={query}",
|
||||
"name": "Images",
|
||||
"selected": false
|
||||
},
|
||||
"maps": {
|
||||
"tbm": null,
|
||||
"href": "https://maps.google.com/maps?q={map_query}",
|
||||
"name": "Maps",
|
||||
"selected": false
|
||||
},
|
||||
"videos": {
|
||||
"tbm": "vid",
|
||||
"href": "search?q={query}",
|
||||
"name": "Videos",
|
||||
"selected": false
|
||||
},
|
||||
"news": {
|
||||
"tbm": "nws",
|
||||
"href": "search?q={query}",
|
||||
"name": "News",
|
||||
"selected": false
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
[
|
||||
{"name": "Any time", "value": ""},
|
||||
{"name": "Past hour", "value": "qdr:h"},
|
||||
{"name": "Past 24 hours", "value": "qdr:d"},
|
||||
{"name": "Past week", "value": "qdr:w"},
|
||||
{"name": "Past month", "value": "qdr:m"},
|
||||
{"name": "Past year", "value": "qdr:y"}
|
||||
]
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,260 @@
|
||||
<!--
|
||||
Calculator widget.
|
||||
This file should contain all required
|
||||
CSS, HTML, and JS for it.
|
||||
-->
|
||||
|
||||
<style>
|
||||
#calc-text {
|
||||
background: var(--whoogle-dark-page-bg);
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
text-align: right;
|
||||
font-family: monospace;
|
||||
font-size: 16px;
|
||||
color: var(--whoogle-dark-text);
|
||||
}
|
||||
#prev-equation {
|
||||
text-align: right;
|
||||
}
|
||||
.error-border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
#calc-btns {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
grid-template-rows: repeat(5, 1fr);
|
||||
gap: 5px;
|
||||
}
|
||||
#calc-btns button {
|
||||
background: #313141;
|
||||
color: var(--whoogle-dark-text);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#calc-btns button:hover {
|
||||
background: #414151;
|
||||
}
|
||||
#calc-btns .common {
|
||||
background: #51516a;
|
||||
}
|
||||
#calc-btns .common:hover {
|
||||
background: #61617a;
|
||||
}
|
||||
#calc-btn-0 { grid-row: 5; grid-column: 3; }
|
||||
#calc-btn-1 { grid-row: 4; grid-column: 3; }
|
||||
#calc-btn-2 { grid-row: 4; grid-column: 4; }
|
||||
#calc-btn-3 { grid-row: 4; grid-column: 5; }
|
||||
#calc-btn-4 { grid-row: 3; grid-column: 3; }
|
||||
#calc-btn-5 { grid-row: 3; grid-column: 4; }
|
||||
#calc-btn-6 { grid-row: 3; grid-column: 5; }
|
||||
#calc-btn-7 { grid-row: 2; grid-column: 3; }
|
||||
#calc-btn-8 { grid-row: 2; grid-column: 4; }
|
||||
#calc-btn-9 { grid-row: 2; grid-column: 5; }
|
||||
#calc-btn-EQ { grid-row: 5; grid-column: 5; }
|
||||
#calc-btn-PT { grid-row: 5; grid-column: 4; }
|
||||
#calc-btn-BCK { grid-row: 5; grid-column: 6; }
|
||||
#calc-btn-ADD { grid-row: 4; grid-column: 6; }
|
||||
#calc-btn-SUB { grid-row: 3; grid-column: 6; }
|
||||
#calc-btn-MLT { grid-row: 2; grid-column: 6; }
|
||||
#calc-btn-DIV { grid-row: 1; grid-column: 6; }
|
||||
#calc-btn-CLR { grid-row: 1; grid-column: 5; }
|
||||
#calc-btn-PRC{ grid-row: 1; grid-column: 4; }
|
||||
#calc-btn-RP { grid-row: 1; grid-column: 3; }
|
||||
#calc-btn-LP { grid-row: 1; grid-column: 2; }
|
||||
#calc-btn-ABS { grid-row: 1; grid-column: 1; }
|
||||
#calc-btn-SIN { grid-row: 2; grid-column: 2; }
|
||||
#calc-btn-COS { grid-row: 3; grid-column: 2; }
|
||||
#calc-btn-TAN { grid-row: 4; grid-column: 2; }
|
||||
#calc-btn-SQR { grid-row: 5; grid-column: 2; }
|
||||
#calc-btn-EXP { grid-row: 2; grid-column: 1; }
|
||||
#calc-btn-E { grid-row: 3; grid-column: 1; }
|
||||
#calc-btn-PI { grid-row: 4; grid-column: 1; }
|
||||
#calc-btn-LOG { grid-row: 5; grid-column: 1; }
|
||||
</style>
|
||||
<p id="prev-equation"></p>
|
||||
<div id="calculator-widget">
|
||||
<p id="calc-text">0</p>
|
||||
<div id="calc-btns">
|
||||
<button id="calc-btn-0" class="common">0</button>
|
||||
<button id="calc-btn-1" class="common">1</button>
|
||||
<button id="calc-btn-2" class="common">2</button>
|
||||
<button id="calc-btn-3" class="common">3</button>
|
||||
<button id="calc-btn-4" class="common">4</button>
|
||||
<button id="calc-btn-5" class="common">5</button>
|
||||
<button id="calc-btn-6" class="common">6</button>
|
||||
<button id="calc-btn-7" class="common">7</button>
|
||||
<button id="calc-btn-8" class="common">8</button>
|
||||
<button id="calc-btn-9" class="common">9</button>
|
||||
<button id="calc-btn-EQ" class="common">=</button>
|
||||
<button id="calc-btn-PT" class="common">.</button>
|
||||
<button id="calc-btn-BCK">⬅</button>
|
||||
<button id="calc-btn-ADD">+</button>
|
||||
<button id="calc-btn-SUB">-</button>
|
||||
<button id="calc-btn-MLT">x</button>
|
||||
<button id="calc-btn-DIV">/</button>
|
||||
<button id="calc-btn-CLR">C</button>
|
||||
<button id="calc-btn-PRC">%</button>
|
||||
<button id="calc-btn-RP">)</button>
|
||||
<button id="calc-btn-LP">(</button>
|
||||
<button id="calc-btn-ABS">|x|</button>
|
||||
<button id="calc-btn-SIN">sin</button>
|
||||
<button id="calc-btn-COS">cos</button>
|
||||
<button id="calc-btn-TAN">tan</button>
|
||||
<button id="calc-btn-SQR">√</button>
|
||||
<button id="calc-btn-EXP">^</button>
|
||||
<button id="calc-btn-E">ℇ</button>
|
||||
<button id="calc-btn-PI">π</button>
|
||||
<button id="calc-btn-LOG">log</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// JS does not have this by default.
|
||||
// from https://www.freecodecamp.org/news/how-to-factorialize-a-number-in-javascript-9263c89a4b38/
|
||||
function factorial(num) {
|
||||
if (num < 0)
|
||||
return -1;
|
||||
else if (num === 0)
|
||||
return 1;
|
||||
else {
|
||||
return (num * factorial(num - 1));
|
||||
}
|
||||
}
|
||||
// returns true if the user is currently focused on the calculator widget
|
||||
function usingCalculator() {
|
||||
let activeElement = document.activeElement;
|
||||
while (true) {
|
||||
if (!activeElement) return false;
|
||||
if (activeElement.id === "calculator-wrapper") return true;
|
||||
activeElement = activeElement.parentElement;
|
||||
}
|
||||
}
|
||||
const $ = q => document.querySelectorAll(q);
|
||||
// key bindings for commonly used buttons
|
||||
const keybindings = {
|
||||
"0": "0",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6",
|
||||
"7": "7",
|
||||
"8": "8",
|
||||
"9": "9",
|
||||
"Enter": "EQ",
|
||||
".": "PT",
|
||||
"+": "ADD",
|
||||
"-": "SUB",
|
||||
"*": "MLT",
|
||||
"/": "DIV",
|
||||
"%": "PRC",
|
||||
"c": "CLR",
|
||||
"(": "LP",
|
||||
")": "RP",
|
||||
"Backspace": "BCK",
|
||||
}
|
||||
window.addEventListener("keydown", event => {
|
||||
if (!usingCalculator()) return;
|
||||
if (event.key === "Enter" && document.activeElement.id !== "search-bar")
|
||||
event.preventDefault();
|
||||
if (keybindings[event.key])
|
||||
document.getElementById("calc-btn-" + keybindings[event.key]).click();
|
||||
})
|
||||
// calculates the string
|
||||
const calc = () => {
|
||||
var mathtext = document.getElementById("calc-text");
|
||||
var statement = mathtext.innerHTML
|
||||
// remove empty ()
|
||||
.replace("()", "")
|
||||
// special constants
|
||||
.replace("π", "(Math.PI)")
|
||||
.replace("ℇ", "(Math.E)")
|
||||
// turns 3(1+2) into 3*(1+2) (for example)
|
||||
.replace(/(?<=[0-9\)])(?<=[^+\-x*\/%^])\(/, "x(")
|
||||
// same except reversed
|
||||
.replace(/\)(?=[0-9\(])(?=[^+\-x*\/%^])/, ")x")
|
||||
// replace human friendly x with JS *
|
||||
.replace("x", "*")
|
||||
// trig & misc functions
|
||||
.replace("sin", "Math.sin")
|
||||
.replace("cos", "Math.cos")
|
||||
.replace("tan", "Math.tan")
|
||||
.replace("√", "Math.sqrt")
|
||||
.replace("^", "**")
|
||||
.replace("abs", "Math.abs")
|
||||
.replace("log", "Math.log")
|
||||
;
|
||||
// add any missing )s to the end
|
||||
while(true) if (
|
||||
(statement.match(/\(/g) || []).length >
|
||||
(statement.match(/\)/g) || []).length
|
||||
) statement += ")"; else break;
|
||||
// evaluate the expression.
|
||||
console.log("calculating [" + statement + "]");
|
||||
try {
|
||||
var result = eval(statement);
|
||||
document.getElementById("prev-equation").innerHTML = mathtext.innerHTML + " = ";
|
||||
mathtext.innerHTML = result;
|
||||
mathtext.classList.remove("error-border");
|
||||
} catch (e) {
|
||||
mathtext.classList.add("error-border");
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
const updateCalc = (e) => {
|
||||
// character(s) recieved from button
|
||||
var c = event.target.innerHTML;
|
||||
var mathtext = document.getElementById("calc-text");
|
||||
if (mathtext.innerHTML === "0") mathtext.innerHTML = "";
|
||||
// special cases
|
||||
switch (c) {
|
||||
case "C":
|
||||
// Clear
|
||||
mathtext.innerHTML = "0";
|
||||
break;
|
||||
case "⬅":
|
||||
// Delete
|
||||
mathtext.innerHTML = mathtext.innerHTML.slice(0, -1);
|
||||
if (mathtext.innerHTML.length === 0) {
|
||||
mathtext.innerHTML = "0";
|
||||
}
|
||||
break;
|
||||
case "=":
|
||||
calc()
|
||||
break;
|
||||
case "sin":
|
||||
case "cos":
|
||||
case "tan":
|
||||
case "log":
|
||||
case "√":
|
||||
mathtext.innerHTML += `${c}(`;
|
||||
break;
|
||||
case "|x|":
|
||||
mathtext.innerHTML += "abs("
|
||||
break;
|
||||
case "+":
|
||||
case "-":
|
||||
case "x":
|
||||
case "/":
|
||||
case "%":
|
||||
case "^":
|
||||
if (mathtext.innerHTML.length === 0) mathtext.innerHTML = "0";
|
||||
// prevent typing 2 operators in a row
|
||||
if (mathtext.innerHTML.match(/[+\-x\/%^] $/))
|
||||
mathtext.innerHTML = mathtext.innerHTML.slice(0, -3);
|
||||
mathtext.innerHTML += ` ${c} `;
|
||||
break;
|
||||
default:
|
||||
mathtext.innerHTML += c;
|
||||
}
|
||||
}
|
||||
for (let i of $("#calc-btns button")) {
|
||||
i.addEventListener('click', event => {
|
||||
updateCalc(event);
|
||||
})
|
||||
}
|
||||
</script>
|
@ -1,116 +1,390 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta content="application/xhtml+xml; charset=utf-8" http-equiv="Content-Type"/>
|
||||
<meta content="no-cache" name="Cache-Control"/>
|
||||
<title>
|
||||
</title>
|
||||
<div>
|
||||
<style>
|
||||
a{text-decoration:none;color:inherit}a:hover{text-decoration:underline}a img{border:0}body{font-family:Roboto,Helvetica,Arial,sans-serif;padding:8px;margin:0 auto;max-width:700px;min-width:240px;}.FbhRzb{border-left:thin solid #dadce0;border-right:thin solid #dadce0;border-top:thin solid #dadce0;height:40px;overflow:hidden}.n692Zd{margin-bottom:10px}.cvifge{height:40px;border-spacing:0;width:100%;}.QvGUP{height:40px;padding:0 8px 0 8px;vertical-align:top}.O4cRJf{height:40px;width:100%;padding:0;padding-right:16px}.O1ePr{height:40px;padding:0;vertical-align:top}.kgJEQe{height:36px;width:98px;vertical-align:top;margin-top:4px}.lXLRf{vertical-align:top}.MhzMZd{border:0;vertical-align:middle;font-size:14px;height:40px;padding:0;width:100%;padding-left:16px}.xB0fq{height:40px;border:none;font-size:14px;background-color:#4285f4;color:#fff;padding:0 16px;margin:0;vertical-align:top;cursor:pointer}.xB0fq:focus{border:1px solid #000}.M7pB2{border:thin solid #dadce0;margin:0 0 3px 0;font-size:13px;font-weight:500;height:40px}.euZec{width:100%;height:40px;text-align:center;border-spacing:0}table.euZec td{padding:0;width:25%}.QIqI7{display:inline-block;padding-top:4px;font-weight:bold;color:#4285f4}.EY24We{border-bottom:2px solid #4285f4}.CsQyDc{display:inline-block;color:#70757a}.TuS8Ad{font-size:14px}.HddGcc{padding:8px;color:#70757a}.dzp8ae{font-weight:bold;color:#3c4043}.rEM8G{color:#70757a}.bookcf{table-layout:fixed;width:100%;border-spacing:0}.InWNIe{text-align:center}.uZgmoc{border:thin solid #dadce0;color:#70757a;font-size:14px;text-align:center;table-layout:fixed;width:100%}.frGj1b{display:block;padding:12px 0 12px 0;width:100%}.BnJWBc{text-align:center;padding:6px 0 13px 0;height:35px}.e3goi{vertical-align:top;padding:0;height:180px}.GpQGbf{margin:auto;border-collapse:collapse;border-spacing:0;width:100%}
|
||||
html {
|
||||
font-family: Roboto, Helvetica Neue, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
text-size-adjust: 100%;
|
||||
color: #3c4043;
|
||||
word-wrap: break-word;
|
||||
background-color: #fff;
|
||||
}
|
||||
body {
|
||||
padding: 0 8px;
|
||||
margin: 0 auto;
|
||||
max-width: 736px;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
a img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.FbhRzb {
|
||||
border-left: thin solid #dadce0;
|
||||
border-right: thin solid #dadce0;
|
||||
border-top: thin solid #dadce0;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.n692Zd {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.cvifge {
|
||||
height: 40px;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.QvGUP {
|
||||
height: 40px;
|
||||
padding: 0 8px 0 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.O4cRJf {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
padding-right: 16px;
|
||||
}
|
||||
.O1ePr {
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
.kgJEQe {
|
||||
height: 36px;
|
||||
width: 98px;
|
||||
vertical-align: top;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.lXLRf {
|
||||
vertical-align: top;
|
||||
}
|
||||
.MhzMZd {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
font-size: 14px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
padding-left: 16px;
|
||||
}
|
||||
.xB0fq {
|
||||
height: 40px;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
background-color: #4285f4;
|
||||
color: #fff;
|
||||
padding: 0 16px;
|
||||
margin: 0;
|
||||
vertical-align: top;
|
||||
cursor: pointer;
|
||||
}
|
||||
.xB0fq:focus {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
.M7pB2 {
|
||||
border: thin solid #dadce0;
|
||||
margin: 0 0 3px 0;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
height: 40px;
|
||||
}
|
||||
.euZec {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
border-spacing: 0;
|
||||
}
|
||||
table.euZec td {
|
||||
padding: 0;
|
||||
width: 25%;
|
||||
}
|
||||
.QIqI7 {
|
||||
display: inline-block;
|
||||
padding-top: 4px;
|
||||
font-weight: bold;
|
||||
color: #4285f4;
|
||||
}
|
||||
.EY24We {
|
||||
border-bottom: 2px solid #4285f4;
|
||||
}
|
||||
.CsQyDc {
|
||||
display: inline-block;
|
||||
color: #70757a;
|
||||
}
|
||||
.TuS8Ad {
|
||||
font-size: 14px;
|
||||
}
|
||||
.HddGcc {
|
||||
padding: 8px;
|
||||
color: #70757a;
|
||||
}
|
||||
.dzp8ae {
|
||||
font-weight: bold;
|
||||
color: #3c4043;
|
||||
}
|
||||
.rEM8G {
|
||||
color: #70757a;
|
||||
}
|
||||
.bookcf {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.InWNIe {
|
||||
text-align: center;
|
||||
}
|
||||
.uZgmoc {
|
||||
border: thin solid #dadce0;
|
||||
color: #70757a;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
.frGj1b {
|
||||
display: block;
|
||||
padding: 12px 0 12px 0;
|
||||
width: 100%;
|
||||
}
|
||||
.BnJWBc {
|
||||
text-align: center;
|
||||
padding: 6px 0 13px 0;
|
||||
height: 35px;
|
||||
}
|
||||
.e3goi {
|
||||
vertical-align: top;
|
||||
padding: 0;
|
||||
height: 180px;
|
||||
}
|
||||
.GpQGbf {
|
||||
margin: auto;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.X6ZCif {
|
||||
color: #202124;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 4px;
|
||||
width: 100%;
|
||||
}
|
||||
.TwVfHd {
|
||||
border-radius: 16px;
|
||||
border: thin solid #dadce0;
|
||||
display: inline-block;
|
||||
padding: 8px 8px;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.yekiAe {
|
||||
background-color: #dadce0;
|
||||
}
|
||||
.svla5d {
|
||||
width: 100%;
|
||||
}
|
||||
.ezO2md {
|
||||
border: thin solid #dadce0;
|
||||
padding: 12px 16px 12px 16px;
|
||||
margin-bottom: 10px;
|
||||
font-family: Roboto, Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.TxbwNb {
|
||||
border-spacing: 0;
|
||||
}
|
||||
.K35ahc {
|
||||
width: 100%;
|
||||
}
|
||||
.owohpf {
|
||||
text-align: center;
|
||||
}
|
||||
.RAyV4b {
|
||||
width: 162px;
|
||||
height: 140px;
|
||||
line-height: 140px;
|
||||
overflow: "hidden";
|
||||
text-align: center;
|
||||
}
|
||||
.t0fcAb {
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
.Tor4Ec {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.fYyStc {
|
||||
word-break: break-word;
|
||||
}
|
||||
.ynsChf {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.Fj3V3b {
|
||||
color: #1967d2;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.FrIlee {
|
||||
color: #202124;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.F9iS2e {
|
||||
color: #70757a;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.WMQ2Le {
|
||||
color: #70757a;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.x3G5ab {
|
||||
color: #202124;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.fuLhoc {
|
||||
color: #1967d2;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
}
|
||||
.epoveb {
|
||||
font-size: 32px;
|
||||
line-height: 40px;
|
||||
font-weight: 400;
|
||||
color: #202124;
|
||||
}
|
||||
.dXDvrc {
|
||||
color: #0d652d;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.dloBPe {
|
||||
font-weight: bold;
|
||||
}
|
||||
.YVIcad {
|
||||
color: #70757a;
|
||||
}
|
||||
.JkVVdd {
|
||||
color: #ea4335;
|
||||
}
|
||||
.oXZRFd {
|
||||
color: #ea4335;
|
||||
}
|
||||
.MQHtg {
|
||||
color: #fbbc04;
|
||||
}
|
||||
.pyMRrb {
|
||||
color: #1e8e3e;
|
||||
}
|
||||
.EtTZid {
|
||||
color: #1e8e3e;
|
||||
}
|
||||
.M3vVJe {
|
||||
color: #1967d2;
|
||||
}
|
||||
.qXLe6d {
|
||||
display: block;
|
||||
}
|
||||
.NHQNef {
|
||||
font-style: italic;
|
||||
}
|
||||
.Cb8Z7c {
|
||||
white-space: pre;
|
||||
}
|
||||
a.ZWRArf {
|
||||
text-decoration: none;
|
||||
}
|
||||
a .CVA68e:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
.X6ZCif{color:#202124;font-size:11px;line-height:16px;display:inline-block;padding-top:2px;overflow:hidden;padding-bottom:4px;width:100%}.TwVfHd{border-radius:16px;border:thin solid #dadce0;display:inline-block;padding:8px 8px;margin-right:8px;margin-bottom:4px}.yekiAe{background-color:#dadce0}.svla5d{width:100%}.ezO2md{border:thin solid #dadce0;padding:12px 16px 12px 16px;margin-bottom:10px;font-family:Roboto,Helvetica,Arial,sans-serif}.lIMUZd{font-family:Roboto,Helvetica,Arial,sans-serif}.TxbwNb{border-spacing:0}.K35ahc{width:100%}.owohpf{text-align:center}.RAyV4b{width:162px;height:140px;line-height:140px;overflow:'hidden';text-align:center;}.t0fcAb{text-align:center;margin:auto;vertical-align:middle;width:100%;height:100%;object-fit: contain}.Tor4Ec{padding-top:2px;padding-bottom:8px;}.fYyStc{word-break:break-word}.ynsChf{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.Fj3V3b{color:#1967D2;font-size:14px;line-height:20px}.FrIlee{color:#202124;font-size:11px;line-height:16px}.F9iS2e{color:#70757a;font-size:11px;line-height:16px}.WMQ2Le{color:#70757a;font-size:12px;line-height:16px}.x3G5ab{color:#202124;font-size:12px;line-height:16px}.fuLhoc{color:#1967D2;font-size:18px;line-height:24px}.epoveb{font-size:32px;line-height:40px;font-weight:400;color:#202124}.dXDvrc{color:#0d652d;font-size:14px;line-height:20px;word-wrap:break-word}.dloBPe{font-weight:bold}.YVIcad{color:#70757a}.JkVVdd{color:#ea4335}.oXZRFd{color:#ea4335}.MQHtg{color:#fbbc04}.pyMRrb{color:#1e8e3e}.EtTZid{color:#1e8e3e}.M3vVJe{color:#1967D2}.qXLe6d{display:block}.NHQNef{font-style:italic}.Cb8Z7c{white-space:pre}a.ZWRArf{text-decoration:none}a .CVA68e:hover{text-decoration:underline}
|
||||
</style>
|
||||
<div class="n692Zd">
|
||||
<div class="BnJWBc">
|
||||
<a class="lXLRf" href="/?safe=off&gbv=1&output=images&ie=UTF-8&tbm=isch&sa=X&ved=0ahUKEwjhh7TZyd_vAhWShf0HHeYzCmsQPAgC">
|
||||
<img alt="Google" class="kgJEQe" src="/images/branding/searchlogo/1x/googlelogo_desk_heirloom_color_150x55dp.gif"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="FbhRzb">
|
||||
<form action="/search">
|
||||
<input name="safe" type="hidden" value="off"/>
|
||||
<input name="gbv" type="hidden" value="1"/>
|
||||
<input name="ie" type="hidden" value="ISO-8859-1"/>
|
||||
<input name="tbm" type="hidden" value="isch"/>
|
||||
<input name="oq" type="hidden"/>
|
||||
<input name="aqs" type="hidden"/>
|
||||
<table class="cvifge">
|
||||
<tr>
|
||||
<td class="O4cRJf">
|
||||
<!-- search input -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div class="M7pB2">
|
||||
<!-- search options -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="X6ZCif"> Not present in mobile
|
||||
</div> -->
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<div class="lIMUZd">
|
||||
<table class="By0U9">
|
||||
<!-- correction suggested -->
|
||||
</table>
|
||||
</div>
|
||||
<div class="lIMUZd">
|
||||
<table class="By0U9">
|
||||
<!-- correction suggested -->
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="GpQGbf">
|
||||
{% for i in range((length // 4) + 1) %}
|
||||
<tr>
|
||||
{% for j in range([length - (i*4), 4]|min) %}
|
||||
<td align="center" class="e3goi">
|
||||
<td align="center" class="e3goi">
|
||||
<div class="svla5d">
|
||||
<div>
|
||||
<div class="lIMUZd">
|
||||
<div>
|
||||
<table class="TxbwNb">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ results[(i*4)+j].web_page }}">
|
||||
<div class="RAyV4b">
|
||||
<img alt="" class="t0fcAb" src="{{ results[(i*4)+j].img_tbn }}"/>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ results[(i*4)+j].web_page }}">
|
||||
<div class="Tor4Ec">
|
||||
<span class="qXLe6d x3G5ab">
|
||||
<span class="fYyStc">
|
||||
{{ results[(i*4)+j].domain }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="{{ results[(i*4)+j].img_url }}">
|
||||
<div class="Tor4Ec">
|
||||
<span class="qXLe6d F9iS2e">
|
||||
<span class="fYyStc">
|
||||
{{ view_label }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="lIMUZd">
|
||||
<div>
|
||||
<table class="TxbwNb">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ results[(i*4)+j].web_page }}">
|
||||
<div class="RAyV4b">
|
||||
<img
|
||||
alt=""
|
||||
class="t0fcAb"
|
||||
src="{{ results[(i*4)+j].img_tbn }}"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ results[(i*4)+j].web_page }}">
|
||||
<div class="Tor4Ec">
|
||||
<span class="qXLe6d x3G5ab">
|
||||
<span class="fYyStc">
|
||||
{{ results[(i*4)+j].domain }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="{{ results[(i*4)+j].img_url }}">
|
||||
<div class="Tor4Ec">
|
||||
<span class="qXLe6d F9iS2e">
|
||||
<span class="fYyStc"> {{ view_label }} </span>
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<table class="uZgmoc">
|
||||
<!-- next page object -->
|
||||
</table>
|
||||
<br/>
|
||||
<div class="TuS8Ad">
|
||||
<!-- information about user connection -->
|
||||
<div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<br />
|
||||
</div>
|
||||
|
@ -0,0 +1,71 @@
|
||||
from pathlib import Path
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
# root
|
||||
BASE_DIR = Path(__file__).parent.parent.parent
|
||||
|
||||
def add_ip_card(html_soup: BeautifulSoup, ip: str) -> BeautifulSoup:
|
||||
"""Adds the client's IP address to the search results
|
||||
if query contains keywords
|
||||
|
||||
Args:
|
||||
html_soup: The parsed search result containing the keywords
|
||||
ip: ip address of the client
|
||||
|
||||
Returns:
|
||||
BeautifulSoup
|
||||
|
||||
"""
|
||||
main_div = html_soup.select_one('#main')
|
||||
if main_div:
|
||||
# HTML IP card tag
|
||||
ip_tag = html_soup.new_tag('div')
|
||||
ip_tag['class'] = 'ZINbbc xpd O9g5cc uUPGi'
|
||||
|
||||
# For IP Address html tag
|
||||
ip_address = html_soup.new_tag('div')
|
||||
ip_address['class'] = 'kCrYT ip-address-div'
|
||||
ip_address.string = ip
|
||||
|
||||
# Text below the IP address
|
||||
ip_text = html_soup.new_tag('div')
|
||||
ip_text.string = 'Your public IP address'
|
||||
ip_text['class'] = 'kCrYT ip-text-div'
|
||||
|
||||
# Adding all the above html tags to the IP card
|
||||
ip_tag.append(ip_address)
|
||||
ip_tag.append(ip_text)
|
||||
|
||||
# Insert the element at the top of the result list
|
||||
main_div.insert_before(ip_tag)
|
||||
return html_soup
|
||||
|
||||
def add_calculator_card(html_soup: BeautifulSoup) -> BeautifulSoup:
|
||||
"""Adds the a calculator widget to the search results
|
||||
if query contains keywords
|
||||
|
||||
Args:
|
||||
html_soup: The parsed search result containing the keywords
|
||||
|
||||
Returns:
|
||||
BeautifulSoup
|
||||
"""
|
||||
main_div = html_soup.select_one('#main')
|
||||
if main_div:
|
||||
# absolute path
|
||||
widget_file = open(BASE_DIR / 'app/static/widgets/calculator.html', encoding="utf8")
|
||||
widget_tag = html_soup.new_tag('div')
|
||||
widget_tag['class'] = 'ZINbbc xpd O9g5cc uUPGi'
|
||||
widget_tag['id'] = 'calculator-wrapper'
|
||||
calculator_text = html_soup.new_tag('div')
|
||||
calculator_text['class'] = 'kCrYT ip-address-div'
|
||||
calculator_text.string = 'Calculator'
|
||||
calculator_widget = html_soup.new_tag('div')
|
||||
calculator_widget.append(BeautifulSoup(widget_file, 'html.parser'))
|
||||
calculator_widget['class'] = 'kCrYT ip-text-div'
|
||||
widget_tag.append(calculator_text)
|
||||
widget_tag.append(calculator_widget)
|
||||
main_div.insert_before(widget_tag)
|
||||
widget_file.close()
|
||||
return html_soup
|
@ -0,0 +1,7 @@
|
||||
import os
|
||||
|
||||
optional_dev_tag = ''
|
||||
if os.getenv('DEV_BUILD'):
|
||||
optional_dev_tag = '.dev' + os.getenv('DEV_BUILD')
|
||||
|
||||
__version__ = '0.8.4' + optional_dev_tag
|
@ -0,0 +1,80 @@
|
||||
# can't use mem_limit in a 3.x docker-compose file in non swarm mode
|
||||
# see https://github.com/docker/compose/issues/4513
|
||||
version: "2.4"
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:v2.7"
|
||||
container_name: "traefik"
|
||||
command:
|
||||
#- "--log.level=DEBUG"
|
||||
- "--api.insecure=true"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--entrypoints.websecure.address=:443"
|
||||
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
|
||||
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
|
||||
- "--certificatesresolvers.myresolver.acme.email=change@domain.name"
|
||||
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
|
||||
ports:
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "./letsencrypt:/letsencrypt"
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
|
||||
whoogle-search:
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`change.host.name`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=websecure"
|
||||
- "traefik.http.routers.whoami.tls.certresolver=myresolver"
|
||||
- "traefik.http.services.whoogle-search.loadbalancer.server.port=5000"
|
||||
image: ${WHOOGLE_IMAGE:-benbusby/whoogle-search}
|
||||
container_name: whoogle-search
|
||||
restart: unless-stopped
|
||||
pids_limit: 50
|
||||
mem_limit: 256mb
|
||||
memswap_limit: 256mb
|
||||
# user debian-tor from tor package
|
||||
user: whoogle
|
||||
security_opt:
|
||||
- no-new-privileges
|
||||
cap_drop:
|
||||
- ALL
|
||||
tmpfs:
|
||||
- /config/:size=10M,uid=927,gid=927,mode=1700
|
||||
- /var/lib/tor/:size=15M,uid=927,gid=927,mode=1700
|
||||
- /run/tor/:size=1M,uid=927,gid=927,mode=1700
|
||||
environment: # Uncomment to configure environment variables
|
||||
# Basic auth configuration, uncomment to enable
|
||||
#- WHOOGLE_USER=<auth username>
|
||||
#- WHOOGLE_PASS=<auth password>
|
||||
# Proxy configuration, uncomment to enable
|
||||
#- WHOOGLE_PROXY_USER=<proxy username>
|
||||
#- WHOOGLE_PROXY_PASS=<proxy password>
|
||||
#- WHOOGLE_PROXY_TYPE=<proxy type (http|https|socks4|socks5)
|
||||
#- WHOOGLE_PROXY_LOC=<proxy host/ip>
|
||||
# Site alternative configurations, uncomment to enable
|
||||
# Note: If not set, the feature will still be available
|
||||
# with default values.
|
||||
#- WHOOGLE_ALT_TW=farside.link/nitter
|
||||
#- WHOOGLE_ALT_YT=farside.link/invidious
|
||||
#- WHOOGLE_ALT_IG=farside.link/bibliogram/u
|
||||
#- WHOOGLE_ALT_RD=farside.link/libreddit
|
||||
#- WHOOGLE_ALT_MD=farside.link/scribe
|
||||
#- WHOOGLE_ALT_TL=farside.link/lingva
|
||||
#- WHOOGLE_ALT_IMG=farside.link/rimgo
|
||||
#- WHOOGLE_ALT_WIKI=farside.link/wikiless
|
||||
#- WHOOGLE_ALT_IMDB=farside.link/libremdb
|
||||
#- WHOOGLE_ALT_QUORA=farside.link/quetre
|
||||
# - WHOOGLE_CONFIG_DISABLE=1
|
||||
# - WHOOGLE_CONFIG_SEARCH_LANGUAGE=lang_en
|
||||
# - WHOOGLE_CONFIG_GET_ONLY=1
|
||||
# - WHOOGLE_CONFIG_COUNTRY=FR
|
||||
# - WHOOGLE_CONFIG_PREFERENCES_ENCRYPTED=1
|
||||
# - WHOOGLE_CONFIG_PREFERENCES_KEY="NEEDS_TO_BE_MODIFIED"
|
||||
#env_file: # Alternatively, load variables from whoogle.env
|
||||
#- whoogle.env
|
||||
ports:
|
||||
- 8000:5000
|
Binary file not shown.
Before Width: | Height: | Size: 215 KiB |
Binary file not shown.
After Width: | Height: | Size: 214 KiB |
Binary file not shown.
Before Width: | Height: | Size: 139 KiB |
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
@ -0,0 +1,24 @@
|
||||
https://search.albony.xyz
|
||||
https://search.garudalinux.org
|
||||
https://search.dr460nf1r3.org
|
||||
https://search.nezumi.party
|
||||
https://s.tokhmi.xyz
|
||||
https://search.sethforprivacy.com
|
||||
https://whoogle.dcs0.hu
|
||||
https://whoogle.lunar.icu
|
||||
https://gowogle.voring.me
|
||||
https://whoogle.privacydev.net
|
||||
https://whoogle.hostux.net
|
||||
https://wg.vern.cc
|
||||
https://whoogle.hxvy0.gq
|
||||
https://whoogle.ungovernable.men
|
||||
https://whoogle2.ungovernable.men
|
||||
https://whoogle3.ungovernable.men
|
||||
https://wgl.frail.duckdns.org
|
||||
https://whoogle.no-logs.com
|
||||
https://whoogle.ftw.lol
|
||||
https://whoogle-search--replitcomreside.repl.co
|
||||
https://search.notrustverify.ch
|
||||
https://whoogle.datura.network
|
||||
https://whoogle.yepserver.xyz
|
||||
https://search.snine.nl
|
@ -0,0 +1,5 @@
|
||||
import subprocess
|
||||
|
||||
# A plague upon Replit and all who have built it
|
||||
replit_cmd = "killall -q python3 > /dev/null 2>&1; pip install -r requirements.txt && ./run"
|
||||
subprocess.run(replit_cmd, shell=True)
|
@ -0,0 +1 @@
|
||||
# Place password here. Keep this safe.
|
@ -1,7 +1,33 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
FF_STRING="FascistFirewall 1"
|
||||
|
||||
if [ "$WHOOGLE_TOR_SERVICE" == "0" ]; then
|
||||
echo "Skipping Tor startup..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$WHOOGLE_TOR_FF" == "1" ]; then
|
||||
if (grep -q "$FF_STRING" /etc/tor/torrc); then
|
||||
echo "FascistFirewall feature already enabled."
|
||||
else
|
||||
echo "$FF_STRING" >> /etc/tor/torrc
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "FascistFirewall added to /etc/tor/torrc"
|
||||
else
|
||||
echo "ERROR: Unable to modify /etc/tor/torrc with $FF_STRING."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$(whoami)" != "root" ]; then
|
||||
tor -f /etc/tor/torrc
|
||||
else
|
||||
service tor start
|
||||
if (grep alpine /etc/os-release >/dev/null); then
|
||||
rc-service tor start
|
||||
else
|
||||
service tor start
|
||||
fi
|
||||
fi
|
||||
|
@ -0,0 +1,67 @@
|
||||
import json
|
||||
import pathlib
|
||||
import requests
|
||||
|
||||
lingva = 'https://lingva.ml/api/v1/en'
|
||||
|
||||
|
||||
def format_lang(lang: str) -> str:
|
||||
# Chinese (traditional and simplified) require
|
||||
# a different format for lingva translations
|
||||
if 'zh-' in lang:
|
||||
if lang == 'zh-TW':
|
||||
return 'zh_HANT'
|
||||
return 'zh'
|
||||
|
||||
# Strip lang prefix to leave only the actual
|
||||
# language code (i.e. 'en', 'fr', etc)
|
||||
return lang.replace('lang_', '')
|
||||
|
||||
|
||||
def translate(v: str, lang: str) -> str:
|
||||
# Strip lang prefix to leave only the actual
|
||||
#language code (i.e. "es", "fr", etc)
|
||||
lang = format_lang(lang)
|
||||
|
||||
lingva_req = f'{lingva}/{lang}/{v}'
|
||||
|
||||
response = requests.get(lingva_req).json()
|
||||
|
||||
if 'translation' in response:
|
||||
return response['translation']
|
||||
return ''
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_path = pathlib.Path(__file__).parent.resolve()
|
||||
tl_path = 'app/static/settings/translations.json'
|
||||
|
||||
with open(f'{file_path}/../{tl_path}', 'r+', encoding='utf-8') as tl_file:
|
||||
tl_data = json.load(tl_file)
|
||||
|
||||
# If there are any english translations that don't
|
||||
# exist for other languages, extract them and translate
|
||||
# them now
|
||||
en_tl = tl_data['lang_en']
|
||||
for k, v in en_tl.items():
|
||||
for lang in tl_data:
|
||||
if lang == 'lang_en' or k in tl_data[lang]:
|
||||
continue
|
||||
|
||||
translation = ''
|
||||
if len(k) == 0:
|
||||
# Special case for placeholder text that gets used
|
||||
# for translations without any key present
|
||||
translation = v
|
||||
else:
|
||||
# Translate the string using lingva
|
||||
translation = translate(v, lang)
|
||||
|
||||
if len(translation) == 0:
|
||||
print(f'! Unable to translate {lang}[{k}]')
|
||||
continue
|
||||
print(f'{lang}[{k}] = {translation}')
|
||||
tl_data[lang][k] = translation
|
||||
|
||||
# Write out updated translations json
|
||||
print(json.dumps(tl_data, indent=4, ensure_ascii=False))
|
@ -0,0 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
@ -1,33 +1,37 @@
|
||||
attrs==19.3.0
|
||||
beautifulsoup4==4.10.0
|
||||
cachelib==0.4.1
|
||||
certifi==2020.4.5.1
|
||||
cffi==1.15.0
|
||||
chardet==3.0.4
|
||||
click==8.0.3
|
||||
cryptography==3.3.2
|
||||
Flask==1.1.1
|
||||
Flask-Session==0.4.0
|
||||
idna==2.9
|
||||
itsdangerous==1.1.0
|
||||
Jinja2==2.11.3
|
||||
MarkupSafe==1.1.1
|
||||
more-itertools==8.3.0
|
||||
packaging==20.4
|
||||
pluggy==0.13.1
|
||||
py==1.10.0
|
||||
pycodestyle==2.6.0
|
||||
pycparser==2.19
|
||||
pyOpenSSL==19.1.0
|
||||
pyparsing==2.4.7
|
||||
attrs==22.2.0
|
||||
beautifulsoup4==4.11.2
|
||||
brotli==1.0.9
|
||||
cachelib==0.10.2
|
||||
certifi==2023.7.22
|
||||
cffi==1.15.1
|
||||
chardet==5.1.0
|
||||
click==8.1.3
|
||||
cryptography==3.3.2; platform_machine == 'armv7l'
|
||||
cryptography==42.0.4; platform_machine != 'armv7l'
|
||||
cssutils==2.6.0
|
||||
defusedxml==0.7.1
|
||||
Flask==2.3.2
|
||||
idna==3.4
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.3
|
||||
MarkupSafe==2.1.2
|
||||
more-itertools==9.0.0
|
||||
packaging==23.0
|
||||
pluggy==1.0.0
|
||||
pycodestyle==2.10.0
|
||||
pycparser==2.21
|
||||
pyOpenSSL==19.1.0; platform_machine == 'armv7l'
|
||||
pyOpenSSL==24.0.0; platform_machine != 'armv7l'
|
||||
pyparsing==3.0.9
|
||||
PySocks==1.7.1
|
||||
pytest==6.2.5
|
||||
python-dateutil==2.8.1
|
||||
requests==2.25.1
|
||||
soupsieve==1.9.5
|
||||
stem==1.8.0
|
||||
urllib3==1.26.5
|
||||
waitress==1.4.3
|
||||
wcwidth==0.1.9
|
||||
Werkzeug==0.16.0
|
||||
python-dotenv==0.16.0
|
||||
pytest==7.2.1
|
||||
python-dateutil==2.8.2
|
||||
requests==2.31.0
|
||||
soupsieve==2.4
|
||||
stem==1.8.1
|
||||
urllib3==1.26.18
|
||||
validators==0.22.0
|
||||
waitress==2.1.2
|
||||
wcwidth==0.2.6
|
||||
Werkzeug==3.0.1
|
||||
python-dotenv==0.21.1
|
||||
|
@ -0,0 +1,45 @@
|
||||
[metadata]
|
||||
name = whoogle-search
|
||||
version = attr: app.version.__version__
|
||||
url = https://github.com/benbusby/whoogle-search
|
||||
description = Self-hosted, ad-free, privacy-respecting metasearch engine
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown
|
||||
keywords = search, metasearch, flask, adblock, degoogle, privacy
|
||||
author = Ben Busby
|
||||
author_email = contact@benbusby.com
|
||||
license = MIT
|
||||
classifiers =
|
||||
Programming Language :: Python :: 3
|
||||
License :: OSI Approved :: MIT License
|
||||
Operating System :: OS Independent
|
||||
|
||||
[options]
|
||||
packages = find:
|
||||
include_package_data = True
|
||||
install_requires=
|
||||
beautifulsoup4
|
||||
brotli
|
||||
cssutils
|
||||
cryptography
|
||||
defusedxml
|
||||
Flask
|
||||
python-dotenv
|
||||
requests
|
||||
stem
|
||||
validators
|
||||
waitress
|
||||
|
||||
[options.extras_require]
|
||||
test =
|
||||
pytest
|
||||
python-dateutil
|
||||
dev = pycodestyle
|
||||
|
||||
[options.packages.find]
|
||||
exclude =
|
||||
test*
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
whoogle-search = app.routes:run_app
|
@ -1,34 +0,0 @@
|
||||
import os
|
||||
import setuptools
|
||||
|
||||
long_description = open('README.md', 'r').read()
|
||||
|
||||
requirements = list(open('requirements.txt', 'r'))
|
||||
|
||||
optional_dev_tag = ''
|
||||
if os.getenv('DEV_BUILD'):
|
||||
optional_dev_tag = '.dev' + os.getenv('DEV_BUILD')
|
||||
|
||||
setuptools.setup(
|
||||
author='Ben Busby',
|
||||
author_email='contact@benbusby.com',
|
||||
name='whoogle-search',
|
||||
version='0.7.0' + optional_dev_tag,
|
||||
include_package_data=True,
|
||||
install_requires=requirements,
|
||||
description='Self-hosted, ad-free, privacy-respecting metasearch engine',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
url='https://github.com/benbusby/whoogle-search',
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'whoogle-search=app.routes:run_app',
|
||||
]
|
||||
},
|
||||
packages=setuptools.find_packages(),
|
||||
classifiers=[
|
||||
'Programming Language :: Python :: 3',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Operating System :: OS Independent',
|
||||
],
|
||||
)
|
Loading…
Reference in New Issue