Code Monkey home page Code Monkey logo

hearchco's Introduction

Hearchco

The searching hamster.

Hearchco objectives:

  • speed - written in Go, built with caching and parallelization
  • anonymity; no ads, no tracking
  • customizability - ranking, filtering, separate frontend and backend for modular changes
  • bangs - engine categories with specialized ranking for specialized searches

Requires go version >= 1.22.

hearchco's People

Contributors

aleksasiriski avatar dependabot[bot] avatar k4lizen avatar matijakljajic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hearchco's Issues

[FEAT/SE] Duckduckgo

Describe your feature request
Create a module for parsing Duckduckgo search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] Config file / Env

Describe your feature request
Create a module Koanf config file / env / default config support.

[BUG]

Describe the bug

When colly follows redirects, URL changes:

./main --query="banana death" --visit --max-pages=3 -vv

https://www.mobituaries.com/news/gros-michel/ -> https://mobituaries.com/news/gros-michel/

There is no key-match in the map then.

[FEAT] Add a guide on how to create a search engine module

There should be contribution .md guide on good practices to follow while implementing a module. It would also contain examples of modules that implement specific things, so coding something that was already coded is easier. This would also be remedied with a meta-module though it's still too early for that. This could .md could be very useful, even if a meta-module is implemented.

[BUG] Duckduckgo responds with non-HTML

Describe the bug
Duckduckgo Lite sometimes return junk instead of appropriate HTML, and it isn't even detected as HTML (only visible via colly.OnResponse()). It's probably missing some important headers / cookies.

<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
<!DOCTYPE html>
<html lang="en">

<head>
    <link rel="canonical" href="https://duckduckgo.com/">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1">
    <meta name="referrer" content="origin">
    <title>
        DuckDuckGo
    </title>
    <link rel="preload" href="/font/ProximaNova-Reg-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
    <link rel="preload" href="/font/ProximaNova-Sbold-webfont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
    <link title="DuckDuckGo (Lite)" type="application/opensearchdescription+xml" rel="search" href="//duckduckgo.com/opensearch_lite_v2.xml">
    <link rel="icon" href="//duckduckgo.com/favicon.ico" type="image/x-icon"/>
    <link rel="apple-touch-icon" href="//duckduckgo.com/assets/logo_icon128.v101.png">
    <link rel="image_src" href="//duckduckgo.com/assets/logo_homepage.normal.v101.png"/>
    <link rel="stylesheet" media="handheld, all" href="//duckduckgo.com/dist/l.752fe21877d7fa189c45.css" type="text/css"/>
    <link rel="stylesheet" media="handheld, all" href="//duckduckgo.com/dist/lc.c6848118b611ebd95e10.css" type="text/css"/>
</head>

