Add 3 files
Browse files- README.md +7 -5
- index.html +959 -19
- prompts.txt +6 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: web-panel
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: purple
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,959 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>Google Maps Scraper</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.loading-bar {
|
11 |
+
width: 0%;
|
12 |
+
transition: width 0.3s ease;
|
13 |
+
}
|
14 |
+
.result-item:hover {
|
15 |
+
transform: translateY(-2px);
|
16 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
17 |
+
}
|
18 |
+
.animate-pulse {
|
19 |
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
20 |
+
}
|
21 |
+
@keyframes pulse {
|
22 |
+
0%, 100% {
|
23 |
+
opacity: 1;
|
24 |
+
}
|
25 |
+
50% {
|
26 |
+
opacity: 0.5;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
.tooltip {
|
30 |
+
position: relative;
|
31 |
+
display: inline-block;
|
32 |
+
}
|
33 |
+
.tooltip .tooltiptext {
|
34 |
+
visibility: hidden;
|
35 |
+
width: 200px;
|
36 |
+
background-color: #555;
|
37 |
+
color: #fff;
|
38 |
+
text-align: center;
|
39 |
+
border-radius: 6px;
|
40 |
+
padding: 5px;
|
41 |
+
position: absolute;
|
42 |
+
z-index: 1;
|
43 |
+
bottom: 125%;
|
44 |
+
left: 50%;
|
45 |
+
margin-left: -100px;
|
46 |
+
opacity: 0;
|
47 |
+
transition: opacity 0.3s;
|
48 |
+
}
|
49 |
+
.tooltip:hover .tooltiptext {
|
50 |
+
visibility: visible;
|
51 |
+
opacity: 1;
|
52 |
+
}
|
53 |
+
</style>
|
54 |
+
</head>
|
55 |
+
<body class="bg-gray-50 min-h-screen">
|
56 |
+
<div class="container mx-auto px-4 py-8 max-w-6xl">
|
57 |
+
<!-- Header -->
|
58 |
+
<header class="mb-8">
|
59 |
+
<div class="flex items-center justify-between">
|
60 |
+
<div>
|
61 |
+
<h1 class="text-3xl font-bold text-gray-800">
|
62 |
+
<i class="fas fa-map-marked-alt text-blue-500 mr-2"></i>
|
63 |
+
Maps Scraper Pro
|
64 |
+
</h1>
|
65 |
+
<p class="text-gray-600 mt-1">Extract business data from Google Maps efficiently</p>
|
66 |
+
</div>
|
67 |
+
<div class="flex items-center space-x-4">
|
68 |
+
<button id="historyBtn" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-gray-700 transition">
|
69 |
+
<i class="fas fa-history mr-2"></i>History
|
70 |
+
</button>
|
71 |
+
<button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg text-white transition">
|
72 |
+
<i class="fas fa-user-plus mr-2"></i>Upgrade
|
73 |
+
</button>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
</header>
|
77 |
+
|
78 |
+
<!-- Main Content -->
|
79 |
+
<main>
|
80 |
+
<!-- Search Form -->
|
81 |
+
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
|
82 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4">
|
83 |
+
<i class="fas fa-search mr-2 text-blue-500"></i>Search Parameters
|
84 |
+
</h2>
|
85 |
+
|
86 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
|
87 |
+
<div>
|
88 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Search Query</label>
|
89 |
+
<div class="flex">
|
90 |
+
<input type="text" id="searchQuery" placeholder="e.g. Restaurants in Mumbai"
|
91 |
+
class="flex-1 px-4 py-2 border border-gray-300 rounded-l-lg focus:ring-blue-500 focus:border-blue-500">
|
92 |
+
<button id="searchBtn" class="px-4 bg-blue-600 text-white rounded-r-lg hover:bg-blue-700 transition">
|
93 |
+
<i class="fas fa-search"></i>
|
94 |
+
</button>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
|
98 |
+
<div>
|
99 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Location</label>
|
100 |
+
<input type="text" id="location" placeholder="City or Address"
|
101 |
+
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500">
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
|
106 |
+
<div>
|
107 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Radius (km)</label>
|
108 |
+
<select id="radius" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
109 |
+
<option value="1">1 km</option>
|
110 |
+
<option value="5" selected>5 km</option>
|
111 |
+
<option value="10">10 km</option>
|
112 |
+
<option value="20">20 km</option>
|
113 |
+
<option value="50">50 km</option>
|
114 |
+
</select>
|
115 |
+
</div>
|
116 |
+
|
117 |
+
<div>
|
118 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Max Results</label>
|
119 |
+
<select id="maxResults" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
120 |
+
<option value="10">10</option>
|
121 |
+
<option value="25">25</option>
|
122 |
+
<option value="50" selected>50</option>
|
123 |
+
<option value="100">100</option>
|
124 |
+
<option value="200">200</option>
|
125 |
+
</select>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
<div>
|
129 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Language</label>
|
130 |
+
<select id="language" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
131 |
+
<option value="en" selected>English</option>
|
132 |
+
<option value="hi">Hindi</option>
|
133 |
+
<option value="es">Spanish</option>
|
134 |
+
<option value="fr">French</option>
|
135 |
+
</select>
|
136 |
+
</div>
|
137 |
+
|
138 |
+
<div>
|
139 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Data Points</label>
|
140 |
+
<select id="dataPoints" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
141 |
+
<option value="basic" selected>Basic Info</option>
|
142 |
+
<option value="contact">Basic + Contact</option>
|
143 |
+
<option value="all">All Details</option>
|
144 |
+
</select>
|
145 |
+
</div>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
<div class="flex justify-between items-center">
|
149 |
+
<div class="flex space-x-3">
|
150 |
+
<button id="startScraping" class="px-6 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg transition flex items-center">
|
151 |
+
<i class="fas fa-play mr-2"></i> Start Scraping
|
152 |
+
</button>
|
153 |
+
<button id="stopScraping" class="px-6 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition flex items-center">
|
154 |
+
<i class="fas fa-stop mr-2"></i> Stop
|
155 |
+
</button>
|
156 |
+
</div>
|
157 |
+
|
158 |
+
<div class="flex items-center space-x-4">
|
159 |
+
<div class="text-sm text-gray-500">
|
160 |
+
<i class="fas fa-database mr-1"></i> Credits: <span id="credits">124</span>/500
|
161 |
+
</div>
|
162 |
+
<button class="px-4 py-2 bg-blue-50 hover:bg-blue-100 text-blue-600 rounded-lg transition flex items-center">
|
163 |
+
<i class="fas fa-bolt mr-2"></i> Buy More
|
164 |
+
</button>
|
165 |
+
</div>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
|
169 |
+
<!-- Progress Bar -->
|
170 |
+
<div id="progressSection" class="hidden bg-white rounded-xl shadow-md p-6 mb-8">
|
171 |
+
<div class="flex justify-between mb-2">
|
172 |
+
<span class="text-sm font-medium text-gray-700">Scraping Progress</span>
|
173 |
+
<span id="progressPercent" class="text-sm font-medium text-blue-600">0%</span>
|
174 |
+
</div>
|
175 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
176 |
+
<div id="loadingBar" class="loading-bar h-2.5 rounded-full bg-blue-600"></div>
|
177 |
+
</div>
|
178 |
+
<div class="mt-4 flex justify-between text-sm text-gray-500">
|
179 |
+
<span id="processedCount">0</span>
|
180 |
+
<span id="totalCount">0</span>
|
181 |
+
</div>
|
182 |
+
<div class="mt-2 text-sm text-gray-500">
|
183 |
+
<span id="statusMessage">Initializing scraping process...</span>
|
184 |
+
</div>
|
185 |
+
<div class="mt-4 flex justify-between">
|
186 |
+
<div id="timeElapsed" class="text-sm text-gray-500">Time elapsed: 0s</div>
|
187 |
+
<div id="timeRemaining" class="text-sm text-gray-500">Estimated time remaining: calculating...</div>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
|
191 |
+
<!-- Results Section -->
|
192 |
+
<div class="bg-white rounded-xl shadow-md p-6">
|
193 |
+
<div class="flex justify-between items-center mb-6">
|
194 |
+
<h2 class="text-xl font-semibold text-gray-800">
|
195 |
+
<i class="fas fa-list-alt mr-2 text-blue-500"></i>Results
|
196 |
+
</h2>
|
197 |
+
<div class="flex space-x-3">
|
198 |
+
<button id="exportBtn" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-gray-700 transition flex items-center">
|
199 |
+
<i class="fas fa-download mr-2"></i> Export
|
200 |
+
</button>
|
201 |
+
<button id="filterBtn" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-gray-700 transition flex items-center">
|
202 |
+
<i class="fas fa-filter mr-2"></i> Filter
|
203 |
+
</button>
|
204 |
+
</div>
|
205 |
+
</div>
|
206 |
+
|
207 |
+
<!-- Results Table -->
|
208 |
+
<div class="overflow-x-auto">
|
209 |
+
<table class="min-w-full divide-y divide-gray-200">
|
210 |
+
<thead class="bg-gray-50">
|
211 |
+
<tr>
|
212 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Business</th>
|
213 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Address</th>
|
214 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Phone</th>
|
215 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rating</th>
|
216 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
217 |
+
</tr>
|
218 |
+
</thead>
|
219 |
+
<tbody id="resultsTable" class="bg-white divide-y divide-gray-200">
|
220 |
+
<!-- Placeholder for loading state -->
|
221 |
+
<tr id="loadingPlaceholder" class="animate-pulse">
|
222 |
+
<td class="px-6 py-4 whitespace-nowrap" colspan="5">
|
223 |
+
<div class="flex justify-center items-center h-32 text-gray-400">
|
224 |
+
<i class="fas fa-map-marker-alt text-4xl mr-3"></i>
|
225 |
+
<span class="text-lg">Enter search parameters and click "Start Scraping"</span>
|
226 |
+
</div>
|
227 |
+
</td>
|
228 |
+
</tr>
|
229 |
+
<!-- Results will be inserted here by JavaScript -->
|
230 |
+
</tbody>
|
231 |
+
</table>
|
232 |
+
</div>
|
233 |
+
|
234 |
+
<!-- Pagination -->
|
235 |
+
<div class="mt-6 flex items-center justify-between">
|
236 |
+
<div class="text-sm text-gray-500">
|
237 |
+
Showing <span id="showingFrom" class="font-medium">0</span> to <span id="showingTo" class="font-medium">0</span> of <span id="totalResults" class="font-medium">0</span> results
|
238 |
+
</div>
|
239 |
+
<div class="flex space-x-2">
|
240 |
+
<button id="prevPage" class="px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white disabled:opacity-50" disabled>
|
241 |
+
Previous
|
242 |
+
</button>
|
243 |
+
<button id="page1" class="px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white font-medium">
|
244 |
+
1
|
245 |
+
</button>
|
246 |
+
<button id="page2" class="px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white hover:bg-gray-50">
|
247 |
+
2
|
248 |
+
</button>
|
249 |
+
<button id="nextPage" class="px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white hover:bg-gray-50">
|
250 |
+
Next
|
251 |
+
</button>
|
252 |
+
</div>
|
253 |
+
</div>
|
254 |
+
</div>
|
255 |
+
</main>
|
256 |
+
|
257 |
+
<!-- History Modal -->
|
258 |
+
<div id="historyModal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50">
|
259 |
+
<div class="relative top-20 mx-auto p-5 border w-3/4 shadow-lg rounded-md bg-white">
|
260 |
+
<div class="flex justify-between items-center mb-4">
|
261 |
+
<h3 class="text-xl font-semibold text-gray-800">
|
262 |
+
<i class="fas fa-history mr-2 text-blue-500"></i>Scraping History
|
263 |
+
</h3>
|
264 |
+
<button id="closeHistoryModal" class="text-gray-500 hover:text-gray-700">
|
265 |
+
<i class="fas fa-times"></i>
|
266 |
+
</button>
|
267 |
+
</div>
|
268 |
+
<div class="overflow-y-auto max-h-96">
|
269 |
+
<table class="min-w-full divide-y divide-gray-200">
|
270 |
+
<thead class="bg-gray-50">
|
271 |
+
<tr>
|
272 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
|
273 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Query</th>
|
274 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Location</th>
|
275 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Results</th>
|
276 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
277 |
+
</tr>
|
278 |
+
</thead>
|
279 |
+
<tbody id="historyTable" class="bg-white divide-y divide-gray-200">
|
280 |
+
<!-- History items will be added here -->
|
281 |
+
</tbody>
|
282 |
+
</table>
|
283 |
+
</div>
|
284 |
+
<div class="mt-4 flex justify-end">
|
285 |
+
<button id="clearHistory" class="px-4 py-2 bg-red-100 hover:bg-red-200 text-red-600 rounded-lg mr-2">
|
286 |
+
Clear History
|
287 |
+
</button>
|
288 |
+
<button id="closeHistoryModalBtn" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg">
|
289 |
+
Close
|
290 |
+
</button>
|
291 |
+
</div>
|
292 |
+
</div>
|
293 |
+
</div>
|
294 |
+
|
295 |
+
<!-- Export Modal -->
|
296 |
+
<div id="exportModal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50">
|
297 |
+
<div class="relative top-20 mx-auto p-5 border w-1/2 shadow-lg rounded-md bg-white">
|
298 |
+
<div class="flex justify-between items-center mb-4">
|
299 |
+
<h3 class="text-xl font-semibold text-gray-800">
|
300 |
+
<i class="fas fa-file-export mr-2 text-blue-500"></i>Export Options
|
301 |
+
</h3>
|
302 |
+
<button id="closeExportModal" class="text-gray-500 hover:text-gray-700">
|
303 |
+
<i class="fas fa-times"></i>
|
304 |
+
</button>
|
305 |
+
</div>
|
306 |
+
<div class="space-y-4">
|
307 |
+
<div>
|
308 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Format</label>
|
309 |
+
<select id="exportFormat" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
310 |
+
<option value="csv">CSV</option>
|
311 |
+
<option value="excel">Excel</option>
|
312 |
+
<option value="json">JSON</option>
|
313 |
+
<option value="pdf">PDF</option>
|
314 |
+
</select>
|
315 |
+
</div>
|
316 |
+
<div>
|
317 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Fields to Export</label>
|
318 |
+
<div class="space-y-2">
|
319 |
+
<div class="flex items-center">
|
320 |
+
<input type="checkbox" id="exportName" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked>
|
321 |
+
<label for="exportName" class="ml-2 block text-sm text-gray-700">Business Name</label>
|
322 |
+
</div>
|
323 |
+
<div class="flex items-center">
|
324 |
+
<input type="checkbox" id="exportAddress" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked>
|
325 |
+
<label for="exportAddress" class="ml-2 block text-sm text-gray-700">Address</label>
|
326 |
+
</div>
|
327 |
+
<div class="flex items-center">
|
328 |
+
<input type="checkbox" id="exportPhone" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked>
|
329 |
+
<label for="exportPhone" class="ml-2 block text-sm text-gray-700">Phone</label>
|
330 |
+
</div>
|
331 |
+
<div class="flex items-center">
|
332 |
+
<input type="checkbox" id="exportRating" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked>
|
333 |
+
<label for="exportRating" class="ml-2 block text-sm text-gray-700">Rating</label>
|
334 |
+
</div>
|
335 |
+
</div>
|
336 |
+
</div>
|
337 |
+
</div>
|
338 |
+
<div class="mt-6 flex justify-end">
|
339 |
+
<button id="cancelExport" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg mr-2">
|
340 |
+
Cancel
|
341 |
+
</button>
|
342 |
+
<button id="confirmExport" class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg">
|
343 |
+
<i class="fas fa-download mr-2"></i> Export
|
344 |
+
</button>
|
345 |
+
</div>
|
346 |
+
</div>
|
347 |
+
</div>
|
348 |
+
|
349 |
+
<!-- Footer -->
|
350 |
+
<footer class="mt-12 text-center text-gray-500 text-sm">
|
351 |
+
<p>© 2023 Maps Scraper Pro. All rights reserved.</p>
|
352 |
+
<p class="mt-1">This tool is for educational purposes only. Please respect Google's Terms of Service.</p>
|
353 |
+
</footer>
|
354 |
+
</div>
|
355 |
+
|
356 |
+
<script>
|
357 |
+
// Global variables
|
358 |
+
let scrapingInterval;
|
359 |
+
let currentPage = 1;
|
360 |
+
let resultsPerPage = 10;
|
361 |
+
let allResults = [];
|
362 |
+
let scrapingHistory = JSON.parse(localStorage.getItem('scrapingHistory')) || [];
|
363 |
+
let credits = parseInt(localStorage.getItem('credits')) || 124;
|
364 |
+
|
365 |
+
// DOM elements
|
366 |
+
const searchQuery = document.getElementById('searchQuery');
|
367 |
+
const locationInput = document.getElementById('location');
|
368 |
+
const radius = document.getElementById('radius');
|
369 |
+
const maxResults = document.getElementById('maxResults');
|
370 |
+
const language = document.getElementById('language');
|
371 |
+
const dataPoints = document.getElementById('dataPoints');
|
372 |
+
const startScrapingBtn = document.getElementById('startScraping');
|
373 |
+
const stopScrapingBtn = document.getElementById('stopScraping');
|
374 |
+
const progressSection = document.getElementById('progressSection');
|
375 |
+
const loadingBar = document.getElementById('loadingBar');
|
376 |
+
const progressPercent = document.getElementById('progressPercent');
|
377 |
+
const processedCount = document.getElementById('processedCount');
|
378 |
+
const totalCount = document.getElementById('totalCount');
|
379 |
+
const statusMessage = document.getElementById('statusMessage');
|
380 |
+
const resultsTable = document.getElementById('resultsTable');
|
381 |
+
const loadingPlaceholder = document.getElementById('loadingPlaceholder');
|
382 |
+
const creditsDisplay = document.getElementById('credits');
|
383 |
+
const timeElapsed = document.getElementById('timeElapsed');
|
384 |
+
const timeRemaining = document.getElementById('timeRemaining');
|
385 |
+
const showingFrom = document.getElementById('showingFrom');
|
386 |
+
const showingTo = document.getElementById('showingTo');
|
387 |
+
const totalResults = document.getElementById('totalResults');
|
388 |
+
const prevPage = document.getElementById('prevPage');
|
389 |
+
const nextPage = document.getElementById('nextPage');
|
390 |
+
const page1 = document.getElementById('page1');
|
391 |
+
const page2 = document.getElementById('page2');
|
392 |
+
const historyBtn = document.getElementById('historyBtn');
|
393 |
+
const historyModal = document.getElementById('historyModal');
|
394 |
+
const closeHistoryModal = document.getElementById('closeHistoryModal');
|
395 |
+
const closeHistoryModalBtn = document.getElementById('closeHistoryModalBtn');
|
396 |
+
const clearHistory = document.getElementById('clearHistory');
|
397 |
+
const historyTable = document.getElementById('historyTable');
|
398 |
+
const exportBtn = document.getElementById('exportBtn');
|
399 |
+
const exportModal = document.getElementById('exportModal');
|
400 |
+
const closeExportModal = document.getElementById('closeExportModal');
|
401 |
+
const cancelExport = document.getElementById('cancelExport');
|
402 |
+
const confirmExport = document.getElementById('confirmExport');
|
403 |
+
const searchBtn = document.getElementById('searchBtn');
|
404 |
+
|
405 |
+
// Initialize
|
406 |
+
creditsDisplay.textContent = credits;
|
407 |
+
|
408 |
+
// Event listeners
|
409 |
+
startScrapingBtn.addEventListener('click', startScraping);
|
410 |
+
stopScrapingBtn.addEventListener('click', stopScraping);
|
411 |
+
searchBtn.addEventListener('click', validateAndStartScraping);
|
412 |
+
prevPage.addEventListener('click', () => changePage(-1));
|
413 |
+
nextPage.addEventListener('click', () => changePage(1));
|
414 |
+
page1.addEventListener('click', () => goToPage(1));
|
415 |
+
page2.addEventListener('click', () => goToPage(2));
|
416 |
+
historyBtn.addEventListener('click', showHistoryModal);
|
417 |
+
closeHistoryModal.addEventListener('click', hideHistoryModal);
|
418 |
+
closeHistoryModalBtn.addEventListener('click', hideHistoryModal);
|
419 |
+
clearHistory.addEventListener('click', clearScrapingHistory);
|
420 |
+
exportBtn.addEventListener('click', showExportModal);
|
421 |
+
closeExportModal.addEventListener('click', hideExportModal);
|
422 |
+
cancelExport.addEventListener('click', hideExportModal);
|
423 |
+
confirmExport.addEventListener('click', exportResults);
|
424 |
+
|
425 |
+
// Functions
|
426 |
+
function validateAndStartScraping() {
|
427 |
+
if (!searchQuery.value.trim()) {
|
428 |
+
showTooltip(searchQuery, 'Please enter a search query');
|
429 |
+
return;
|
430 |
+
}
|
431 |
+
|
432 |
+
if (!locationInput.value.trim()) {
|
433 |
+
showTooltip(locationInput, 'Please enter a location');
|
434 |
+
return;
|
435 |
+
}
|
436 |
+
|
437 |
+
startScraping();
|
438 |
+
}
|
439 |
+
|
440 |
+
function showTooltip(element, message) {
|
441 |
+
const tooltip = document.createElement('div');
|
442 |
+
tooltip.className = 'absolute z-10 bg-red-500 text-white text-xs rounded py-1 px-2 mt-1';
|
443 |
+
tooltip.textContent = message;
|
444 |
+
|
445 |
+
const rect = element.getBoundingClientRect();
|
446 |
+
tooltip.style.top = `${rect.bottom}px`;
|
447 |
+
tooltip.style.left = `${rect.left}px`;
|
448 |
+
|
449 |
+
document.body.appendChild(tooltip);
|
450 |
+
|
451 |
+
setTimeout(() => {
|
452 |
+
tooltip.remove();
|
453 |
+
}, 3000);
|
454 |
+
}
|
455 |
+
|
456 |
+
function startScraping() {
|
457 |
+
if (credits < 10) {
|
458 |
+
alert('Not enough credits. Please upgrade your plan.');
|
459 |
+
return;
|
460 |
+
}
|
461 |
+
|
462 |
+
// Deduct credits
|
463 |
+
credits -= 10;
|
464 |
+
creditsDisplay.textContent = credits;
|
465 |
+
localStorage.setItem('credits', credits.toString());
|
466 |
+
|
467 |
+
// Show progress section
|
468 |
+
progressSection.classList.remove('hidden');
|
469 |
+
|
470 |
+
// Set total count
|
471 |
+
const total = parseInt(maxResults.value);
|
472 |
+
totalCount.textContent = total;
|
473 |
+
|
474 |
+
// Clear previous results
|
475 |
+
resultsTable.innerHTML = '';
|
476 |
+
|
477 |
+
// Add loading row
|
478 |
+
const loadingRow = document.createElement('tr');
|
479 |
+
loadingRow.className = 'animate-pulse';
|
480 |
+
loadingRow.innerHTML = `
|
481 |
+
<td class="px-6 py-4 whitespace-nowrap" colspan="5">
|
482 |
+
<div class="flex justify-center items-center h-20 text-gray-400">
|
483 |
+
<i class="fas fa-spinner fa-spin text-2xl mr-3"></i>
|
484 |
+
<span class="text-lg">Scraping data from Google Maps...</span>
|
485 |
+
</div>
|
486 |
+
</td>
|
487 |
+
`;
|
488 |
+
resultsTable.appendChild(loadingRow);
|
489 |
+
|
490 |
+
// Disable start button and enable stop button
|
491 |
+
startScrapingBtn.disabled = true;
|
492 |
+
stopScrapingBtn.disabled = false;
|
493 |
+
|
494 |
+
// Start timer
|
495 |
+
let seconds = 0;
|
496 |
+
const timer = setInterval(() => {
|
497 |
+
seconds++;
|
498 |
+
timeElapsed.textContent = `Time elapsed: ${seconds}s`;
|
499 |
+
}, 1000);
|
500 |
+
|
501 |
+
// Simulate progress
|
502 |
+
let progress = 0;
|
503 |
+
scrapingInterval = setInterval(() => {
|
504 |
+
progress += Math.floor(Math.random() * 5) + 1;
|
505 |
+
if (progress > 100) progress = 100;
|
506 |
+
|
507 |
+
loadingBar.style.width = `${progress}%`;
|
508 |
+
progressPercent.textContent = `${progress}%`;
|
509 |
+
processedCount.textContent = Math.floor((progress / 100) * total);
|
510 |
+
|
511 |
+
// Update time remaining estimate
|
512 |
+
if (progress > 10) {
|
513 |
+
const estimatedTotalTime = (seconds * 100) / progress;
|
514 |
+
const remainingTime = Math.max(0, Math.round(estimatedTotalTime - seconds));
|
515 |
+
timeRemaining.textContent = `Estimated time remaining: ${remainingTime}s`;
|
516 |
+
}
|
517 |
+
|
518 |
+
if (progress < 30) {
|
519 |
+
statusMessage.textContent = 'Locating businesses in the area...';
|
520 |
+
} else if (progress < 60) {
|
521 |
+
statusMessage.textContent = 'Extracting contact information...';
|
522 |
+
} else if (progress < 90) {
|
523 |
+
statusMessage.textContent = 'Gathering reviews and ratings...';
|
524 |
+
} else {
|
525 |
+
statusMessage.textContent = 'Finalizing data collection...';
|
526 |
+
}
|
527 |
+
|
528 |
+
if (progress === 100) {
|
529 |
+
clearInterval(scrapingInterval);
|
530 |
+
clearInterval(timer);
|
531 |
+
statusMessage.textContent = 'Scraping completed successfully!';
|
532 |
+
|
533 |
+
// Remove loading row
|
534 |
+
resultsTable.removeChild(loadingRow);
|
535 |
+
|
536 |
+
// Generate sample results
|
537 |
+
generateSampleResults();
|
538 |
+
|
539 |
+
// Enable start button and disable stop button
|
540 |
+
startScrapingBtn.disabled = false;
|
541 |
+
stopScrapingBtn.disabled = true;
|
542 |
+
|
543 |
+
// Add to history
|
544 |
+
addToHistory();
|
545 |
+
}
|
546 |
+
}, 500);
|
547 |
+
}
|
548 |
+
|
549 |
+
function stopScraping() {
|
550 |
+
clearInterval(scrapingInterval);
|
551 |
+
statusMessage.textContent = 'Scraping stopped by user';
|
552 |
+
loadingBar.style.width = '0%';
|
553 |
+
progressPercent.textContent = '0%';
|
554 |
+
processedCount.textContent = '0';
|
555 |
+
|
556 |
+
// Enable start button and disable stop button
|
557 |
+
startScrapingBtn.disabled = false;
|
558 |
+
stopScrapingBtn.disabled = true;
|
559 |
+
|
560 |
+
// Remove loading row if exists
|
561 |
+
if (resultsTable.querySelector('.animate-pulse')) {
|
562 |
+
resultsTable.removeChild(resultsTable.querySelector('.animate-pulse'));
|
563 |
+
}
|
564 |
+
|
565 |
+
// Add placeholder again
|
566 |
+
resultsTable.appendChild(loadingPlaceholder);
|
567 |
+
}
|
568 |
+
|
569 |
+
function generateSampleResults() {
|
570 |
+
const query = searchQuery.value.toLowerCase();
|
571 |
+
const location = locationInput.value;
|
572 |
+
const total = parseInt(maxResults.value);
|
573 |
+
|
574 |
+
// Generate sample data based on query
|
575 |
+
allResults = [];
|
576 |
+
const categories = query.includes('restaurant') ?
|
577 |
+
['Italian', 'Indian', 'Chinese', 'Mexican', 'Japanese'] :
|
578 |
+
query.includes('hotel') ?
|
579 |
+
['Luxury', 'Budget', 'Boutique', 'Resort', 'Business'] :
|
580 |
+
['Store', 'Shop', 'Outlet', 'Market', 'Boutique'];
|
581 |
+
|
582 |
+
for (let i = 1; i <= total; i++) {
|
583 |
+
const category = categories[Math.floor(Math.random() * categories.length)];
|
584 |
+
const rating = (Math.random() * 1.5 + 3.5).toFixed(1);
|
585 |
+
const reviews = Math.floor(Math.random() * 10000);
|
586 |
+
|
587 |
+
allResults.push({
|
588 |
+
name: `${category} ${query.includes('restaurant') ? 'Restaurant' : query.includes('hotel') ? 'Hotel' : 'Store'} ${i}`,
|
589 |
+
address: `${Math.floor(Math.random() * 1000) + 1} ${['Main', 'Oak', 'Pine', 'Maple', 'Cedar'][Math.floor(Math.random() * 5)]} St, ${location}`,
|
590 |
+
phone: `+1 ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`,
|
591 |
+
rating: rating,
|
592 |
+
reviews: reviews.toLocaleString(),
|
593 |
+
website: `https://www.${category.toLowerCase()}${i}.com`,
|
594 |
+
category: category
|
595 |
+
});
|
596 |
+
}
|
597 |
+
|
598 |
+
// Display first page
|
599 |
+
displayResults(1);
|
600 |
+
|
601 |
+
// Update pagination
|
602 |
+
updatePagination();
|
603 |
+
}
|
604 |
+
|
605 |
+
function displayResults(page) {
|
606 |
+
currentPage = page;
|
607 |
+
const startIdx = (page - 1) * resultsPerPage;
|
608 |
+
const endIdx = Math.min(startIdx + resultsPerPage, allResults.length);
|
609 |
+
const pageResults = allResults.slice(startIdx, endIdx);
|
610 |
+
|
611 |
+
// Clear previous results
|
612 |
+
resultsTable.innerHTML = '';
|
613 |
+
|
614 |
+
// Add results to table
|
615 |
+
pageResults.forEach((business, index) => {
|
616 |
+
const row = document.createElement('tr');
|
617 |
+
row.className = 'result-item hover:bg-gray-50 transition cursor-pointer';
|
618 |
+
row.innerHTML = `
|
619 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
620 |
+
<div class="flex items-center">
|
621 |
+
<div class="flex-shrink-0 h-10 w-10 bg-blue-100 rounded-full flex items-center justify-center">
|
622 |
+
<i class="fas fa-store text-blue-600"></i>
|
623 |
+
</div>
|
624 |
+
<div class="ml-4">
|
625 |
+
<div class="text-sm font-medium text-gray-900">${business.name}</div>
|
626 |
+
<div class="text-sm text-gray-500">${business.reviews} reviews</div>
|
627 |
+
</div>
|
628 |
+
</div>
|
629 |
+
</td>
|
630 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
631 |
+
<div class="text-sm text-gray-900">${business.address}</div>
|
632 |
+
</td>
|
633 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
634 |
+
<div class="text-sm text-gray-900">${business.phone}</div>
|
635 |
+
</td>
|
636 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
637 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
|
638 |
+
${business.rating} ★
|
639 |
+
</span>
|
640 |
+
</td>
|
641 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
642 |
+
<button class="view-details text-blue-600 hover:text-blue-900 mr-3" data-index="${startIdx + index}">
|
643 |
+
<i class="fas fa-eye"></i>
|
644 |
+
</button>
|
645 |
+
<button class="export-item text-green-600 hover:text-green-900" data-index="${startIdx + index}">
|
646 |
+
<i class="fas fa-download"></i>
|
647 |
+
</button>
|
648 |
+
</td>
|
649 |
+
`;
|
650 |
+
resultsTable.appendChild(row);
|
651 |
+
});
|
652 |
+
|
653 |
+
// Add event listeners to new buttons
|
654 |
+
document.querySelectorAll('.view-details').forEach(btn => {
|
655 |
+
btn.addEventListener('click', (e) => {
|
656 |
+
const index = parseInt(e.currentTarget.getAttribute('data-index'));
|
657 |
+
viewBusinessDetails(index);
|
658 |
+
});
|
659 |
+
});
|
660 |
+
|
661 |
+
document.querySelectorAll('.export-item').forEach(btn => {
|
662 |
+
btn.addEventListener('click', (e) => {
|
663 |
+
const index = parseInt(e.currentTarget.getAttribute('data-index'));
|
664 |
+
exportSingleResult(index);
|
665 |
+
});
|
666 |
+
});
|
667 |
+
|
668 |
+
// Update showing counts
|
669 |
+
showingFrom.textContent = startIdx + 1;
|
670 |
+
showingTo.textContent = endIdx;
|
671 |
+
totalResults.textContent = allResults.length;
|
672 |
+
}
|
673 |
+
|
674 |
+
function updatePagination() {
|
675 |
+
const totalPages = Math.ceil(allResults.length / resultsPerPage);
|
676 |
+
|
677 |
+
// Disable/enable previous/next buttons
|
678 |
+
prevPage.disabled = currentPage === 1;
|
679 |
+
nextPage.disabled = currentPage === totalPages;
|
680 |
+
|
681 |
+
// Update page buttons
|
682 |
+
page1.textContent = '1';
|
683 |
+
page1.className = currentPage === 1 ?
|
684 |
+
'px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white font-medium' :
|
685 |
+
'px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white hover:bg-gray-50';
|
686 |
+
|
687 |
+
if (totalPages > 1) {
|
688 |
+
page2.textContent = '2';
|
689 |
+
page2.className = currentPage === 2 ?
|
690 |
+
'px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white font-medium' :
|
691 |
+
'px-3 py-1 border border-gray-300 rounded-md text-gray-500 bg-white hover:bg-gray-50';
|
692 |
+
page2.style.display = 'inline-block';
|
693 |
+
} else {
|
694 |
+
page2.style.display = 'none';
|
695 |
+
}
|
696 |
+
|
697 |
+
// Add more pages if needed (would need more buttons in HTML)
|
698 |
+
}
|
699 |
+
|
700 |
+
function changePage(delta) {
|
701 |
+
const newPage = currentPage + delta;
|
702 |
+
const totalPages = Math.ceil(allResults.length / resultsPerPage);
|
703 |
+
|
704 |
+
if (newPage >= 1 && newPage <= totalPages) {
|
705 |
+
displayResults(newPage);
|
706 |
+
updatePagination();
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
function goToPage(page) {
|
711 |
+
const totalPages = Math.ceil(allResults.length / resultsPerPage);
|
712 |
+
|
713 |
+
if (page >= 1 && page <= totalPages) {
|
714 |
+
displayResults(page);
|
715 |
+
updatePagination();
|
716 |
+
}
|
717 |
+
}
|
718 |
+
|
719 |
+
function viewBusinessDetails(index) {
|
720 |
+
const business = allResults[index];
|
721 |
+
alert(`Business Details:\n\nName: ${business.name}\nAddress: ${business.address}\nPhone: ${business.phone}\nRating: ${business.rating} ★\nReviews: ${business.reviews}\nWebsite: ${business.website}`);
|
722 |
+
}
|
723 |
+
|
724 |
+
function exportSingleResult(index) {
|
725 |
+
const business = allResults[index];
|
726 |
+
const data = `Name: ${business.name}\nAddress: ${business.address}\nPhone: ${business.phone}\nRating: ${business.rating}\nWebsite: ${business.website}`;
|
727 |
+
|
728 |
+
const blob = new Blob([data], { type: 'text/plain' });
|
729 |
+
const url = URL.createObjectURL(blob);
|
730 |
+
const a = document.createElement('a');
|
731 |
+
a.href = url;
|
732 |
+
a.download = `${business.name.replace(/[^a-z0-9]/gi, '_').toLowerCase()}_details.txt`;
|
733 |
+
document.body.appendChild(a);
|
734 |
+
a.click();
|
735 |
+
document.body.removeChild(a);
|
736 |
+
URL.revokeObjectURL(url);
|
737 |
+
}
|
738 |
+
|
739 |
+
function addToHistory() {
|
740 |
+
const historyItem = {
|
741 |
+
date: new Date().toISOString(),
|
742 |
+
query: searchQuery.value,
|
743 |
+
location: locationInput.value,
|
744 |
+
results: allResults.length,
|
745 |
+
dataPoints: dataPoints.value
|
746 |
+
};
|
747 |
+
|
748 |
+
scrapingHistory.unshift(historyItem);
|
749 |
+
if (scrapingHistory.length > 10) {
|
750 |
+
scrapingHistory = scrapingHistory.slice(0, 10);
|
751 |
+
}
|
752 |
+
|
753 |
+
localStorage.setItem('scrapingHistory', JSON.stringify(scrapingHistory));
|
754 |
+
}
|
755 |
+
|
756 |
+
function showHistoryModal() {
|
757 |
+
historyTable.innerHTML = '';
|
758 |
+
|
759 |
+
if (scrapingHistory.length === 0) {
|
760 |
+
const row = document.createElement('tr');
|
761 |
+
row.innerHTML = `
|
762 |
+
<td class="px-6 py-4 whitespace-nowrap text-center text-gray-500" colspan="5">
|
763 |
+
No scraping history found
|
764 |
+
</td>
|
765 |
+
`;
|
766 |
+
historyTable.appendChild(row);
|
767 |
+
} else {
|
768 |
+
scrapingHistory.forEach((item, index) => {
|
769 |
+
const row = document.createElement('tr');
|
770 |
+
row.className = index % 2 === 0 ? 'bg-gray-50' : 'bg-white';
|
771 |
+
row.innerHTML = `
|
772 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
773 |
+
${new Date(item.date).toLocaleString()}
|
774 |
+
</td>
|
775 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
|
776 |
+
${item.query}
|
777 |
+
</td>
|
778 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
779 |
+
${item.location}
|
780 |
+
</td>
|
781 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
782 |
+
${item.results}
|
783 |
+
</td>
|
784 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
785 |
+
<button class="text-blue-600 hover:text-blue-900 mr-3 view-history" data-index="${index}">
|
786 |
+
<i class="fas fa-eye"></i>
|
787 |
+
</button>
|
788 |
+
<button class="text-red-600 hover:text-red-900 delete-history" data-index="${index}">
|
789 |
+
<i class="fas fa-trash"></i>
|
790 |
+
</button>
|
791 |
+
</td>
|
792 |
+
`;
|
793 |
+
historyTable.appendChild(row);
|
794 |
+
});
|
795 |
+
|
796 |
+
// Add event listeners
|
797 |
+
document.querySelectorAll('.view-history').forEach(btn => {
|
798 |
+
btn.addEventListener('click', (e) => {
|
799 |
+
const index = parseInt(e.currentTarget.getAttribute('data-index'));
|
800 |
+
viewHistoryItem(index);
|
801 |
+
});
|
802 |
+
});
|
803 |
+
|
804 |
+
document.querySelectorAll('.delete-history').forEach(btn => {
|
805 |
+
btn.addEventListener('click', (e) => {
|
806 |
+
const index = parseInt(e.currentTarget.getAttribute('data-index'));
|
807 |
+
deleteHistoryItem(index);
|
808 |
+
});
|
809 |
+
});
|
810 |
+
}
|
811 |
+
|
812 |
+
historyModal.classList.remove('hidden');
|
813 |
+
}
|
814 |
+
|
815 |
+
function hideHistoryModal() {
|
816 |
+
historyModal.classList.add('hidden');
|
817 |
+
}
|
818 |
+
|
819 |
+
function viewHistoryItem(index) {
|
820 |
+
const item = scrapingHistory[index];
|
821 |
+
alert(`Scraping Details:\n\nDate: ${new Date(item.date).toLocaleString()}\nQuery: ${item.query}\nLocation: ${item.location}\nResults: ${item.results}\nData Points: ${item.dataPoints}`);
|
822 |
+
}
|
823 |
+
|
824 |
+
function deleteHistoryItem(index) {
|
825 |
+
scrapingHistory.splice(index, 1);
|
826 |
+
localStorage.setItem('scrapingHistory', JSON.stringify(scrapingHistory));
|
827 |
+
showHistoryModal();
|
828 |
+
}
|
829 |
+
|
830 |
+
function clearScrapingHistory() {
|
831 |
+
if (confirm('Are you sure you want to clear all scraping history?')) {
|
832 |
+
scrapingHistory = [];
|
833 |
+
localStorage.removeItem('scrapingHistory');
|
834 |
+
showHistoryModal();
|
835 |
+
}
|
836 |
+
}
|
837 |
+
|
838 |
+
function showExportModal() {
|
839 |
+
if (allResults.length === 0) {
|
840 |
+
alert('No results to export. Please perform a search first.');
|
841 |
+
return;
|
842 |
+
}
|
843 |
+
|
844 |
+
exportModal.classList.remove('hidden');
|
845 |
+
}
|
846 |
+
|
847 |
+
function hideExportModal() {
|
848 |
+
exportModal.classList.add('hidden');
|
849 |
+
}
|
850 |
+
|
851 |
+
function exportResults() {
|
852 |
+
const format = document.getElementById('exportFormat').value;
|
853 |
+
const includeName = document.getElementById('exportName').checked;
|
854 |
+
const includeAddress = document.getElementById('exportAddress').checked;
|
855 |
+
const includePhone = document.getElementById('exportPhone').checked;
|
856 |
+
const includeRating = document.getElementById('exportRating').checked;
|
857 |
+
|
858 |
+
let data;
|
859 |
+
let mimeType;
|
860 |
+
let extension;
|
861 |
+
|
862 |
+
if (format === 'csv') {
|
863 |
+
// Create CSV
|
864 |
+
let csv = '';
|
865 |
+
|
866 |
+
// Headers
|
867 |
+
const headers = [];
|
868 |
+
if (includeName) headers.push('Name');
|
869 |
+
if (includeAddress) headers.push('Address');
|
870 |
+
if (includePhone) headers.push('Phone');
|
871 |
+
if (includeRating) headers.push('Rating');
|
872 |
+
csv += headers.join(',') + '\n';
|
873 |
+
|
874 |
+
// Data
|
875 |
+
allResults.forEach(business => {
|
876 |
+
const row = [];
|
877 |
+
if (includeName) row.push(`"${business.name.replace(/"/g, '""')}"`);
|
878 |
+
if (includeAddress) row.push(`"${business.address.replace(/"/g, '""')}"`);
|
879 |
+
if (includePhone) row.push(`"${business.phone}"`);
|
880 |
+
if (includeRating) row.push(business.rating);
|
881 |
+
csv += row.join(',') + '\n';
|
882 |
+
});
|
883 |
+
|
884 |
+
data = csv;
|
885 |
+
mimeType = 'text/csv';
|
886 |
+
extension = 'csv';
|
887 |
+
} else if (format === 'excel') {
|
888 |
+
// For simplicity, we'll create a CSV that Excel can open
|
889 |
+
let csv = '';
|
890 |
+
|
891 |
+
// Headers
|
892 |
+
const headers = [];
|
893 |
+
if (includeName) headers.push('Name');
|
894 |
+
if (includeAddress) headers.push('Address');
|
895 |
+
if (includePhone) headers.push('Phone');
|
896 |
+
if (includeRating) headers.push('Rating');
|
897 |
+
csv += headers.join('\t') + '\n';
|
898 |
+
|
899 |
+
// Data
|
900 |
+
allResults.forEach(business => {
|
901 |
+
const row = [];
|
902 |
+
if (includeName) row.push(business.name);
|
903 |
+
if (includeAddress) row.push(business.address);
|
904 |
+
if (includePhone) row.push(business.phone);
|
905 |
+
if (includeRating) row.push(business.rating);
|
906 |
+
csv += row.join('\t') + '\n';
|
907 |
+
});
|
908 |
+
|
909 |
+
data = csv;
|
910 |
+
mimeType = 'application/vnd.ms-excel';
|
911 |
+
extension = 'xls';
|
912 |
+
} else if (format === 'json') {
|
913 |
+
// Create JSON
|
914 |
+
const jsonData = allResults.map(business => {
|
915 |
+
const obj = {};
|
916 |
+
if (includeName) obj.name = business.name;
|
917 |
+
if (includeAddress) obj.address = business.address;
|
918 |
+
if (includePhone) obj.phone = business.phone;
|
919 |
+
if (includeRating) obj.rating = business.rating;
|
920 |
+
return obj;
|
921 |
+
});
|
922 |
+
|
923 |
+
data = JSON.stringify(jsonData, null, 2);
|
924 |
+
mimeType = 'application/json';
|
925 |
+
extension = 'json';
|
926 |
+
} else { // PDF
|
927 |
+
// For simplicity, we'll create a text representation
|
928 |
+
let text = 'Google Maps Scraper Results\n\n';
|
929 |
+
|
930 |
+
allResults.forEach((business, index) => {
|
931 |
+
text += `Result ${index + 1}:\n`;
|
932 |
+
if (includeName) text += `Name: ${business.name}\n`;
|
933 |
+
if (includeAddress) text += `Address: ${business.address}\n`;
|
934 |
+
if (includePhone) text += `Phone: ${business.phone}\n`;
|
935 |
+
if (includeRating) text += `Rating: ${business.rating}\n`;
|
936 |
+
text += '\n';
|
937 |
+
});
|
938 |
+
|
939 |
+
data = text;
|
940 |
+
mimeType = 'text/plain';
|
941 |
+
extension = 'txt';
|
942 |
+
}
|
943 |
+
|
944 |
+
// Create download
|
945 |
+
const blob = new Blob([data], { type: mimeType });
|
946 |
+
const url = URL.createObjectURL(blob);
|
947 |
+
const a = document.createElement('a');
|
948 |
+
a.href = url;
|
949 |
+
a.download = `google_maps_results_${new Date().toISOString().slice(0, 10)}.${extension}`;
|
950 |
+
document.body.appendChild(a);
|
951 |
+
a.click();
|
952 |
+
document.body.removeChild(a);
|
953 |
+
URL.revokeObjectURL(url);
|
954 |
+
|
955 |
+
hideExportModal();
|
956 |
+
}
|
957 |
+
</script>
|
958 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=uixhost/web-panel" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
959 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
create invoice A4 size and save pdf tex is GST
|
2 |
+
invoice save single page in pdf and make this invoice is editable after add customber data and add Description Quantity Rate Taxable Value GST % GST Amount Amount then save pdf
|
3 |
+
create fully working invoice genrater save in pdf high quality
|
4 |
+
create this invoice indian format and small font
|
5 |
+
make Google Maps Scraper
|
6 |
+
create in javascript fully working
|