mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-10-25 01:51:16 +00:00
Replace the default SERP provider to SerpApi
Updated all references from the previous default SERP provider to SerpApi, including API keys, proxy configuration, and documentation links. Adjusted aviation.js to use SerpApi endpoints and parameters, and updated testloader.js to reflect the new provider. This change standardizes the search engine scraping integration to use SerpApi.
This commit is contained in:
parent
21f2187d17
commit
5ccba3b107
|
|
@ -27,11 +27,12 @@ WelsonJS = ***W***indows + ***El***ectr***on***-like + ***Javascript(JS)*** + :h
|
|||
|
||||
## Sponsors
|
||||
* :octocat: [GitHub Sponsors](https://github.com/sponsors/gnh1201), :coffee: [Buy me a coffee](https://buymeacoffee.com/catswords)
|
||||
* <img src="https://ics.catswords.net/serpapi_logo_32.png" height="32" alt=""/> [SerpApi](https://serpapi.com/?utm_source=welsonjs) - Scrape search engines results with simple API.
|
||||
* <img src="https://ics.catswords.net/logo_oss.gif" height="32" alt=""/> [Open SW Portal](https://oss.kr), NIPA National IT Industry Promotion Agency<sup>(정보통신산업진흥원)</sup>
|
||||
* <img src="https://ics.catswords.net/signpath_logo.png" height="32" alt=""/> Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org/)
|
||||
* <img src="https://ics.catswords.net/f1security_logo.png" height="32" alt=""/> [F1Security<sup>(에프원시큐리티)</sup>](https://f1security.co.kr/) provides [industry-leading](https://www.ksecurity.or.kr/kisis/subIndex/469.do) web security services.
|
||||
* <img src="https://ics.catswords.net/microsoft_logo.png" height="32" alt=""/> [Microsoft ISV Success Program](https://www.microsoft.com/en-us/isv/isv-success), Grow your business with powerful tools.
|
||||
* :zap: [Integrations](https://catswords-oss.rdbl.io/5719744820/8278298336) ([ScrapeOps](https://scrapeops.io?fpr=namhyeon75), [SearchApi](https://www.searchapi.io/?via=namhyeon), [AviationStack](https://aviationstack.com?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=namhyeon71), [Coupang](https://link.coupang.com/a/b7HV3V)...)
|
||||
* :zap: [Integrations](https://catswords-oss.rdbl.io/5719744820/8278298336) ([ScrapeOps](https://scrapeops.io?fpr=namhyeon75), [AviationStack](https://aviationstack.com?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=namhyeon71), [Coupang](https://link.coupang.com/a/b7HV3V)...)
|
||||
|
||||
## System Requirements
|
||||
* **Operating Systems**: Windows XP SP3 or later (Currently, Windows 11 24H2)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
"clovastudio": "file:data/clovastudio_apikey.txt",
|
||||
"catswords-ai": "file:data/catswords_ai_apikey.txt",
|
||||
"scrapeops": "file:data/scrapeops_apikey.txt",
|
||||
"searchapi": "file:data/searchapi_apikey.txt",
|
||||
"serpapi": "file:data/serp_apikey.txt",
|
||||
"aviationstack": "file:data/aviationstack_apikey.txt",
|
||||
"abuseipdb": "file:data/abuseipdb_apikey.txt"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
},
|
||||
{
|
||||
"type": "serp",
|
||||
"provider": "searchapi",
|
||||
"url": "https://www.searchapi.io/api/v1/search?api_key={api_key}&engine={engine}&q={q}",
|
||||
"documentation": "https://www.searchapi.io/?via=namhyeon"
|
||||
"provider": "serpapi",
|
||||
"url": "https://serpapi.com/search.json?api_key={api_key}&engine={engine}&q={q}",
|
||||
"documentation": "https://serpapi.com/?utm_source=welsonjs"
|
||||
},
|
||||
{
|
||||
"type": "serp",
|
||||
|
|
|
|||
|
|
@ -4,13 +4,16 @@
|
|||
// https://github.com/gnh1201/welsonjs
|
||||
//
|
||||
// SECURITY NOTICE
|
||||
// AviationStack, SearchApi requires an internet connection, and data may be transmitted externally. Please check the terms of use and privacy policy.
|
||||
// AviationStack, SerpApi requires an internet connection, and data may be transmitted externally. Please check the terms of use and privacy policy.
|
||||
// https://aviationstack.com/?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=namhyeon71
|
||||
// https://www.searchapi.io/?via=namhyeon
|
||||
// https://serpapi.com/security?utm_source=welsonjs
|
||||
//
|
||||
var HTTP = require("lib/http");
|
||||
var CRED = require("lib/credentials");
|
||||
|
||||
var DEFAULT_CURRENCY = "USD";
|
||||
var DEFAULT_LANGUAGE_CODE = "en";
|
||||
|
||||
function getData(type, params, limit, offset) {
|
||||
var params = params || {};
|
||||
var limit = (function(n) {
|
||||
|
|
@ -71,15 +74,16 @@ function getFlightsFuture(params, limit, offset) {
|
|||
function getRoundTrip(arrival_id, departure_id, outbound_date, return_date) {
|
||||
var response = HTTP.create()
|
||||
.setParameters({
|
||||
"api_key": CRED.get("apikey", "searchapi"),
|
||||
"arrival_id": arrival_id,
|
||||
"departure_id": departure_id,
|
||||
"engine": "google_flights",
|
||||
"flight_type": "round_trip",
|
||||
"outbound_date": outbound_date,
|
||||
"return_date": return_date
|
||||
engine: "google_flights",
|
||||
departure_id: departure_id,
|
||||
arrival_id: arrival_id,
|
||||
outbound_date: outbound_date,
|
||||
return_date: return_date,
|
||||
currency: DEFAULT_CURRENCY,
|
||||
hl: DEFAULT_LANGUAGE_CODE,
|
||||
api_key: CRED.get("apikey", "serpapi")
|
||||
})
|
||||
.open("GET", "https://www.searchapi.io/api/v1/search")
|
||||
.open("GET", "https://serpapi.com/search.json")
|
||||
.send();
|
||||
|
||||
return response.responseBody;
|
||||
|
|
@ -88,14 +92,16 @@ function getRoundTrip(arrival_id, departure_id, outbound_date, return_date) {
|
|||
function getOneWay(arrival_id, departure_id, outbound_date) {
|
||||
var response = HTTP.create()
|
||||
.setParameters({
|
||||
"api_key": CRED.get("apikey", "searchapi"),
|
||||
"arrival_id": arrival_id,
|
||||
"departure_id": departure_id,
|
||||
"engine": "google_flights",
|
||||
"flight_type": "one_way",
|
||||
"outbound_date": outbound_date
|
||||
engine: "google_flights",
|
||||
departure_id: departure_id,
|
||||
arrival_id: arrival_id,
|
||||
outbound_date: outbound_date,
|
||||
return_date: "",
|
||||
currency: DEFAULT_CURRENCY,
|
||||
hl: DEFAULT_LANGUAGE_CODE,
|
||||
api_key: CRED.get("apikey", "serpapi")
|
||||
})
|
||||
.open("GET", "https://www.searchapi.io/api/v1/search")
|
||||
.open("GET", "https://serpapi.com/search.json")
|
||||
.send();
|
||||
|
||||
return response.responseBody;
|
||||
|
|
@ -114,7 +120,7 @@ exports.getFlightsFuture = getFlightsFuture;
|
|||
exports.getRoundTrip = getRoundTrip;
|
||||
exports.getOneWay = getOneWay;
|
||||
|
||||
exports.VERSIONINFO = "Aviation Data Integration (aviation.js) version 0.1.3";
|
||||
exports.VERSIONINFO = "Aviation Data Integration (aviation.js) version 0.1.4";
|
||||
exports.AUTHOR = "gnh1201@catswords.re.kr";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
|
|||
|
|
@ -1029,18 +1029,18 @@ var test_implements = {
|
|||
console.log("responseBody:", response.responseBody);
|
||||
},
|
||||
|
||||
// https://catswords-oss.rdbl.io/5719744820/8278298336
|
||||
// How to use: https://catswords-oss.rdbl.io/5719744820/8278298336
|
||||
"proxy_serp": function() {
|
||||
var HTTP = require("lib/http");
|
||||
var CRED = require("lib/credentials");
|
||||
|
||||
var response = HTTP.create()
|
||||
.setVariables({
|
||||
"api_key": CRED.get("apikey", "searchapi")
|
||||
"api_key": CRED.get("apikey", "serpapi")
|
||||
})
|
||||
.setProxy({
|
||||
"enabled": true,
|
||||
"provider": "searchapi",
|
||||
"provider": "serpapi",
|
||||
"type": "serp"
|
||||
})
|
||||
.open("GET", "https://www.google.com/search?q=test")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user