<body>
    <a name="top"></a>
    <center id="lite_wrapper">
        <br>
        <a class="header-url" href="/lite/">
            <span class="header">DuckDuckGo</span>
        </a>
        <br><br>

        
        <iframe name="ifr" width="0" height="0" border="0" class="hidden"></iframe>
        <form id="img-form" action="//duckduckgo.com/anomaly.js?sv=lite&cc=sre&ti=1709770154&gk=d4cd0dabcf4caa22ad92fab40844c786&p=2fa97ee8a57b4966b51a1e181b31cfe3-d28ba7f73aa54af29083b3845750b09f-9a40d5a0b73b45ee9dbdcac5274551e2-0607c1ad6bd248df96299f6bd20b8339-756c022a0bc44049acfe70aed3c0a798-e9860b4d0aa34079ba1d6a82db7556df-2e47e4f9fca8458ab80827a3fd7fe70f-08a83586b13a4ecb83c65c9c01860556-2490032d6cbc498c9b78435c2fb7c1c4&q=facebook&o=zOlLvocOJncD0uKwUlo8XBqH61f9pxHtJIUCZHlu3uM%3D%0A&r=euw" target="ifr" method="POST"></form>
        <form id="challenge-form" action="//duckduckgo.com/anomaly.js?sv=lite&cc=sre&st=1709770154&gk=d4cd0dabcf4caa22ad92fab40844c786&p=2fa97ee8a57b4966b51a1e181b31cfe3-d28ba7f73aa54af29083b3845750b09f-9a40d5a0b73b45ee9dbdcac5274551e2-0607c1ad6bd248df96299f6bd20b8339-756c022a0bc44049acfe70aed3c0a798-e9860b4d0aa34079ba1d6a82db7556df-2e47e4f9fca8458ab80827a3fd7fe70f-08a83586b13a4ecb83c65c9c01860556-2490032d6cbc498c9b78435c2fb7c1c4&q=facebook&o=zOlLvocOJncD0uKwUlo8XBqH61f9pxHtJIUCZHlu3uM%3D%0A&r=euw" method="POST">
            <div class="anomaly-modal__mask">
                <div class="anomaly-modal__modal " data-testid="anomaly-modal">
                    <div class="anomaly-modal__title">Unfortunately, bots use DuckDuckGo too.</div>
                    <div class="anomaly-modal__description">Please complete the following challenge to confirm this search was made by a human.</div>
                    <div class="anomaly-modal__instructions">Select all squares containing a duck:</div>
                    <div class="anomaly-modal__puzzle-margins">
                        <div class="anomaly-modal__puzzle">
                            
                                <div class="anomaly-modal__box" data-index="0">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="2fa97ee8a57b4966b51a1e181b31cfe3" form="img-form" data-testid="anomaly-modal-tile-0">
                                        <label class="" for="image-check_2fa97ee8a57b4966b51a1e181b31cfe3">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_2fa97ee8a57b4966b51a1e181b31cfe3" id="image-check_2fa97ee8a57b4966b51a1e181b31cfe3">
                                            <img class="anomaly-modal__image" alt=" " id="image-2fa97ee8a57b4966b51a1e181b31cfe3" src="../assets/anomaly/images/challenge/2fa97ee8a57b4966b51a1e181b31cfe3.jpg" data-id="2fa97ee8a57b4966b51a1e181b31cfe3.jpg" data-testid="anomaly-modal-image-0"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="1">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="d28ba7f73aa54af29083b3845750b09f" form="img-form" data-testid="anomaly-modal-tile-1">
                                        <label class="" for="image-check_d28ba7f73aa54af29083b3845750b09f">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_d28ba7f73aa54af29083b3845750b09f" id="image-check_d28ba7f73aa54af29083b3845750b09f">
                                            <img class="anomaly-modal__image" alt=" " id="image-d28ba7f73aa54af29083b3845750b09f" src="../assets/anomaly/images/challenge/d28ba7f73aa54af29083b3845750b09f.jpg" data-id="d28ba7f73aa54af29083b3845750b09f.jpg" data-testid="anomaly-modal-image-1"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="2">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="9a40d5a0b73b45ee9dbdcac5274551e2" form="img-form" data-testid="anomaly-modal-tile-2">
                                        <label class="" for="image-check_9a40d5a0b73b45ee9dbdcac5274551e2">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_9a40d5a0b73b45ee9dbdcac5274551e2" id="image-check_9a40d5a0b73b45ee9dbdcac5274551e2">
                                            <img class="anomaly-modal__image" alt=" " id="image-9a40d5a0b73b45ee9dbdcac5274551e2" src="../assets/anomaly/images/challenge/9a40d5a0b73b45ee9dbdcac5274551e2.jpg" data-id="9a40d5a0b73b45ee9dbdcac5274551e2.jpg" data-testid="anomaly-modal-image-2"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="3">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="0607c1ad6bd248df96299f6bd20b8339" form="img-form" data-testid="anomaly-modal-tile-3">
                                        <label class="" for="image-check_0607c1ad6bd248df96299f6bd20b8339">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_0607c1ad6bd248df96299f6bd20b8339" id="image-check_0607c1ad6bd248df96299f6bd20b8339">
                                            <img class="anomaly-modal__image" alt=" " id="image-0607c1ad6bd248df96299f6bd20b8339" src="../assets/anomaly/images/challenge/0607c1ad6bd248df96299f6bd20b8339.jpg" data-id="0607c1ad6bd248df96299f6bd20b8339.jpg" data-testid="anomaly-modal-image-3"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="4">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="756c022a0bc44049acfe70aed3c0a798" form="img-form" data-testid="anomaly-modal-tile-4">
                                        <label class="" for="image-check_756c022a0bc44049acfe70aed3c0a798">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_756c022a0bc44049acfe70aed3c0a798" id="image-check_756c022a0bc44049acfe70aed3c0a798">
                                            <img class="anomaly-modal__image" alt=" " id="image-756c022a0bc44049acfe70aed3c0a798" src="../assets/anomaly/images/challenge/756c022a0bc44049acfe70aed3c0a798.jpg" data-id="756c022a0bc44049acfe70aed3c0a798.jpg" data-testid="anomaly-modal-image-4"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="5">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="e9860b4d0aa34079ba1d6a82db7556df" form="img-form" data-testid="anomaly-modal-tile-5">
                                        <label class="" for="image-check_e9860b4d0aa34079ba1d6a82db7556df">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_e9860b4d0aa34079ba1d6a82db7556df" id="image-check_e9860b4d0aa34079ba1d6a82db7556df">
                                            <img class="anomaly-modal__image" alt=" " id="image-e9860b4d0aa34079ba1d6a82db7556df" src="../assets/anomaly/images/challenge/e9860b4d0aa34079ba1d6a82db7556df.jpg" data-id="e9860b4d0aa34079ba1d6a82db7556df.jpg" data-testid="anomaly-modal-image-5"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="6">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="2e47e4f9fca8458ab80827a3fd7fe70f" form="img-form" data-testid="anomaly-modal-tile-6">
                                        <label class="" for="image-check_2e47e4f9fca8458ab80827a3fd7fe70f">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_2e47e4f9fca8458ab80827a3fd7fe70f" id="image-check_2e47e4f9fca8458ab80827a3fd7fe70f">
                                            <img class="anomaly-modal__image" alt=" " id="image-2e47e4f9fca8458ab80827a3fd7fe70f" src="../assets/anomaly/images/challenge/2e47e4f9fca8458ab80827a3fd7fe70f.jpg" data-id="2e47e4f9fca8458ab80827a3fd7fe70f.jpg" data-testid="anomaly-modal-image-6"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="7">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="08a83586b13a4ecb83c65c9c01860556" form="img-form" data-testid="anomaly-modal-tile-7">
                                        <label class="" for="image-check_08a83586b13a4ecb83c65c9c01860556">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_08a83586b13a4ecb83c65c9c01860556" id="image-check_08a83586b13a4ecb83c65c9c01860556">
                                            <img class="anomaly-modal__image" alt=" " id="image-08a83586b13a4ecb83c65c9c01860556" src="../assets/anomaly/images/challenge/08a83586b13a4ecb83c65c9c01860556.jpg" data-id="08a83586b13a4ecb83c65c9c01860556.jpg" data-testid="anomaly-modal-image-7"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                                <div class="anomaly-modal__box" data-index="8">
                                    
                                    <button type="submit" class="anomaly-modal__image_btn" name="img_click" value="2490032d6cbc498c9b78435c2fb7c1c4" form="img-form" data-testid="anomaly-modal-tile-8">
                                        <label class="" for="image-check_2490032d6cbc498c9b78435c2fb7c1c4">
                                            <input type="checkbox" class="anomaly-modal__check" name="image-check_2490032d6cbc498c9b78435c2fb7c1c4" id="image-check_2490032d6cbc498c9b78435c2fb7c1c4">
                                            <img class="anomaly-modal__image" alt=" " id="image-2490032d6cbc498c9b78435c2fb7c1c4" src="../assets/anomaly/images/challenge/2490032d6cbc498c9b78435c2fb7c1c4.jpg" data-id="2490032d6cbc498c9b78435c2fb7c1c4.jpg" data-testid="anomaly-modal-image-8"></img>
                                        </label>
                                        <div class="anomaly-modal__overlay"></div>
                                    </button>
                                    
                                    
                                </div>
                            
                        </div>
                    </div>
                    <div class="anomaly-modal__controls">
                        <button name="challenge-submit" class="btn btn--primary anomaly-modal__submit js-anomaly-modal-submit" form="challenge-form" value="d4cd0dabcf4caa22ad92fab40844c786" >Submit</button>
                        <p></p>
                        <input class="feedback-toggle" type="checkbox" id="feedback" unchecked />
                        <label for="feedback" class="feedback-text">Images not loading?</label>
                        <div class="feedback-content">
                            <label class="feedback-instructions">Please email the following code to:</label>
                            <p class="feedback-instructions">[email protected]</p>
                            <p><label class="feedback-instructions">Code: d4cd0dabcf4caa22ad92fab40844c786</label></p>
                        </div>
                    </div>
            </div>
        </form>
        

        

        

        


        <br>
        <p class='html-only'>
            <!--    This is the Lite version. Get the full-JS version <a href="https://duckduckgo.com/">here</a>. //-->
        </p>
    </center>
    
        <img src="//duckduckgo.com/t/tqadb?6369835&amp;s=lite&amp;iadb=0&amp;p=2fa97ee8a57b4966b51a1e181b31cfe3-d28ba7f73aa54af29083b3845750b09f-9a40d5a0b73b45ee9dbdcac5274551e2-0607c1ad6bd248df96299f6bd20b8339-756c022a0bc44049acfe70aed3c0a798-e9860b4d0aa34079ba1d6a82db7556df-2e47e4f9fca8458ab80827a3fd7fe70f-08a83586b13a4ecb83c65c9c01860556-2490032d6cbc498c9b78435c2fb7c1c4&amp;r=euw&amp;o=zOlLvocOJncD0uKwUlo8XBqH61f9pxHtJIUCZHlu3uM%3D%0A&amp;gk=d4cd0dabcf4caa22ad92fab40844c786&amp;c=dadb&amp;i=-1&amp;sc=1&amp;cc=sre&amp;e=0"/>
    
    
    
    
    

