MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / query

Function query

apps/web/services/crawler/index.ts:11–24  ·  view source on GitHub ↗
(site: string)

Source from the content-addressed store, hash-verified

9}
10
11async function query(site: string) {
12 const result = await axios.get(
13 `https://www.google.com/search?q=site:${site}`,
14 {
15 headers: {
16 'User-Agent':
17 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
18 },
19 }
20 );
21 const $ = load(result.data);
22 const resultStats = $('#result-stats').text();
23 return Number(getResult(resultStats) || 0);
24}
25
26export async function crawlGoogleResults() {
27 const accounts = await findAccountsPremium();

Callers 2

processQueryFunction · 0.85
crawlGoogleResultsFunction · 0.85

Calls 2

getResultFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected