Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files- requirements.txt +4 -0
- templates/text.html +175 -0
- text.py +25 -0
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
git+https://github.com/OE-LUCIFER/Webscout.git
|
2 |
+
requests
|
3 |
+
flask
|
4 |
+
arrow
|
templates/text.html
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>InfoHive - Text Search</title>
|
7 |
+
<meta name="description" content="InfoHive is a search engine that provides the latest text content on technology, sports, and more.">
|
8 |
+
<meta property="og:title" content="InfoHive - Text Search">
|
9 |
+
<meta property="og:description" content="InfoHive is a search engine that provides the latest text content on technology, sports, and more.">
|
10 |
+
<meta property="og:image" content="https://raw.githubusercontent.com/OE-LUCIFER/HelpingAI-vortex3b/main/techscout.jpeg">
|
11 |
+
<meta property="og:url" content="https://abhaukoul-techscout-news.hf.space/">
|
12 |
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
13 |
+
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
14 |
+
<style>
|
15 |
+
body {
|
16 |
+
font-family: 'Arial', sans-serif;
|
17 |
+
background-color: #f8f9fa;
|
18 |
+
color: #333;
|
19 |
+
margin: 0;
|
20 |
+
padding: 0;
|
21 |
+
}
|
22 |
+
.container {
|
23 |
+
width: 80%;
|
24 |
+
margin: 0 auto;
|
25 |
+
padding-top: 50px;
|
26 |
+
}
|
27 |
+
.jumbotron {
|
28 |
+
background-color: #007bff;
|
29 |
+
color: #fff;
|
30 |
+
padding: 2rem;
|
31 |
+
border-radius: 15px;
|
32 |
+
box-shadow: 0px 3px 15px rgba(0, 0, 0, 0.1);
|
33 |
+
margin-bottom: 50px;
|
34 |
+
}
|
35 |
+
.logo {
|
36 |
+
max-width: 200px;
|
37 |
+
margin-bottom: 20px;
|
38 |
+
}
|
39 |
+
.subscribe-btn {
|
40 |
+
background-color: #ff0000;
|
41 |
+
border-color: #ff0000;
|
42 |
+
border-radius: 24px;
|
43 |
+
padding: 15px 30px;
|
44 |
+
font-size: 20px;
|
45 |
+
text-transform: uppercase;
|
46 |
+
transition: background-color 0.3s ease, border-color 0.3s ease;
|
47 |
+
display: inline-block;
|
48 |
+
}
|
49 |
+
.subscribe-btn:hover {
|
50 |
+
background-color: #cc0000;
|
51 |
+
border-color: #cc0000;
|
52 |
+
}
|
53 |
+
.card {
|
54 |
+
border: none;
|
55 |
+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
|
56 |
+
}
|
57 |
+
.search-input {
|
58 |
+
border: 2px solid #007bff;
|
59 |
+
border-radius: 24px;
|
60 |
+
padding: 15px;
|
61 |
+
font-size: 18px;
|
62 |
+
width: calc(100% - 160px);
|
63 |
+
transition: border-color 0.3s ease;
|
64 |
+
}
|
65 |
+
.search-input:focus {
|
66 |
+
outline: none;
|
67 |
+
border-color: #0056b3;
|
68 |
+
}
|
69 |
+
.time-limit-select {
|
70 |
+
border: 2px solid #007bff;
|
71 |
+
border-radius: 24px;
|
72 |
+
padding: 12px 15px;
|
73 |
+
font-size: 16px;
|
74 |
+
transition: border-color 0.3s ease;
|
75 |
+
}
|
76 |
+
.time-limit-select:focus {
|
77 |
+
outline: none;
|
78 |
+
border-color: #0056b3;
|
79 |
+
}
|
80 |
+
.search-btn {
|
81 |
+
background-color: #007bff;
|
82 |
+
border: none;
|
83 |
+
border-radius: 24px;
|
84 |
+
color: #fff;
|
85 |
+
padding: 15px 20px;
|
86 |
+
font-size: 18px;
|
87 |
+
text-transform: uppercase;
|
88 |
+
transition: background-color 0.3s ease;
|
89 |
+
cursor: pointer;
|
90 |
+
}
|
91 |
+
.search-btn:hover {
|
92 |
+
background-color: #0056b3;
|
93 |
+
}
|
94 |
+
.form-row {
|
95 |
+
align-items: flex-start;
|
96 |
+
margin-bottom: 20px;
|
97 |
+
}
|
98 |
+
.search-result {
|
99 |
+
margin-bottom: 30px;
|
100 |
+
padding: 20px;
|
101 |
+
border: 1px solid #ccc;
|
102 |
+
border-radius: 10px;
|
103 |
+
background-color: #fff;
|
104 |
+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
|
105 |
+
}
|
106 |
+
.result-title {
|
107 |
+
font-size: 24px;
|
108 |
+
font-weight: bold;
|
109 |
+
margin-bottom: 10px;
|
110 |
+
color: #007bff;
|
111 |
+
transition: color 0.3s ease;
|
112 |
+
text-decoration: none;
|
113 |
+
}
|
114 |
+
.result-title:hover {
|
115 |
+
color: #0056b3;
|
116 |
+
}
|
117 |
+
.result-url {
|
118 |
+
font-size: 18px;
|
119 |
+
color: #006621;
|
120 |
+
margin-bottom: 10px;
|
121 |
+
}
|
122 |
+
.result-snippet {
|
123 |
+
font-size: 18px;
|
124 |
+
line-height: 1.6;
|
125 |
+
}
|
126 |
+
.no-results {
|
127 |
+
text-align: center;
|
128 |
+
font-style: italic;
|
129 |
+
margin-top: 30px;
|
130 |
+
font-size: 20px;
|
131 |
+
}
|
132 |
+
</style>
|
133 |
+
</head>
|
134 |
+
<body>
|
135 |
+
<div class="container">
|
136 |
+
<div class="jumbotron text-center" style="margin-top: 100px;">
|
137 |
+
<h1 class="display-4 mb-4">Explore the Latest Text</h1>
|
138 |
+
<p class="lead mb-4">InfoHive is your source for up-to-date text content on technology, sports, and more.</p>
|
139 |
+
<a href="https://youtube.com/@OEvortex" class="btn btn-primary subscribe-btn" target="_blank">Subscribe to OEvortex on YouTube</a>
|
140 |
+
</div>
|
141 |
+
<div class="card mb-4">
|
142 |
+
<div class="card-body">
|
143 |
+
<form method="GET" action="/" autocomplete="off">
|
144 |
+
<div class="form-row align-items-center">
|
145 |
+
<div class="col-md-7">
|
146 |
+
<input type="text" class="form-control search-input" name="keywords" placeholder="Enter keywords" value="{{ keywords }}">
|
147 |
+
</div>
|
148 |
+
<div class="col-md-3">
|
149 |
+
<select name="timelimit" class="form-control time-limit-select">
|
150 |
+
<option value="d" {% if timelimit == 'd' %}selected{% endif %}>Day</option>
|
151 |
+
<option value="w" {% if timelimit == 'w' %}selected{% endif %}>Week</option>
|
152 |
+
<option value="m" {% if timelimit == 'm' %}selected{% endif %}>Month</option>
|
153 |
+
</select>
|
154 |
+
</div>
|
155 |
+
<div class="col-md-2">
|
156 |
+
<button type="submit" class="btn btn-primary search-btn">Search</button>
|
157 |
+
</div>
|
158 |
+
</div>
|
159 |
+
</form>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
{% if text %}
|
163 |
+
{% for text_item in text %}
|
164 |
+
<div class="search-result">
|
165 |
+
<a href="{{ text_item['href'] }}" class="result-title">{{ text_item['title'] }}</a>
|
166 |
+
<!-- <div class="result-url">{{ text_item['href'] }}</div> -->
|
167 |
+
<div class="result-snippet">{{ text_item['body'] }}</div>
|
168 |
+
</div>
|
169 |
+
{% endfor %}
|
170 |
+
{% else %}
|
171 |
+
<p class="no-results">No results found.</p>
|
172 |
+
{% endif %}
|
173 |
+
</div>
|
174 |
+
</body>
|
175 |
+
</html>
|
text.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, render_template, request
|
2 |
+
from webscout import WEBS
|
3 |
+
import arrow
|
4 |
+
|
5 |
+
app = Flask(__name__)
|
6 |
+
|
7 |
+
@app.route('/', methods=['GET'])
|
8 |
+
def home():
|
9 |
+
keywords = request.args.get('keywords', 'india')
|
10 |
+
timelimit = request.args.get('timelimit', 'd')
|
11 |
+
text_list = []
|
12 |
+
with WEBS() as webs_instance:
|
13 |
+
WEBS_images_gen = webs_instance.text(
|
14 |
+
keywords,
|
15 |
+
region="wt-wt",
|
16 |
+
safesearch="off",
|
17 |
+
timelimit=timelimit,
|
18 |
+
max_results=100
|
19 |
+
)
|
20 |
+
for r in WEBS_images_gen:
|
21 |
+
text_list.append(r)
|
22 |
+
return render_template('text.html', text=text_list, keywords=keywords)
|
23 |
+
|
24 |
+
if __name__ == '__main__':
|
25 |
+
app.run(debug=True)
|