webscout 1.0.4__py3-none-any.whl → 1.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webscout might be problematic. Click here for more details.
- webscout/AI.py +193 -0
- webscout/version.py +1 -1
- webscout-1.0.6.dist-info/LICENSE.md +17 -0
- {webscout-1.0.4.dist-info → webscout-1.0.6.dist-info}/METADATA +121 -62
- {webscout-1.0.4.dist-info → webscout-1.0.6.dist-info}/RECORD +8 -7
- webscout-1.0.6.dist-info/entry_points.txt +5 -0
- webscout-1.0.4.dist-info/LICENSE.md +0 -21
- webscout-1.0.4.dist-info/entry_points.txt +0 -2
- {webscout-1.0.4.dist-info → webscout-1.0.6.dist-info}/WHEEL +0 -0
- {webscout-1.0.4.dist-info → webscout-1.0.6.dist-info}/top_level.txt +0 -0
webscout/AI.py
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import time
|
|
2
|
+
from selenium import webdriver
|
|
3
|
+
from selenium.webdriver.chrome.options import Options
|
|
4
|
+
from selenium.webdriver.common.by import By
|
|
5
|
+
from selenium.webdriver.support import expected_conditions as EC
|
|
6
|
+
from selenium.webdriver.support.ui import WebDriverWait
|
|
7
|
+
from halo import Halo
|
|
8
|
+
import click
|
|
9
|
+
import requests
|
|
10
|
+
import json
|
|
11
|
+
from requests import get
|
|
12
|
+
from uuid import uuid4
|
|
13
|
+
from re import findall
|
|
14
|
+
from requests.exceptions import RequestException
|
|
15
|
+
from curl_cffi.requests import get, RequestsError
|
|
16
|
+
class PhindSearch:
|
|
17
|
+
def __init__(self, query):
|
|
18
|
+
self.query = query
|
|
19
|
+
self.url = "https://www.phind.com/search?q=" + self.query
|
|
20
|
+
self.chrome_options = Options()
|
|
21
|
+
self.chrome_options.add_argument("--log-level=3") # Fatal errors only
|
|
22
|
+
self.chrome_options.add_argument("--headless")
|
|
23
|
+
self.chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
|
|
24
|
+
self.driver = webdriver.Chrome(options=self.chrome_options)
|
|
25
|
+
|
|
26
|
+
def search(self):
|
|
27
|
+
try:
|
|
28
|
+
spinner = Halo("Getting Answer from Phind...\n\n\n\n\n\n\n \n", spinner="dots")
|
|
29
|
+
spinner.start()
|
|
30
|
+
|
|
31
|
+
self.driver.get(self.url)
|
|
32
|
+
|
|
33
|
+
WebDriverWait(self.driver, timeout=50).until(EC.presence_of_element_located((By.TAG_NAME, "body")))
|
|
34
|
+
time.sleep(15)
|
|
35
|
+
answer_elements = self.driver.find_elements(By.CSS_SELECTOR, "main div.fs-5")
|
|
36
|
+
|
|
37
|
+
paragraph_texts = [answer_element.text.strip() for answer_element in answer_elements]
|
|
38
|
+
|
|
39
|
+
for text in paragraph_texts:
|
|
40
|
+
spinner.stop()
|
|
41
|
+
print(text)
|
|
42
|
+
|
|
43
|
+
finally:
|
|
44
|
+
self.driver.quit()
|
|
45
|
+
|
|
46
|
+
def close(self):
|
|
47
|
+
self.driver.quit()
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def search_cli(query):
|
|
51
|
+
"""Use webscout.AI."""
|
|
52
|
+
search_instance = PhindSearch(query)
|
|
53
|
+
search_instance.search()
|
|
54
|
+
|
|
55
|
+
class YepChat:
|
|
56
|
+
def __init__(self, message="hello"):
|
|
57
|
+
self.url = "https://api.yep.com/v1/chat/completions"
|
|
58
|
+
self.headers = {
|
|
59
|
+
"Accept": "*/*",
|
|
60
|
+
"Accept-Encoding": "gzip, deflate, br, zstd",
|
|
61
|
+
"Accept-Language": "en-US,en;q=0.9",
|
|
62
|
+
"Cache-Control": "max-age=0",
|
|
63
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
64
|
+
"Origin": "https://yep.com",
|
|
65
|
+
"Referer": "https://yep.com/",
|
|
66
|
+
"Sec-Ch-Ua": '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
|
|
67
|
+
"Sec-Ch-Ua-Mobile": "?0",
|
|
68
|
+
"Sec-Ch-Ua-Platform": '"Windows"',
|
|
69
|
+
"Sec-Fetch-Dest": "empty",
|
|
70
|
+
"Sec-Fetch-Mode": "cors",
|
|
71
|
+
"Sec-Fetch-Site": "same-site",
|
|
72
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0.0.0 Safari/537.36"
|
|
73
|
+
}
|
|
74
|
+
self.payload = {
|
|
75
|
+
"stream": True,
|
|
76
|
+
"max_tokens": 1280,
|
|
77
|
+
"top_p": 0.7,
|
|
78
|
+
"temperature": 0.6,
|
|
79
|
+
"messages": [{
|
|
80
|
+
"content": message,
|
|
81
|
+
"role": "user"
|
|
82
|
+
}],
|
|
83
|
+
"model": "Mixtral-8x7B-Instruct-v0.1"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
def send_request(self):
|
|
87
|
+
response = requests.post(self.url, headers=self.headers, data=json.dumps(self.payload), stream=True)
|
|
88
|
+
print(response.status_code)
|
|
89
|
+
return response
|
|
90
|
+
|
|
91
|
+
def process_response(self, response):
|
|
92
|
+
myset = ""
|
|
93
|
+
for line in response.iter_lines():
|
|
94
|
+
if line:
|
|
95
|
+
myline = line.decode('utf-8').removeprefix("data: ").replace(" null", "False")
|
|
96
|
+
try:
|
|
97
|
+
myval = eval(myline)
|
|
98
|
+
if "choices" in myval and "delta" in myval["choices"][0] and "content" in myval["choices"][0]["delta"]:
|
|
99
|
+
print(myval["choices"][0]["delta"]["content"], flush=True, end="")
|
|
100
|
+
myset += myval["choices"][0]["delta"]["content"]
|
|
101
|
+
except:
|
|
102
|
+
continue
|
|
103
|
+
print(myset)
|
|
104
|
+
return myset
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
def chat_cli(message):
|
|
108
|
+
"""Sends a request to the Yep API and processes the response."""
|
|
109
|
+
yep_chat = YepChat(message=message)
|
|
110
|
+
response = yep_chat.send_request()
|
|
111
|
+
yep_chat.process_response(response)
|
|
112
|
+
|
|
113
|
+
class youChat:
|
|
114
|
+
"""
|
|
115
|
+
This class provides methods for generating completions based on prompts.
|
|
116
|
+
"""
|
|
117
|
+
def create(self, prompt):
|
|
118
|
+
"""
|
|
119
|
+
Generate a completion based on the provided prompt.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
prompt (str): The input prompt to generate a completion from.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
str: The generated completion as a text string.
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
Exception: If the response does not contain the expected "youChatToken".
|
|
129
|
+
"""
|
|
130
|
+
resp = get(
|
|
131
|
+
"https://you.com/api/streamingSearch",
|
|
132
|
+
headers={
|
|
133
|
+
"cache-control": "no-cache",
|
|
134
|
+
"referer": "https://you.com/search?q=gpt4&tbm=youchat",
|
|
135
|
+
"cookie": f"safesearch_guest=Off; uuid_guest={str(uuid4())}",
|
|
136
|
+
},
|
|
137
|
+
params={
|
|
138
|
+
"q": prompt,
|
|
139
|
+
"page": 1,
|
|
140
|
+
"count": 10,
|
|
141
|
+
"safeSearch": "Off",
|
|
142
|
+
"onShoppingPage": False,
|
|
143
|
+
"mkt": "",
|
|
144
|
+
"responseFilter": "WebPages,Translations,TimeZone,Computation,RelatedSearches",
|
|
145
|
+
"domain": "youchat",
|
|
146
|
+
"queryTraceId": str(uuid4()),
|
|
147
|
+
"chat": [],
|
|
148
|
+
},
|
|
149
|
+
impersonate="chrome107",
|
|
150
|
+
)
|
|
151
|
+
if "youChatToken" not in resp.text:
|
|
152
|
+
raise RequestsError("Unable to fetch the response.")
|
|
153
|
+
return (
|
|
154
|
+
"".join(
|
|
155
|
+
findall(
|
|
156
|
+
r"{\"youChatToken\": \"(.*?)\"}",
|
|
157
|
+
resp.content.decode("unicode-escape"),
|
|
158
|
+
)
|
|
159
|
+
)
|
|
160
|
+
.replace("\\n", "\n")
|
|
161
|
+
.replace("\\\\", "\\")
|
|
162
|
+
.replace('\\"', '"')
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
@staticmethod
|
|
166
|
+
def chat_cli(prompt):
|
|
167
|
+
"""Generate completion based on the provided prompt"""
|
|
168
|
+
you_chat = youChat()
|
|
169
|
+
completion = you_chat.create(prompt)
|
|
170
|
+
print(completion)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
@click.group()
|
|
174
|
+
def cli():
|
|
175
|
+
pass
|
|
176
|
+
|
|
177
|
+
@cli.command()
|
|
178
|
+
@click.option('--query', prompt='Enter your search query', help='The query to search for.')
|
|
179
|
+
def phindsearch(query):
|
|
180
|
+
PhindSearch.search_cli(query)
|
|
181
|
+
|
|
182
|
+
@cli.command()
|
|
183
|
+
@click.option('--message', prompt='Enter your message', help='The message to send.')
|
|
184
|
+
def yepchat(message):
|
|
185
|
+
YepChat.chat_cli(message)
|
|
186
|
+
|
|
187
|
+
@cli.command()
|
|
188
|
+
@click.option('--prompt', prompt='Enter your prompt', help='The prompt to generate a completion from.')
|
|
189
|
+
def youchat(prompt):
|
|
190
|
+
youChat.chat_cli(prompt)
|
|
191
|
+
|
|
192
|
+
if __name__ == '__main__':
|
|
193
|
+
cli()
|
webscout/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.0.
|
|
1
|
+
__version__ = "1.0.6"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
🌟 **HelpingAI Innovator's License 📜**
|
|
2
|
+
|
|
3
|
+
📅 **Copyright: ©️ 2022 HelpingAI**
|
|
4
|
+
|
|
5
|
+
📝 **License Terms & Guidelines:**
|
|
6
|
+
|
|
7
|
+
1. **Empower Innovation:** Embrace the power to innovate, create, and push the boundaries of possibility with HelpingAI.
|
|
8
|
+
|
|
9
|
+
2. **Recognition:** Honor and acknowledge HelpingAI for its original creation and any enhancements or modifications made to the software.
|
|
10
|
+
|
|
11
|
+
3. **Unrestricted Use:** Enjoy the freedom of unrestricted use, modification, and distribution of the software without limitations.
|
|
12
|
+
|
|
13
|
+
4. **Community Collaboration:** Foster a spirit of collaboration by sharing your advancements, insights, and contributions with the wider community.
|
|
14
|
+
|
|
15
|
+
5. **Continuous Advancement:** Commit to the continuous advancement and improvement of AI technology through your dedicated efforts.
|
|
16
|
+
|
|
17
|
+
🚀 **Unlock the Potential of Innovation with the HelpingAI Innovator's License! 🌌**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: Search for words, documents, images, news, maps
|
|
5
|
-
|
|
6
|
-
Author:
|
|
7
|
-
Author-email: koulabhay25@gmail.com
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com and you.com Also containes AI models
|
|
5
|
+
Author: OEvortex, Zaid
|
|
6
|
+
Author-email: helpingai5@gmail.com
|
|
8
7
|
Classifier: Development Status :: 5 - Production/Stable
|
|
9
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
9
|
Classifier: Operating System :: OS Independent
|
|
@@ -25,31 +24,49 @@ Requires-Dist: click >=8.1.7
|
|
|
25
24
|
Requires-Dist: curl-cffi >=0.6.0b7
|
|
26
25
|
Requires-Dist: lxml >=5.1.0
|
|
27
26
|
Requires-Dist: nest-asyncio >=1.6.0
|
|
27
|
+
Requires-Dist: selenium >=4.1.3
|
|
28
|
+
Requires-Dist: tqdm >=4.64.0
|
|
29
|
+
Requires-Dist: webdriver-manager >=3.5.4
|
|
30
|
+
Requires-Dist: halo >=0.0.31
|
|
28
31
|
Provides-Extra: dev
|
|
29
32
|
Requires-Dist: ruff >=0.1.6 ; extra == 'dev'
|
|
30
33
|
Requires-Dist: pytest >=7.4.2 ; extra == 'dev'
|
|
31
34
|
|
|
32
|
-
Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com
|
|
33
|
-
|
|
35
|
+
Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com, yep.com, phind.com and you.com
|
|
36
|
+
Also containes AI models that you can use
|
|
34
37
|
**⚠️ Warning: use AsyncWEBS in asynchronous code**
|
|
35
38
|
|
|
36
39
|
## Table of Contents
|
|
37
40
|
- [Table of Contents](#table-of-contents)
|
|
41
|
+
- [What is new](#what-is-new)
|
|
42
|
+
- [What is next](#what-is-next)
|
|
38
43
|
- [Install](#install)
|
|
39
44
|
- [CLI version](#cli-version)
|
|
40
|
-
- [
|
|
45
|
+
- [CLI version of AI](#cli-version-of-ai)
|
|
41
46
|
- [Regions](#regions)
|
|
42
47
|
- [WEBS and AsyncWEBS classes](#webs-and-asyncwebs-classes)
|
|
43
48
|
- [Exceptions](#exceptions)
|
|
44
|
-
- [1. text() - text search by
|
|
45
|
-
- [2. answers() - instant answers by
|
|
46
|
-
- [3. images() - image search by
|
|
47
|
-
- [4. videos() - video search by
|
|
48
|
-
- [5. news() - news search by
|
|
49
|
-
- [6. maps() - map search by
|
|
50
|
-
- [7. translate() - translation by
|
|
51
|
-
- [8. suggestions() - suggestions by
|
|
52
|
-
|
|
49
|
+
- [1. `text()` - text search by DuckDuckGo.com and Yep.com](#1-text---text-search-by-duckduckgocom-and-yepcom)
|
|
50
|
+
- [2. `answers()` - instant answers by DuckDuckGo.com and Yep.com](#2-answers---instant-answers-by-duckduckgocom-and-yepcom)
|
|
51
|
+
- [3. `images()` - image search by DuckDuckGo.com and Yep.com](#3-images---image-search-by-duckduckgocom-and-yepcom)
|
|
52
|
+
- [4. `videos()` - video search by DuckDuckGo.com](#4-videos---video-search-by-duckduckgocom)
|
|
53
|
+
- [5. `news()` - news search by DuckDuckGo.com and yep.com](#5-news---news-search-by-duckduckgocom-and-yepcom)
|
|
54
|
+
- [6. `maps()` - map search by DuckDuckGo.com and](#6-maps---map-search-by-duckduckgocom-and)
|
|
55
|
+
- [7. `translate()` - translation by DuckDuckGo.com and Yep.com](#7-translate---translation-by-duckduckgocom-and-yepcom)
|
|
56
|
+
- [8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com](#8-suggestions---suggestions-by-duckduckgocom-and-yepcom)
|
|
57
|
+
- [9. `PhindSearch` - Search using Phind.com](#9-phindsearch---search-using-phindcom)
|
|
58
|
+
- [10. `YepChat` - Chat with mistral 8x7b powered by yepchat](#10-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
|
|
59
|
+
- [11. `You.com` - search with you.com](#11-youcom---search-with-youcom)
|
|
60
|
+
|
|
61
|
+
## What is new
|
|
62
|
+
- Added yep.com as search engine.
|
|
63
|
+
- solved a error where translate was not working.
|
|
64
|
+
- Added Phind AI as webscout.AI
|
|
65
|
+
- Added YepChat as webscout.AI
|
|
66
|
+
- Added You.com as webscout.AI
|
|
67
|
+
## What is next
|
|
68
|
+
- adding more AI models or fuctions
|
|
69
|
+
-
|
|
53
70
|
## Install
|
|
54
71
|
```python
|
|
55
72
|
pip install -U webscout
|
|
@@ -60,24 +77,18 @@ pip install -U webscout
|
|
|
60
77
|
```python3
|
|
61
78
|
python -m webscout --help
|
|
62
79
|
```
|
|
80
|
+
## CLI version of AI
|
|
63
81
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## Duckduckgo search operators
|
|
68
|
-
|
|
69
|
-
| Keywords example | Result|
|
|
70
|
-
| --- | --- |
|
|
71
|
-
| cats dogs | Results about cats or dogs |
|
|
72
|
-
| "cats and dogs" | Results for exact term "cats and dogs". If no results are found, related results are shown. |
|
|
73
|
-
| cats -dogs | Fewer dogs in results |
|
|
74
|
-
| cats +dogs | More dogs in results |
|
|
75
|
-
| cats filetype:pdf | PDFs about cats. Supported file types: pdf, doc(x), xls(x), ppt(x), html |
|
|
76
|
-
| dogs site:example.com | Pages about dogs from example.com |
|
|
77
|
-
| cats -site:example.com | Pages about cats, excluding example.com |
|
|
78
|
-
| intitle:dogs | Page title includes the word "dogs" |
|
|
79
|
-
| inurl:cats | Page url includes the word "cats" |
|
|
82
|
+
``python3
|
|
83
|
+
python -m webscout.AI phindsearch --query "your_query_here"
|
|
84
|
+
```
|
|
80
85
|
|
|
86
|
+
```python
|
|
87
|
+
python -m webscout.AI yepchat --message "your_message_here"
|
|
88
|
+
```
|
|
89
|
+
```python
|
|
90
|
+
python -m webscout.AI youchat --prompt "your_prompt_here"
|
|
91
|
+
```
|
|
81
92
|
[Go To TOP](#TOP)
|
|
82
93
|
|
|
83
94
|
## Regions
|
|
@@ -160,27 +171,22 @@ ___
|
|
|
160
171
|
|
|
161
172
|
## WEBS and AsyncWEBS classes
|
|
162
173
|
|
|
163
|
-
The WEBS and AsyncWEBS classes are used to retrieve search results from DuckDuckGo.com.
|
|
174
|
+
The WEBS and AsyncWEBS classes are used to retrieve search results from DuckDuckGo.com and yep.com periodically.
|
|
164
175
|
To use the AsyncWEBS class, you can perform asynchronous operations using Python's asyncio library.
|
|
165
176
|
To initialize an instance of the WEBS or AsyncWEBS classes, you can provide the following optional arguments:
|
|
166
|
-
```python3
|
|
167
|
-
class WEBS:
|
|
168
|
-
"""webscout class to get search results from duckduckgo.com
|
|
169
|
-
|
|
170
|
-
Args:
|
|
171
|
-
headers (dict, optional): Dictionary of headers for the HTTP client. Defaults to None.
|
|
172
|
-
proxies (Union[dict, str], optional): Proxies for the HTTP client (can be dict or str). Defaults to None.
|
|
173
|
-
timeout (int, optional): Timeout value for the HTTP client. Defaults to 10.
|
|
174
|
-
"""
|
|
175
|
-
```
|
|
176
177
|
|
|
177
178
|
Here is an example of initializing the WEBS class:
|
|
178
179
|
```python3
|
|
179
180
|
from webscout import WEBS
|
|
180
181
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
# Instantiating the WEBS class from webscout module
|
|
183
|
+
WEBS_instance = WEBS()
|
|
184
|
+
|
|
185
|
+
# Fetching text results for the query "python programming" with a maximum of 5 results
|
|
186
|
+
results = [result for result in WEBS_instance.text("python programming", max_results=5)]
|
|
187
|
+
|
|
188
|
+
# Displaying the obtained results
|
|
189
|
+
print(results)
|
|
184
190
|
```
|
|
185
191
|
Here is an example of initializing the AsyncWEBS class:
|
|
186
192
|
```python3
|
|
@@ -233,36 +239,39 @@ Exceptions:
|
|
|
233
239
|
- `WebscoutE`: Raised when there is a generic exception during the API request.
|
|
234
240
|
|
|
235
241
|
|
|
236
|
-
|
|
242
|
+
Here are the rewritten Python scripts for accessing various functionalities using the WEBS class from the webscout module, in HelpingAI style, for DuckDuckGo.com and Yep.com without explicitly specifying the search engine:
|
|
243
|
+
|
|
244
|
+
### 1. `text()` - text search by DuckDuckGo.com and Yep.com
|
|
237
245
|
|
|
238
246
|
```python
|
|
239
247
|
from webscout import WEBS
|
|
240
248
|
|
|
249
|
+
# Text search for 'live free or die' using DuckDuckGo.com and Yep.com
|
|
241
250
|
with WEBS() as WEBS:
|
|
242
251
|
for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
|
|
243
252
|
print(r)
|
|
244
253
|
|
|
245
|
-
|
|
246
|
-
with WEBS() as WEBS:
|
|
247
|
-
for r in WEBS.text('russia filetype:pdf', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
|
|
254
|
+
for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
|
|
248
255
|
print(r)
|
|
249
256
|
```
|
|
250
257
|
|
|
251
|
-
|
|
258
|
+
### 2. `answers()` - instant answers by DuckDuckGo.com and Yep.com
|
|
252
259
|
|
|
253
260
|
```python
|
|
254
261
|
from webscout import WEBS
|
|
255
262
|
|
|
263
|
+
# Instant answers for the query "sun" using DuckDuckGo.com and Yep.com
|
|
256
264
|
with WEBS() as WEBS:
|
|
257
265
|
for r in WEBS.answers("sun"):
|
|
258
266
|
print(r)
|
|
259
267
|
```
|
|
260
268
|
|
|
261
|
-
|
|
269
|
+
### 3. `images()` - image search by DuckDuckGo.com and Yep.com
|
|
262
270
|
|
|
263
271
|
```python
|
|
264
272
|
from webscout import WEBS
|
|
265
273
|
|
|
274
|
+
# Image search for the keyword 'butterfly' using DuckDuckGo.com and Yep.com
|
|
266
275
|
with WEBS() as WEBS:
|
|
267
276
|
keywords = 'butterfly'
|
|
268
277
|
WEBS_images_gen = WEBS.images(
|
|
@@ -280,11 +289,12 @@ with WEBS() as WEBS:
|
|
|
280
289
|
print(r)
|
|
281
290
|
```
|
|
282
291
|
|
|
283
|
-
|
|
292
|
+
### 4. `videos()` - video search by DuckDuckGo.com
|
|
284
293
|
|
|
285
294
|
```python
|
|
286
295
|
from webscout import WEBS
|
|
287
296
|
|
|
297
|
+
# Video search for the keyword 'tesla' using DuckDuckGo.com
|
|
288
298
|
with WEBS() as WEBS:
|
|
289
299
|
keywords = 'tesla'
|
|
290
300
|
WEBS_videos_gen = WEBS.videos(
|
|
@@ -300,11 +310,12 @@ with WEBS() as WEBS:
|
|
|
300
310
|
print(r)
|
|
301
311
|
```
|
|
302
312
|
|
|
303
|
-
|
|
313
|
+
### 5. `news()` - news search by DuckDuckGo.com and yep.com
|
|
304
314
|
|
|
305
315
|
```python
|
|
306
316
|
from webscout import WEBS
|
|
307
317
|
|
|
318
|
+
# News search for the keyword 'holiday' using DuckDuckGo.com and yep.com
|
|
308
319
|
with WEBS() as WEBS:
|
|
309
320
|
keywords = 'holiday'
|
|
310
321
|
WEBS_news_gen = WEBS.news(
|
|
@@ -318,34 +329,82 @@ with WEBS() as WEBS:
|
|
|
318
329
|
print(r)
|
|
319
330
|
```
|
|
320
331
|
|
|
321
|
-
|
|
322
|
-
## 6. maps() - map search by duckduckgo.com
|
|
332
|
+
### 6. `maps()` - map search by DuckDuckGo.com and
|
|
323
333
|
|
|
324
334
|
```python
|
|
325
335
|
from webscout import WEBS
|
|
326
336
|
|
|
337
|
+
# Map search for the keyword 'school' in 'anantnag' using DuckDuckGo.com
|
|
327
338
|
with WEBS() as WEBS:
|
|
328
339
|
for r in WEBS.maps("school", place="anantnag", max_results=50):
|
|
329
340
|
print(r)
|
|
330
341
|
```
|
|
331
342
|
|
|
332
|
-
|
|
333
|
-
## 7. translate() - translation by duckduckgo.com
|
|
343
|
+
### 7. `translate()` - translation by DuckDuckGo.com and Yep.com
|
|
334
344
|
|
|
335
345
|
```python
|
|
336
346
|
from webscout import WEBS
|
|
337
347
|
|
|
348
|
+
# Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com and Yep.com
|
|
338
349
|
with WEBS() as WEBS:
|
|
339
350
|
keywords = 'school'
|
|
340
|
-
r = WEBS.translate(keywords, to="
|
|
351
|
+
r = WEBS.translate(keywords, to="hi")
|
|
341
352
|
print(r)
|
|
342
353
|
```
|
|
343
354
|
|
|
344
|
-
|
|
345
|
-
|
|
355
|
+
### 8. `suggestions()` - suggestions by DuckDuckGo.com and Yep.com
|
|
356
|
+
|
|
357
|
+
```python
|
|
346
358
|
from webscout import WEBS
|
|
347
359
|
|
|
360
|
+
# Suggestions for the keyword 'fly' using DuckDuckGo.com and Yep
|
|
361
|
+
#
|
|
362
|
+
|
|
363
|
+
.com
|
|
348
364
|
with WEBS() as WEBS:
|
|
349
365
|
for r in WEBS.suggestions("fly"):
|
|
350
366
|
print(r)
|
|
351
367
|
```
|
|
368
|
+
|
|
369
|
+
### 9. `PhindSearch` - Search using Phind.com
|
|
370
|
+
Thanks to Empyros for PhindSearch function
|
|
371
|
+
```python
|
|
372
|
+
from webscout.AI import PhindSearch
|
|
373
|
+
|
|
374
|
+
query = 'Webscout pypi'
|
|
375
|
+
|
|
376
|
+
# Create an instance of WEBSAI with the query
|
|
377
|
+
WEBSAI = PhindSearch(query)
|
|
378
|
+
|
|
379
|
+
WEBSAI.search()
|
|
380
|
+
```
|
|
381
|
+
### 10. `YepChat` - Chat with mistral 8x7b powered by yepchat
|
|
382
|
+
Thanks To Divyansh Shukla for This code
|
|
383
|
+
```python
|
|
384
|
+
from webscout.AI import YepChat
|
|
385
|
+
# Example usage of the chat_cli method
|
|
386
|
+
YepChat.chat_cli("Hello, how can I help you today?")
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### 11. `You.com` - search with you.com
|
|
390
|
+
```python
|
|
391
|
+
from webscout.AI import youChat
|
|
392
|
+
|
|
393
|
+
# Instantiate the youchat class
|
|
394
|
+
youChat = youChat()
|
|
395
|
+
|
|
396
|
+
while True:
|
|
397
|
+
# Ask the user for a prompt
|
|
398
|
+
prompt = input("💡 Enter a prompt (or type 'exit' to quit): ")
|
|
399
|
+
|
|
400
|
+
# Exit condition
|
|
401
|
+
if prompt.lower() == 'exit':
|
|
402
|
+
break
|
|
403
|
+
|
|
404
|
+
# Generate a completion based on the prompt
|
|
405
|
+
try:
|
|
406
|
+
completion = youChat.create(prompt)
|
|
407
|
+
print("💬:", completion)
|
|
408
|
+
except Exception as e:
|
|
409
|
+
print("⚠️ An error occurred:", e)
|
|
410
|
+
```
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
webscout/AI.py,sha256=EsI1ldocPgCaAsOQAAlBZWaIlp-LkEpTnWkSLeVhx7E,6680
|
|
1
2
|
webscout/__init__.py,sha256=vHJGZexYIaWDTHfMimqA7enct9b7zPDf6jLsS7NDBiA,536
|
|
2
3
|
webscout/__main__.py,sha256=ZtTRgsRjUi2JOvYFLF1ZCh55Sdoz94I-BS-TlJC7WDU,126
|
|
3
4
|
webscout/cli.py,sha256=9opO5KynQ3LA5gPW2czlmy7-ZdfUae6ccrny3vibqzQ,17757
|
|
4
5
|
webscout/exceptions.py,sha256=7u52Mt5iyEUCZvaZuEYwQVV8HL8IdZBv1r5s5Ss_xU0,75
|
|
5
6
|
webscout/models.py,sha256=5iQIdtedT18YuTZ3npoG7kLMwcrKwhQ7928dl_7qZW0,692
|
|
6
7
|
webscout/utils.py,sha256=M2ocDpYOVd9lTZA3VGdK_p80Xsr-VPeAoUUCFaMWCqk,1610
|
|
7
|
-
webscout/version.py,sha256=
|
|
8
|
+
webscout/version.py,sha256=1HqFYnow__4MUVRI_OMjvzTBzKkReNozOdA96kH53cA,23
|
|
8
9
|
webscout/webscout_search.py,sha256=_kuNpRhbgge6MubxlsRe9kzBKlHoPEH6-93ILMpycfg,2351
|
|
9
10
|
webscout/webscout_search_async.py,sha256=lNdR18-y8O9HqFsHvlzBYg18qeI12uLEXIzFMP3D_XU,35070
|
|
10
|
-
webscout-1.0.
|
|
11
|
-
webscout-1.0.
|
|
12
|
-
webscout-1.0.
|
|
13
|
-
webscout-1.0.
|
|
14
|
-
webscout-1.0.
|
|
15
|
-
webscout-1.0.
|
|
11
|
+
webscout-1.0.6.dist-info/LICENSE.md,sha256=07ABCXFZBmAyzICIiQbglOYZGERK2umNJCYeOV54FP4,907
|
|
12
|
+
webscout-1.0.6.dist-info/METADATA,sha256=BqaiqbfkhBeu5e7GiwtW6z3IlH-NKrIa-0sHd7fYQMk,12404
|
|
13
|
+
webscout-1.0.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
14
|
+
webscout-1.0.6.dist-info/entry_points.txt,sha256=1naMz1lm0onX0Rn0RRBeGaQJIUKT8V6KASIcGJJHz0M,164
|
|
15
|
+
webscout-1.0.6.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
|
|
16
|
+
webscout-1.0.6.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 HelpingAI
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|