</body>

</html>

[FEAT/SE] Swisscows

Describe your feature request
Create a module for parsing Swisscows search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] Supported Options Wiki Page

Describe your feature request
There should be a wiki page that details which search engines have which options supported, and the details/specificities of those options.

[FEAT/SE] Qwant

Describe your feature request
Create a module for parsing Qwant search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] Cache (pebble and redis)

Describe your feature request
Create a caching interface that operates as pebble or redis cache.

Screenshots
N/A

Additional context
This will be used to store query as keys and results as values.

[FEAT/SE] Google

Describe your feature request
Create a module for parsing Google search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Bing

Describe your feature request
Create a module for parsing Bing search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Metager

Describe your feature request
Create a module for parsing Metager search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Meta module

Describe your feature request
Meta module for scraping search engines

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] API

Describe your feature request
Create API using Gin Gonic, to server request on /search etc.

Screenshots
N/A

Additional context
N/A

[FEAT/SE] Mojeek

Describe your feature request
Create a module for parsing Mojeek search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Etoolsch

Describe your feature request
Create a module for parsing Etoolsch search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Yep

Describe your feature request
Create a module for parsing Yep search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] Rotating proxy

Describe your feature request
Create a network of rotating proxies for avoiding rate limiting and throttling.

Additional context
Heavily test if this slows down the search (since it has added network latency). It may not be worth it, but instead deploy more instances in the same region.

