diff --git a/vite-project/public/manifest.json b/vite-project/public/manifest.json index 0c7e47c..a6684fb 100644 --- a/vite-project/public/manifest.json +++ b/vite-project/public/manifest.json @@ -10,5 +10,5 @@ "icons": { "128": "./archivescraper.png" }, - "host_permissions": ["https://api.ebay.com/*"] + "host_permissions": ["https://*/"] } \ No newline at end of file diff --git a/vite-project/src/SearchForm.jsx b/vite-project/src/SearchForm.jsx index 3712209..8bca446 100644 --- a/vite-project/src/SearchForm.jsx +++ b/vite-project/src/SearchForm.jsx @@ -16,10 +16,22 @@ export function SearchForm({callback, callBackSelected}) { function checkSelected(event) { if (callBackSelected == "eBay") { eBayApiCall(); + } else if (callBackSelected == "Buyee Auction"){ + scrapeBuyeeAuction(); } event.preventDefault(); } - + + // Scrape buyee + async function scrapeBuyeeAuction(){ + const req = await fetch(`https://buyee.jp/item/search/query/${search}` + ) + + const html = await req.text(); + console.log(html); + return '' + } + // get ebay AccessToken function eBayApiCall() {