From 3823ccfcbaf19be012c1c444baffa774a7af1aae Mon Sep 17 00:00:00 2001 From: Dan Pavlov Date: Sat, 15 Oct 2022 18:04:47 +0100 Subject: [PATCH 01/16] added functionality to add custom search engines --- NOTICE.md | 1 + examples/custom_engine.py | 5 +++++ setup.py | 2 +- src/searchor/__init__.py | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 examples/custom_engine.py diff --git a/NOTICE.md b/NOTICE.md index 399428b..0d8c2ca 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -3,5 +3,6 @@ Searchor is dependent on a lot of different modules in Searchor's codebase. This notice links modules's licenses here that were able to be found that Searchor is dependent on. [`pyperclip`](https://github.com/asweigart/pyperclip/blob/master/LICENSE.txt) +[`aenum`](https://github.com/ethanfurman/aenum/blob/master/aenum/LICENSE) Don't see a module's license here but you know the license URL of the module? [Submit a pull request](https://github.com/ArjunSharda/Searchor/pulls)! diff --git a/examples/custom_engine.py b/examples/custom_engine.py new file mode 100644 index 0000000..54e3e9f --- /dev/null +++ b/examples/custom_engine.py @@ -0,0 +1,5 @@ +from searchor import Engine + +Engine.new("Custom", "https://www.example.com/search?q=") + +print(Engine.Custom.search("Hello, World!")) diff --git a/setup.py b/setup.py index 1d53d75..47f0847 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ python_requires=">=3.7, <4", - install_requires=["pyperclip"], + install_requires=["pyperclip", "aenum"], # List additional groups of dependencies here (e.g. development # dependencies). Users will be able to install these using the "extras" diff --git a/src/searchor/__init__.py b/src/searchor/__init__.py index 6618bf7..eecf0a6 100644 --- a/src/searchor/__init__.py +++ b/src/searchor/__init__.py @@ -1,6 +1,7 @@ from urllib.parse import quote from webbrowser import open_new_tab from enum import Enum, unique +from aenum import extend_enum import pyperclip @@ -104,6 +105,9 @@ class Engine(Enum): Yandex = "https://yandex.com/search/?text={query}" Youtube = "https://www.youtube.com/results?search_query={query}" + def new(engine_name, base_url): + extend_enum(Engine, engine_name, base_url + "{query}") + def search(self, query, open_web=False, copy_url=False, additional_queries: dict = None): url = self.value.format(query=quote(query, safe="")) if additional_queries: From 74fdeb451853de95bc33b303382b79e0309d760d Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Sat, 15 Oct 2022 16:11:22 -0500 Subject: [PATCH 02/16] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8663b80..21a6464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "searchor" -version = "2.3.2" +version = "2.4.0" authors = [ { name="Arjun Sharda", email="sharda.aj17@gmail.com" }, { name="William Jackson", email="william@kegnh.com" }, From d3cadde59852f49da2a60cf625474b5e840d7259 Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Sat, 15 Oct 2022 16:12:24 -0500 Subject: [PATCH 03/16] Update setup.py --- setup.py | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/setup.py b/setup.py index 1d53d75..b21a1ba 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,11 @@ import pathlib project_dir = pathlib.Path(__file__).parent.resolve() - -# Get the long description from the README file long_description = (project_dir / "README.md").read_text(encoding="utf-8") setup( name="searchor", - version="2.3.2", + version="2.4.0", description="⚡️ Quick and easy search engine queries.", long_description=long_description, long_description_content_type="text/markdown", @@ -21,41 +19,16 @@ "Operating System :: OS Independent", ], - #keywords="sample, setuptools, development", package_dir={"": "src"}, - # You can just specify package directories manually here if your project is - # simple. Or you can use find_packages(). - # - # Alternatively, if you just want to distribute a single Python file, use - # the `py_modules` argument instead as follows, which will expect a file - # called `my_module.py` to exist: - # - # py_modules=["my_module"], - # packages=find_packages(where="src"), # Required python_requires=">=3.7, <4", - install_requires=["pyperclip"], - - # List additional groups of dependencies here (e.g. development - # dependencies). Users will be able to install these using the "extras" - # syntax, for example: - # - # $ pip install sampleproject[dev] - # - # Similar to `install_requires` above, these must be valid existing - # projects. - - #extras_require={ # Optional - # "dev": ["check-manifest"], - # "test": ["coverage"], - #}, + install_requires=["pyperclip", "click"], - # For example, the following would provide a command called `sample` which - # executes the function `main` from this package when invoked: - entry_points={ # Optional + + entry_points={ "console_scripts": [ "searchor=searchor.main:cli", ], From 397d7a3b6609d90ae64e3d470f26b82c48ebebbe Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Sat, 15 Oct 2022 16:35:08 -0500 Subject: [PATCH 04/16] Update SUPPORTED_OPTIONS.md --- examples/cli/SUPPORTED_OPTIONS.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/examples/cli/SUPPORTED_OPTIONS.md b/examples/cli/SUPPORTED_OPTIONS.md index ab76365..d253c6f 100644 --- a/examples/cli/SUPPORTED_OPTIONS.md +++ b/examples/cli/SUPPORTED_OPTIONS.md @@ -1,9 +1,24 @@ # Supported Options -Searchor uses all of the Engines listed in the __init__.py in the CLI as well! +This is a list of all the official supported CLI options of Searchor. -# Copy URL -You can do `$ searchor Google "Hello World!" --copy as a example` +# Normal ✅ +```shell +$ searchor Yahoo "Hello World!" + +``` + +# Copy URL ✅ +```shell +$ searchor Google "Hello World!" --copy +``` + +# Open Web ✅ + + Example + + +```shell +$ searchor Target "Hello World!" --open +``` -# Open Web -You can do `$ searchor Target "Hello World!" --open as a example` From 998f606b1e2613f12eba0e993abb1b5b0bb1812b Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Sun, 16 Oct 2022 08:15:23 -0500 Subject: [PATCH 05/16] Update NOTICE.md --- NOTICE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NOTICE.md b/NOTICE.md index 399428b..0023ca9 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -3,5 +3,6 @@ Searchor is dependent on a lot of different modules in Searchor's codebase. This notice links modules's licenses here that were able to be found that Searchor is dependent on. [`pyperclip`](https://github.com/asweigart/pyperclip/blob/master/LICENSE.txt) +[`click`](https://github.com/pallets/click/blob/main/LICENSE.rst) Don't see a module's license here but you know the license URL of the module? [Submit a pull request](https://github.com/ArjunSharda/Searchor/pulls)! From 6a3a94cdf1bac42b6fc1042e58186c0cbbf2e21d Mon Sep 17 00:00:00 2001 From: Kalariya Shyamkumar <30364738+shyam-3110@users.noreply.github.com> Date: Tue, 18 Oct 2022 10:20:34 +0530 Subject: [PATCH 06/16] added reuters search query --- src/searchor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/searchor/__init__.py b/src/searchor/__init__.py index 6618bf7..9cfb76a 100644 --- a/src/searchor/__init__.py +++ b/src/searchor/__init__.py @@ -79,6 +79,7 @@ class Engine(Enum): Quora = "https://www.quora.com/search?q={query}" Reddit = "https://www.reddit.com/search/?q={query}" Replit = "https://replit.com/search?q={query}" + Reuters = "https://www.reuters.com/search/news?blob={query}" Samsung = "https://www.samsung.com/us/search/searchMain/?listType=g&searchTerm={query}" Spotify = "https://open.spotify.com/search/{query}" StackOverflow = "https://www.stackoverflow.com/search?q={query}" From 2e3fd742fe059396874603ba1857c643f53beb80 Mon Sep 17 00:00:00 2001 From: fr4nkln11 Date: Thu, 20 Oct 2022 01:19:50 +0100 Subject: [PATCH 07/16] add as a dependency for the cli --- setup.py | 2 +- src/searchor/main.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 1d53d75..e5d7578 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ python_requires=">=3.7, <4", - install_requires=["pyperclip"], + install_requires=["pyperclip", "click"], # List additional groups of dependencies here (e.g. development # dependencies). Users will be able to install these using the "extras" diff --git a/src/searchor/main.py b/src/searchor/main.py index f4d45d3..cd5d246 100644 --- a/src/searchor/main.py +++ b/src/searchor/main.py @@ -1,8 +1,11 @@ import click from searchor import Engine +@click.group() +def cli(): + pass -@click.command() +@cli.command() @click.option( "-o", "--open", @@ -21,7 +24,7 @@ ) @click.argument("engine") @click.argument("query") -def cli(engine, query, open, copy): +def run(engine, query, open, copy): click.echo( eval(f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})") ) @@ -30,6 +33,9 @@ def cli(engine, query, open, copy): if copy: click.echo("link copied to clipboard") +@cli.command() +def history(): + click.echo("history command, coming soon") if __name__ == "__main__": cli() From da4fd235abceead95bebc66ad97b356ceab9bea9 Mon Sep 17 00:00:00 2001 From: fr4nkln11 Date: Thu, 20 Oct 2022 19:15:43 +0100 Subject: [PATCH 08/16] new history module for history command, and fix: exception handling for AttributeError in cli --- src/searchor/history.py | 13 +++++++++++++ src/searchor/main.py | 20 ++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/searchor/history.py diff --git a/src/searchor/history.py b/src/searchor/history.py new file mode 100644 index 0000000..c665bbd --- /dev/null +++ b/src/searchor/history.py @@ -0,0 +1,13 @@ +import os +import os.path + +DATA_PATH = os.path.join(os.getenv("HOME"), ".searchor-cli", "history.json") + +def update(query): + pass + +def clear(): + pass + +def read(): + pass \ No newline at end of file diff --git a/src/searchor/main.py b/src/searchor/main.py index cd5d246..c96c869 100644 --- a/src/searchor/main.py +++ b/src/searchor/main.py @@ -1,5 +1,6 @@ import click from searchor import Engine +import searchor.history as sh @click.group() def cli(): @@ -24,18 +25,21 @@ def cli(): ) @click.argument("engine") @click.argument("query") -def run(engine, query, open, copy): - click.echo( - eval(f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})") - ) - if open: - click.echo("opening browser...") - if copy: - click.echo("link copied to clipboard") +def search(engine, query, open, copy): + try: + result = eval(f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})") + click.echo(result) + if open: + click.echo("opening browser...") + if copy: + click.echo("link copied to clipboard") + except AttributeError: + click.echo(f"{engine} is not a recognized search engine") @cli.command() def history(): click.echo("history command, coming soon") + click.echo(sh.DATA_PATH) if __name__ == "__main__": cli() From 236f1449ec69a1750a9c3c93a5f5d8432dcc76bc Mon Sep 17 00:00:00 2001 From: fr4nkln11 Date: Fri, 21 Oct 2022 12:20:32 +0100 Subject: [PATCH 09/16] add --clear option to history command --- src/searchor/history.py | 37 ++++++++++++++++++++++++++++++------- src/searchor/main.py | 27 +++++++++++++++++++-------- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/searchor/history.py b/src/searchor/history.py index c665bbd..c956ecb 100644 --- a/src/searchor/history.py +++ b/src/searchor/history.py @@ -1,13 +1,36 @@ import os +import json import os.path +from datetime import datetime -DATA_PATH = os.path.join(os.getenv("HOME"), ".searchor-cli", "history.json") - -def update(query): - pass +DATA_PATH = os.path.join(os.getenv("HOME"), ".searchor-history.json") +tmp = { + "searches":[] + } +def update(engine, query, url): + search_data = { + "url": url, + "engine": engine, + "query": query + } + + if not os.path.exists(DATA_PATH): # check if data file does not exist + with open(DATA_PATH, 'w') as history_file: + json.dump(tmp, history_file) #create file if it does not exist + with open(DATA_PATH, '+r') as history_file: + history_data = json.load(history_file) + history_data["searches"].append(search_data) + history_file.seek(0) + json.dump(history_data, history_file, indent=4) + def clear(): - pass + if os.path.exists(DATA_PATH): + with open(DATA_PATH, 'w') as history_file: + json.dump(tmp, history_file) -def read(): - pass \ No newline at end of file +def view(): + with open(DATA_PATH, "+r") as history_file: + history_data = json.load(history_file) + for s in history_data["searches"]: + print(s["url"]) \ No newline at end of file diff --git a/src/searchor/main.py b/src/searchor/main.py index c96c869..572e7b8 100644 --- a/src/searchor/main.py +++ b/src/searchor/main.py @@ -1,6 +1,6 @@ import click from searchor import Engine -import searchor.history as sh +import searchor.history @click.group() def cli(): @@ -27,19 +27,30 @@ def cli(): @click.argument("query") def search(engine, query, open, copy): try: - result = eval(f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})") - click.echo(result) + url = eval(f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})") + click.echo(url) + searchor.history.update(engine, query, url) if open: click.echo("opening browser...") if copy: click.echo("link copied to clipboard") - except AttributeError: - click.echo(f"{engine} is not a recognized search engine") + except: + click.echo(f"engine doesn't exist") @cli.command() -def history(): - click.echo("history command, coming soon") - click.echo(sh.DATA_PATH) +@click.option( + "-c", + "--clear", + is_flag=True, + default=False, + show_default=True, + help="clears the search history", +) +def history(clear): + if clear: + searchor.history.clear() + else: + searchor.history.view() if __name__ == "__main__": cli() From 99b6d3e1ddf082ade1478c9a061607348c0a9d0e Mon Sep 17 00:00:00 2001 From: fr4nkln11 Date: Fri, 21 Oct 2022 12:41:34 +0100 Subject: [PATCH 10/16] add time to history data --- src/searchor/history.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/searchor/history.py b/src/searchor/history.py index c956ecb..e3054d6 100644 --- a/src/searchor/history.py +++ b/src/searchor/history.py @@ -12,7 +12,8 @@ def update(engine, query, url): search_data = { "url": url, "engine": engine, - "query": query + "query": query, + "time": str(datetime.today().strftime("%I:%M %p")) } if not os.path.exists(DATA_PATH): # check if data file does not exist @@ -32,5 +33,5 @@ def clear(): def view(): with open(DATA_PATH, "+r") as history_file: history_data = json.load(history_file) - for s in history_data["searches"]: - print(s["url"]) \ No newline at end of file + for search in history_data["searches"]: + print(f"{search['time']}: {search['url']}") \ No newline at end of file From 917bf28934ae6d2530aaa0b57ff6172a47ea65e2 Mon Sep 17 00:00:00 2001 From: fr4nkln11 Date: Fri, 21 Oct 2022 16:33:32 +0100 Subject: [PATCH 11/16] minor fixes --- src/searchor/__init__.py | 11 +++++++---- src/searchor/history.py | 33 +++++++++++++++++---------------- src/searchor/main.py | 12 +++++++++--- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/searchor/__init__.py b/src/searchor/__init__.py index 6618bf7..8d939c4 100644 --- a/src/searchor/__init__.py +++ b/src/searchor/__init__.py @@ -4,7 +4,7 @@ import pyperclip -@unique +@unique class Engine(Enum): Accuweather = "https://www.accuweather.com/en/search-locations?query={query}" AlternativeTo = "https://alternativeto.net/browse/search/?q={query}" @@ -79,7 +79,9 @@ class Engine(Enum): Quora = "https://www.quora.com/search?q={query}" Reddit = "https://www.reddit.com/search/?q={query}" Replit = "https://replit.com/search?q={query}" - Samsung = "https://www.samsung.com/us/search/searchMain/?listType=g&searchTerm={query}" + Samsung = ( + "https://www.samsung.com/us/search/searchMain/?listType=g&searchTerm={query}" + ) Spotify = "https://open.spotify.com/search/{query}" StackOverflow = "https://www.stackoverflow.com/search?q={query}" Steam = "https://store.steampowered.com/search/?term={query}" @@ -104,7 +106,9 @@ class Engine(Enum): Yandex = "https://yandex.com/search/?text={query}" Youtube = "https://www.youtube.com/results?search_query={query}" - def search(self, query, open_web=False, copy_url=False, additional_queries: dict = None): + def search( + self, query, open_web=False, copy_url=False, additional_queries: dict = None + ): url = self.value.format(query=quote(query, safe="")) if additional_queries: url += ("?" if "?" not in self.value.split("/")[-1] else "&") + "&".join( @@ -118,4 +122,3 @@ def search(self, query, open_web=False, copy_url=False, additional_queries: dict pyperclip.copy(url) return url - diff --git a/src/searchor/history.py b/src/searchor/history.py index e3054d6..de864dc 100644 --- a/src/searchor/history.py +++ b/src/searchor/history.py @@ -4,34 +4,35 @@ from datetime import datetime DATA_PATH = os.path.join(os.getenv("HOME"), ".searchor-history.json") -tmp = { - "searches":[] - } +tmp = {"searches": []} + def update(engine, query, url): search_data = { - "url": url, - "engine": engine, - "query": query, - "time": str(datetime.today().strftime("%I:%M %p")) + "url": url, + "engine": engine, + "query": query, + "time": str(datetime.today().strftime("%I:%M %p")), } - - if not os.path.exists(DATA_PATH): # check if data file does not exist - with open(DATA_PATH, 'w') as history_file: - json.dump(tmp, history_file) #create file if it does not exist - with open(DATA_PATH, '+r') as history_file: + + if not os.path.exists(DATA_PATH): # check if data file does not exist + with open(DATA_PATH, "w") as history_file: + json.dump(tmp, history_file) # create file if it does not exist + with open(DATA_PATH, "+r") as history_file: history_data = json.load(history_file) history_data["searches"].append(search_data) history_file.seek(0) json.dump(history_data, history_file, indent=4) - + + def clear(): if os.path.exists(DATA_PATH): - with open(DATA_PATH, 'w') as history_file: + with open(DATA_PATH, "w") as history_file: json.dump(tmp, history_file) + def view(): with open(DATA_PATH, "+r") as history_file: - history_data = json.load(history_file) + history_data = json.load(history_file) for search in history_data["searches"]: - print(f"{search['time']}: {search['url']}") \ No newline at end of file + print(f"{search['time']}: {search['url']}") diff --git a/src/searchor/main.py b/src/searchor/main.py index 572e7b8..9a35010 100644 --- a/src/searchor/main.py +++ b/src/searchor/main.py @@ -2,10 +2,12 @@ from searchor import Engine import searchor.history + @click.group() def cli(): pass + @cli.command() @click.option( "-o", @@ -27,15 +29,18 @@ def cli(): @click.argument("query") def search(engine, query, open, copy): try: - url = eval(f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})") + url = eval( + f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})" + ) click.echo(url) searchor.history.update(engine, query, url) if open: click.echo("opening browser...") if copy: click.echo("link copied to clipboard") - except: - click.echo(f"engine doesn't exist") + except AttributeError: + print("engine not recognized") + @cli.command() @click.option( @@ -52,5 +57,6 @@ def history(clear): else: searchor.history.view() + if __name__ == "__main__": cli() From cac07d1bc7c0f9b234442e57f5a22f2d74eb04f3 Mon Sep 17 00:00:00 2001 From: fr4nkln11 Date: Fri, 21 Oct 2022 16:50:24 +0100 Subject: [PATCH 12/16] fixed issues caused by linter --- src/searchor/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/searchor/__init__.py b/src/searchor/__init__.py index 8d939c4..6c9225b 100644 --- a/src/searchor/__init__.py +++ b/src/searchor/__init__.py @@ -79,9 +79,7 @@ class Engine(Enum): Quora = "https://www.quora.com/search?q={query}" Reddit = "https://www.reddit.com/search/?q={query}" Replit = "https://replit.com/search?q={query}" - Samsung = ( - "https://www.samsung.com/us/search/searchMain/?listType=g&searchTerm={query}" - ) + Samsung = "https://www.samsung.com/us/search/searchMain/?listType=g&searchTerm={query}" Spotify = "https://open.spotify.com/search/{query}" StackOverflow = "https://www.stackoverflow.com/search?q={query}" Steam = "https://store.steampowered.com/search/?term={query}" @@ -106,9 +104,7 @@ class Engine(Enum): Yandex = "https://yandex.com/search/?text={query}" Youtube = "https://www.youtube.com/results?search_query={query}" - def search( - self, query, open_web=False, copy_url=False, additional_queries: dict = None - ): + def search(self, query, open_web=False, copy_url=False, additional_queries: dict = None): url = self.value.format(query=quote(query, safe="")) if additional_queries: url += ("?" if "?" not in self.value.split("/")[-1] else "&") + "&".join( From d9faa45f1a9e62ff8d67153e79dc20314db1d9f5 Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:56:19 -0500 Subject: [PATCH 13/16] Update README.md --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9dbc939..f6b6e2d 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,19 @@ Quick Start >>> Engine.Google.search("Hello, World!") 'https://www.google.com/search?q=Hello%2C%20World%21' ``` +Custom Engine +------------- +```python +>>> from searchor import Engine +>>> Engine.new("Colgate", "https://www.colgate.com/en-us/search/all?term=") +>>> print(Engine.Colgate.search("Hi world!", copy_url=True) +'https://www.colgate.com/en-us/search/all?term=Hi%20world!" Searchor CLI Quick Start ---------- -`$ searchor Google "Hello World!" --copy` +----------------------- +```bash +$ searchor Google "Hello World!" --copy +```

@@ -45,9 +54,12 @@ Take a look at more examples in the [examples](https://github.com/ArjunSharda/Se *Note*:  Engine names follow the **UpperCamelCase** convention.(eg: ChromeWebStore). -v2.3.2 Changes +v2.4.0 Changes -------------- -- **[PATCHED]** Patched a bug with Amazon Web Services, Altassian, and Amazon being duplicates. +- **[ADDED]** Added custom Engine support, check out a example [here](https://github.com/ArjunSharda/Searchor/blob/main/examples/custom_engine.py) +- **[ADDED]** Added Reuters search engine +- **[ADDED]** Added History CLI command which stores data in a JSON file, and which allows you to view, update, and clear. +- **[MODIFIED]** Modified the CLI with some other minor changes Migration --------- From d8c53b5094574f84bcdfc41b041628bc3abd8ef7 Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Fri, 21 Oct 2022 12:47:03 -0500 Subject: [PATCH 14/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c5e8ca..33b48e8 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Custom Engine >>> Engine.new("Colgate", "https://www.colgate.com/en-us/search/all?term=") >>> print(Engine.Colgate.search("Hi world!", copy_url=True) 'https://www.colgate.com/en-us/search/all?term=Hi%20world!" - +``` Searchor CLI Quick Start ```bash $ searchor Google "Hello World!" --copy From 63a91de6675358ec049f2fb0c1636c36625a35dd Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Sat, 22 Oct 2022 15:53:18 -0500 Subject: [PATCH 15/16] Update SUPPORTED_OPTIONS.md --- examples/cli/SUPPORTED_OPTIONS.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/cli/SUPPORTED_OPTIONS.md b/examples/cli/SUPPORTED_OPTIONS.md index d253c6f..f244c6c 100644 --- a/examples/cli/SUPPORTED_OPTIONS.md +++ b/examples/cli/SUPPORTED_OPTIONS.md @@ -1,24 +1,30 @@ # Supported Options -This is a list of all the official supported CLI options of Searchor. +This is a list of all the official supported CLI options of Searchor, with a example of them being used. # Normal ✅ ```shell -$ searchor Yahoo "Hello World!" +$ searchor search Yahoo "Hello World!" ``` # Copy URL ✅ ```shell -$ searchor Google "Hello World!" --copy +$ searchor search Google "Hello World!" --copy ``` -# Open Web ✅ +# Open Web ✅ - Example - +```shell +$ searchor search Target "Hello World!" --open +``` +# History ✅ ```shell -$ searchor Target "Hello World!" --open +$ searchor history ``` +# Clear History ✅ +```shell +$ searchor history --clear +``` From 879d1dffb573fe2fa9315d0ab50242151d97df6d Mon Sep 17 00:00:00 2001 From: Arjun Sharda <77706434+ArjunSharda@users.noreply.github.com> Date: Sat, 22 Oct 2022 15:57:06 -0500 Subject: [PATCH 16/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33b48e8..ce336f2 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ v2.4.0 Changes -------------- - **[ADDED]** Added custom Engine support, check out a example [here](https://github.com/ArjunSharda/Searchor/blob/main/examples/custom_engine.py) - **[ADDED]** Added Reuters search engine -- **[ADDED]** Added History CLI command which stores data in a JSON file, and which allows you to view, update, and clear. +- **[ADDED]** Added History CLI command which stores data in a JSON file, and which allows you to view, update, and clear. You can see some information of what was added for the history command [here](https://github.com/ArjunSharda/Searchor/pull/125) - **[MODIFIED]** Modified the CLI with some other minor changes Migration