[FEAT] Dev Dockerfile and build docs

Describe your feature request
Create a Dockerfile for building the project locally. Also create documentation for bootstrapping the project and hosting it.

[FEAT/SE] BASE

Describe your feature request
Create a module for parsing BASE search results

[FEAT] SE Timeouts

Describe your feature request
Add timeouts to all search engines, allowing for consistent time to return results.

Additional context
1s seems to be the sweet spot for most engines to return enough results.

[FEAT/SE] SearX(NG)

Describe your feature request
Create a module for parsing SearX and SearXNG search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Startpage

Describe your feature request
Create a module for parsing Startpage search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT/SE] Wiby

Describe your feature request
Create a module for parsing Wiby search results

[FEAT] All regions locale option

Describe your feature request
Some engines support "all regions" as a locale option. We currently default to en_US if no locale option is set by the user. The "all regions" should probably be the default if possible.

[FEAT/SE] Presearch

Describe your feature request
Create a module for parsing Presearch search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] Lowest latency search engine from a crawler group

Describe your feature request
Create an algorithm for choosing the lowest latency search engine out from a "search engine group". It must be a background task and not run when searching for results. Sane defaults are important

Additional context
Example: Google, Brave and Startpage belong to the "Google search engine results" group, pick and use only the lowest latency one from that group. The default order would be Google -> Brave -> Startpage, and it should be rearranged by lowest latency in a background task.

Testing
Is this even needed when timeouts are applied?

[FEAT/SE] Yahoo

Describe your feature request
Create a module for parsing Yahoo search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[BUG] Getting no results

Describe the bug
Sometimes when searching no results are given, a refresh sometimes fixes it but it maybe getting cached so adding a useless char at the end gets the results.

[FEAT] Search only cache / Dont search cache

Describe your feature request

  • Add the option to search without looking at cache for a particular search
  • Add the option to search only from cache for a particular search
    • This function could look into cache without hashing, which would allow to receive the query already hashed thus making only the first instance know the original query in a distributed setup (when one instance asked other to look into cache)

[FEAT/SE] Brave

Describe your feature request
Create a module for parsing Brave search results

Screenshots
If applicable, add screenshots to help explain your request.

Additional context
Add any other context about the problem here.

[FEAT] Google/Startpage non-english results

Describe your feature request
Google/Startpage support locale settings for some places, implement them. Since they don't support every region, this should be commented on in their supported options wiki page (#190 )

[FEAT] Add a persistent cookiejar

Some search engines like cookies (e.g. Yandex, Google), by having a persistent cookiejar, it would be possible to send requests that more resemble those of someone that is using a browser.

[BUG] Category isn't accounted for in the cache

Describe the bug
When searching with query it gets cached by default but the cache is category independant, so by searching "cat" in general search, when requesting "cat" with image search you get general results, not image results. This applies to all categories.

To Reproduce
Search something with the default cache enabled mode, afterwards search the same query with a different category.

Expected behavior
Categories should be a part of the cache string key.

[FEAT] More DB options

Describe your feature request

Additional context
Badger replaces pebble entirely and either DynamoDB or KV may be used in future production releases of Hearchco.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.