diff --git a/.changeset/bright-bats-stare.md b/.changeset/bright-bats-stare.md deleted file mode 100644 index 9a1515a..0000000 --- a/.changeset/bright-bats-stare.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"google-that": major ---- - -Update CLI to use renamed parser API - -The CLI now uses the new `parsers` option and `ResultParser` type from `google-sr` instead of the old `resultTypes` and `ResultSelector` names. - -**Breaking Change:** -- The CLI option `--resultTypes`/`-r` is now `--parsers`/`-r` to match the new API. diff --git a/.changeset/busy-horses-float.md b/.changeset/busy-horses-float.md deleted file mode 100644 index 113a533..0000000 --- a/.changeset/busy-horses-float.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"google-sr": patch ---- - -Fix delay option in searchWithPages function - -The delay option was previously defined in `SearchOptionsWithPages` interface but was not actually implemented in the `searchWithPages` function. This fix adds the missing delay functionality that applies the specified delay (default 1000ms) between page requests, helping to prevent rate limiting. \ No newline at end of file diff --git a/.changeset/chatty-apes-help.md b/.changeset/chatty-apes-help.md deleted file mode 100644 index 6028108..0000000 --- a/.changeset/chatty-apes-help.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"google-sr-selectors": minor ---- - -Add metadata selectors to OrganicSearchSelector - -This release adds new CSS selectors for extracting metadata from Google search results: - -The `metaSource` and `metaAd` selectors are nested within the `metaContainer` element. - -```ts -const OrganicSearchSelector = { - metaContainer: "span.qXLe6d.dXDvrc", - metaSource: "span.fYyStc:last-of-type", - metaAd: "span.dloBPe.fYyStc", -}; -``` \ No newline at end of file diff --git a/.changeset/cruel-candies-admire.md b/.changeset/cruel-candies-admire.md deleted file mode 100644 index 51303f7..0000000 --- a/.changeset/cruel-candies-admire.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -"google-sr": major ---- - -Replace Axios with native Fetch API - -Replace Axios HTTP client with native fetch API to reduce external dependencies and improve compatibility across environments. - -**Breaking Change**: The `requestConfig` option now accepts the [`RequestOptions`](https://typicalninja.github.io/google-sr/interfaces/google-sr_src.RequestOptions.html) interface (extending [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)) instead of `AxiosRequestConfig`. - -```diff -import { search } from "google-sr"; - -search({ - requestConfig: { -- params: { -+ queryParams: { - safe: "active", - gl: "us", - }, - headers: { - "Some-Header": "value", - }, - }, -}) -``` diff --git a/.changeset/cuddly-bars-do.md b/.changeset/cuddly-bars-do.md deleted file mode 100644 index bc68504..0000000 --- a/.changeset/cuddly-bars-do.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"google-sr": patch ---- - -Optimize parser performance by checking for empty data earlier when noPartialResults is enabled diff --git a/.changeset/fast-moose-lay.md b/.changeset/fast-moose-lay.md deleted file mode 100644 index 4c5318f..0000000 --- a/.changeset/fast-moose-lay.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -"google-sr": major -"google-that": minor ---- - -Rename CurrencyResult to UnitConversionResult - -Rename `CurrencyResult` to `UnitConversionResult` to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions. - -**Breaking Changes:** -- `CurrencyResult` → `UnitConversionResult` -- `CurrencyResultNode` → `UnitConversionResultNode` -- `ResultTypes.CurrencyResult` → `ResultTypes.UnitConversionResult` - - -```diff -- import { CurrencyResult, CurrencyResultNode } from 'google-sr'; -+ import { UnitConversionResult, UnitConversionResultNode } from 'google-sr'; - -const results = search({ - query: "100 USD to EUR", -- parsers: [CurrencyResult] -+ parsers: [UnitConversionResult] -}); - -- if (result.type === ResultTypes.CurrencyResult) { -+ if (result.type === ResultTypes.UnitConversionResult) { - // handle unit conversion result -} -``` diff --git a/.changeset/legal-trams-sit.md b/.changeset/legal-trams-sit.md deleted file mode 100644 index 9ea797a..0000000 --- a/.changeset/legal-trams-sit.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"google-sr-selectors": minor -"google-sr": minor ---- - -Add NewsResult for parsing Google News tab results - -Add `NewsResult` parser for Google News tab search results. Requires setting `tbm: 'nws'` in `requestConfig` and is incompatible with other parsers. - -```ts -import { NewsResult, search } from 'google-sr'; - -const results = await search({ - query: 'latest news', - parsers: [NewsResult], - requestConfig: { - queryParams: { - tbm: 'nws', // Required for news results - }, - }, -}); -``` \ No newline at end of file diff --git a/.changeset/lucky-weeks-fry.md b/.changeset/lucky-weeks-fry.md deleted file mode 100644 index 1ba09ad..0000000 --- a/.changeset/lucky-weeks-fry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"google-sr-selectors": minor -"google-sr": minor ---- - -Add thumbnail image to news parser & selector \ No newline at end of file diff --git a/.changeset/moody-dancers-bake.md b/.changeset/moody-dancers-bake.md deleted file mode 100644 index edbb731..0000000 --- a/.changeset/moody-dancers-bake.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"google-sr": minor ---- - -Add metadata properties to OrganicSearch parser - -The parser now returns an `OrganicResultNode` with the following new properties: - -- `source`: The source of the result, usually a human friendly version of the URL. -- `isAd`: boolean indicating if the result is an ad. - -```diff -export interface OrganicResultNode extends SearchResultNodeLike { - type: typeof ResultTypes.OrganicResult; -+ source: string; -+ isAd: boolean; -} -``` \ No newline at end of file diff --git a/.changeset/old-pugs-hunt.md b/.changeset/old-pugs-hunt.md deleted file mode 100644 index bc966b9..0000000 --- a/.changeset/old-pugs-hunt.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"google-sr": major ---- - -Remove strictSelector in favor of noPartialResults - -Replace `strictSelector` option with `noPartialResults` for improved clarity and better description of its behavior. - -```diff -search({ -- strictSelector: true, -+ noPartialResults: true, -}); -``` diff --git a/.changeset/plenty-houses-beg.md b/.changeset/plenty-houses-beg.md deleted file mode 100644 index 5faf5eb..0000000 --- a/.changeset/plenty-houses-beg.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"google-sr-selectors": major ---- - -Rename CurrencyConvertSelector to UnitConversionSelector - -Rename `CurrencyConvertSelector` to `UnitConversionSelector` to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions. - -**Breaking Changes:** -- `CurrencyConvertSelector` → `UnitConversionSelector` - - -```diff -- import { CurrencyConvertSelector } from 'google-sr-selectors'; -+ import { UnitConversionSelector } from 'google-sr-selectors'; -``` diff --git a/.changeset/ready-worlds-act.md b/.changeset/ready-worlds-act.md deleted file mode 100644 index 3b047ee..0000000 --- a/.changeset/ready-worlds-act.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"google-sr": major ---- - -Fixed types and improved all result parsers - -Fixed generic types for partial results. Now `search` and `searchWithPages` return the correct types based on the `noPartialResults` option. - -**Breaking Changes:** -- `DictionaryResultNode` interface: `phonetic` and `word` properties are now required when `noPartialResults` is `true`. This makes all result types consistent. - - `DictionaryResultNode` now has the proper `type` property. -- All parsers now convert empty strings to `undefined` (this was in the types but not working). This may break your code if you expected empty strings in the previous versions. - -**Other Changes:** -- Refactored all internal parsers for better consistency -- Added better documentation and examples -- Improved parsing reliability \ No newline at end of file diff --git a/.changeset/silver-memes-lose.md b/.changeset/silver-memes-lose.md deleted file mode 100644 index 25638e4..0000000 --- a/.changeset/silver-memes-lose.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"google-that": patch -"google-sr": patch ---- - -Update dependencies to latest versions diff --git a/.changeset/smart-dragons-change.md b/.changeset/smart-dragons-change.md deleted file mode 100644 index 1773723..0000000 --- a/.changeset/smart-dragons-change.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"google-sr-selectors": minor ---- - -Add RelatedSearchesSelector for parsing related search queries - -Add new CSS selectors for extracting related search suggestions that appear at the bottom of Google search results. \ No newline at end of file diff --git a/.changeset/smart-eyes-report.md b/.changeset/smart-eyes-report.md deleted file mode 100644 index 007029a..0000000 --- a/.changeset/smart-eyes-report.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"google-sr-selectors": minor -"google-that": minor -"google-sr": minor ---- - -Migrate packages to ESM-first with CJS compatibility via dual build - -All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided. \ No newline at end of file diff --git a/.changeset/tame-schools-kick.md b/.changeset/tame-schools-kick.md deleted file mode 100644 index 88a9a49..0000000 --- a/.changeset/tame-schools-kick.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"google-sr": major ---- - -Make OrganicResult description field optional - -The `description` field in `OrganicResultNode` is now optional (`string | undefined`) to handle cases where search results don't include a description. This is a breaking change as existing code may need to be updated to handle the undefined case. \ No newline at end of file diff --git a/.changeset/ten-teams-tickle.md b/.changeset/ten-teams-tickle.md deleted file mode 100644 index 84db671..0000000 --- a/.changeset/ten-teams-tickle.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"google-sr": minor ---- - -Add RelatedSearchesResult parser for extracting related search queries - -Add `RelatedSearchesResult` parser to extract the "Related searches" suggestions that Google displays at the bottom of search results to help users find similar queries. - -```ts -import { RelatedSearchesResult, search } from 'google-sr'; - -const results = await search({ - query: 'nodejs frameworks', - parsers: [RelatedSearchesResult], -}); - -// results[0].queries might contain: ["express.js", "react.js", "vue.js", ...] -``` - -The parser returns a `RelatedSearchesResultNode` with: -- `type`: `"RELATED_SEARCHES"` -- `queries`: Array of related search query strings \ No newline at end of file diff --git a/.changeset/thick-maps-fry.md b/.changeset/thick-maps-fry.md deleted file mode 100644 index 2e23198..0000000 --- a/.changeset/thick-maps-fry.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"google-sr": major ---- - -Remove ResultNodeTyper type helper - -`ResultNodeTyper` was a helper type that was used to define the type returned by a parser. This was removed, as it can be replaced with a simple interface definition. - -```diff -- import { ResultNodeTyper } from 'google-sr'; -- type MyCustomNode = ResultNodeTyper<"CUSTOM", 'link' | 'title'>; - -+ interface MyCustomNode { -+ type: "CUSTOM"; -+ link: string; -+ title: string; -+ } -``` diff --git a/.changeset/witty-adults-read.md b/.changeset/witty-adults-read.md deleted file mode 100644 index 7a4363c..0000000 --- a/.changeset/witty-adults-read.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -"google-sr": major ---- - -Rename `ResultSelector` to `ResultParser` and `resultTypes` to `parsers` - -The API has been updated to use more intuitive naming that eliminates confusion between CSS selectors and result parser functions. - -**Breaking Changes:** -- `ResultSelector` type renamed to `ResultParser` -- `resultTypes` option renamed to `parsers` in search functions - -**Migration Guide:** - -```diff -import { search, OrganicResult } from "google-sr"; - -const results = await search({ - query: "hello world", -- resultTypes: [OrganicResult], -+ parsers: [OrganicResult], -}); -``` \ No newline at end of file diff --git a/packages/google-sr-selectors/CHANGELOG.md b/packages/google-sr-selectors/CHANGELOG.md index da7bda2..b0ad4c3 100644 --- a/packages/google-sr-selectors/CHANGELOG.md +++ b/packages/google-sr-selectors/CHANGELOG.md @@ -1,5 +1,66 @@ # google-sr-selectors +## 3.0.0 + +### Major Changes + +- [`786a8fc`](https://github.com/typicalninja/google-sr/commit/786a8fc47a5d4fc1f32afbf2ad7846d6c614af80) Thanks [@typicalninja](https://github.com/typicalninja)! - Rename CurrencyConvertSelector to UnitConversionSelector + + Rename `CurrencyConvertSelector` to `UnitConversionSelector` to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions. + + **Breaking Changes:** + + - `CurrencyConvertSelector` → `UnitConversionSelector` + + ```diff + - import { CurrencyConvertSelector } from 'google-sr-selectors'; + + import { UnitConversionSelector } from 'google-sr-selectors'; + ``` + +### Minor Changes + +- [#90](https://github.com/typicalninja/google-sr/pull/90) [`352ba4c`](https://github.com/typicalninja/google-sr/commit/352ba4c68b19c74596b5f7fed0f243855da50346) Thanks [@typicalninja](https://github.com/typicalninja)! - Add metadata selectors to OrganicSearchSelector + + This release adds new CSS selectors for extracting metadata from Google search results: + + The `metaSource` and `metaAd` selectors are nested within the `metaContainer` element. + + ```ts + const OrganicSearchSelector = { + metaContainer: "span.qXLe6d.dXDvrc", + metaSource: "span.fYyStc:last-of-type", + metaAd: "span.dloBPe.fYyStc", + }; + ``` + +- [#71](https://github.com/typicalninja/google-sr/pull/71) [`cae9f30`](https://github.com/typicalninja/google-sr/commit/cae9f30d98a10b031c8f1833819e30d692f4bfde) Thanks [@tresorama](https://github.com/tresorama)! - Add NewsResult for parsing Google News tab results + + Add `NewsResult` parser for Google News tab search results. Requires setting `tbm: 'nws'` in `requestConfig` and is incompatible with other parsers. + + ```ts + import { NewsResult, search } from "google-sr"; + + const results = await search({ + query: "latest news", + parsers: [NewsResult], + requestConfig: { + queryParams: { + tbm: "nws", // Required for news results + }, + }, + }); + ``` + +- [#89](https://github.com/typicalninja/google-sr/pull/89) [`bb1cc1a`](https://github.com/typicalninja/google-sr/commit/bb1cc1afcd931948b1ebe02bd5627fdc6bc3287e) Thanks [@typicalninja](https://github.com/typicalninja)! - Add thumbnail image to news parser & selector + +- [#96](https://github.com/typicalninja/google-sr/pull/96) [`51580a6`](https://github.com/typicalninja/google-sr/commit/51580a698cb9f465d00edcf5f64ba56add0c5814) Thanks [@typicalninja](https://github.com/typicalninja)! - Add RelatedSearchesSelector for parsing related search queries + + Add new CSS selectors for extracting related search suggestions that appear at the bottom of Google search results. + +- [#94](https://github.com/typicalninja/google-sr/pull/94) [`6c08082`](https://github.com/typicalninja/google-sr/commit/6c08082c298be3ec26c152764de5f05281b375ca) Thanks [@typicalninja](https://github.com/typicalninja)! - Migrate packages to ESM-first with CJS compatibility via dual build + + All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided. + ## 2.0.0 ### Major Changes diff --git a/packages/google-sr-selectors/package.json b/packages/google-sr-selectors/package.json index f273de8..a47d8a6 100644 --- a/packages/google-sr-selectors/package.json +++ b/packages/google-sr-selectors/package.json @@ -1,6 +1,6 @@ { "name": "google-sr-selectors", - "version": "2.0.0", + "version": "3.0.0", "description": "css selectors for google search results", "repository": { "type": "git", diff --git a/packages/google-sr/CHANGELOG.md b/packages/google-sr/CHANGELOG.md index 1ab1b20..af172e9 100644 --- a/packages/google-sr/CHANGELOG.md +++ b/packages/google-sr/CHANGELOG.md @@ -1,5 +1,199 @@ # google-sr +## 6.0.0 + +### Major Changes + +- [#76](https://github.com/typicalninja/google-sr/pull/76) [`51828ad`](https://github.com/typicalninja/google-sr/commit/51828ad0e2a94646ddba8727aea5f6bfce1274c4) Thanks [@typicalninja](https://github.com/typicalninja)! - Replace Axios with native Fetch API + + Replace Axios HTTP client with native fetch API to reduce external dependencies and improve compatibility across environments. + + **Breaking Change**: The `requestConfig` option now accepts the [`RequestOptions`](https://typicalninja.github.io/google-sr/interfaces/google-sr_src.RequestOptions.html) interface (extending [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)) instead of `AxiosRequestConfig`. + + ```diff + import { search } from "google-sr"; + + search({ + requestConfig: { + - params: { + + queryParams: { + safe: "active", + gl: "us", + }, + headers: { + "Some-Header": "value", + }, + }, + }) + ``` + +- [#79](https://github.com/typicalninja/google-sr/pull/79) [`ae54adf`](https://github.com/typicalninja/google-sr/commit/ae54adf075c39771c09a1cfb719d5affe0dfd49d) Thanks [@typicalninja](https://github.com/typicalninja)! - Rename CurrencyResult to UnitConversionResult + + Rename `CurrencyResult` to `UnitConversionResult` to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions. + + **Breaking Changes:** + + - `CurrencyResult` → `UnitConversionResult` + - `CurrencyResultNode` → `UnitConversionResultNode` + - `ResultTypes.CurrencyResult` → `ResultTypes.UnitConversionResult` + + ```diff + - import { CurrencyResult, CurrencyResultNode } from 'google-sr'; + + import { UnitConversionResult, UnitConversionResultNode } from 'google-sr'; + + const results = search({ + query: "100 USD to EUR", + - parsers: [CurrencyResult] + + parsers: [UnitConversionResult] + }); + + - if (result.type === ResultTypes.CurrencyResult) { + + if (result.type === ResultTypes.UnitConversionResult) { + // handle unit conversion result + } + ``` + +- [#80](https://github.com/typicalninja/google-sr/pull/80) [`592ea47`](https://github.com/typicalninja/google-sr/commit/592ea4764a5947ab8c90aa51b06d50cdcb6ff607) Thanks [@typicalninja](https://github.com/typicalninja)! - Remove strictSelector in favor of noPartialResults + + Replace `strictSelector` option with `noPartialResults` for improved clarity and better description of its behavior. + + ```diff + search({ + - strictSelector: true, + + noPartialResults: true, + }); + ``` + +- [#92](https://github.com/typicalninja/google-sr/pull/92) [`2722f6d`](https://github.com/typicalninja/google-sr/commit/2722f6d1b39e9103c5f105ca893dcd90ead98193) Thanks [@typicalninja](https://github.com/typicalninja)! - Fixed types and improved all result parsers + + Fixed generic types for partial results. Now `search` and `searchWithPages` return the correct types based on the `noPartialResults` option. + + **Breaking Changes:** + + - `DictionaryResultNode` interface: `phonetic` and `word` properties are now required when `noPartialResults` is `true`. This makes all result types consistent. + - `DictionaryResultNode` now has the proper `type` property. + - All parsers now convert empty strings to `undefined` (this was in the types but not working). This may break your code if you expected empty strings in the previous versions. + + **Other Changes:** + + - Refactored all internal parsers for better consistency + - Added better documentation and examples + - Improved parsing reliability + +- [#93](https://github.com/typicalninja/google-sr/pull/93) [`4ac1402`](https://github.com/typicalninja/google-sr/commit/4ac14024070f16db370de4c51fa6ce956b16eaa0) Thanks [@typicalninja](https://github.com/typicalninja)! - Make OrganicResult description field optional + + The `description` field in `OrganicResultNode` is now optional (`string | undefined`) to handle cases where search results don't include a description. This is a breaking change as existing code may need to be updated to handle the undefined case. + +- [#73](https://github.com/typicalninja/google-sr/pull/73) [`f462148`](https://github.com/typicalninja/google-sr/commit/f462148023b580d10703b5e767dafd7811ff5a58) Thanks [@typicalninja](https://github.com/typicalninja)! - Remove ResultNodeTyper type helper + + `ResultNodeTyper` was a helper type that was used to define the type returned by a parser. This was removed, as it can be replaced with a simple interface definition. + + ```diff + - import { ResultNodeTyper } from 'google-sr'; + - type MyCustomNode = ResultNodeTyper<"CUSTOM", 'link' | 'title'>; + + + interface MyCustomNode { + + type: "CUSTOM"; + + link: string; + + title: string; + + } + ``` + +- [#85](https://github.com/typicalninja/google-sr/pull/85) [`85bae81`](https://github.com/typicalninja/google-sr/commit/85bae810fdf33643545ae289d578cbc3ffa97f41) Thanks [@typicalninja](https://github.com/typicalninja)! - Rename `ResultSelector` to `ResultParser` and `resultTypes` to `parsers` + + The API has been updated to use more intuitive naming that eliminates confusion between CSS selectors and result parser functions. + + **Breaking Changes:** + + - `ResultSelector` type renamed to `ResultParser` + - `resultTypes` option renamed to `parsers` in search functions + + **Migration Guide:** + + ```diff + import { search, OrganicResult } from "google-sr"; + + const results = await search({ + query: "hello world", + - resultTypes: [OrganicResult], + + parsers: [OrganicResult], + }); + ``` + +### Minor Changes + +- [#71](https://github.com/typicalninja/google-sr/pull/71) [`cae9f30`](https://github.com/typicalninja/google-sr/commit/cae9f30d98a10b031c8f1833819e30d692f4bfde) Thanks [@tresorama](https://github.com/tresorama)! - Add NewsResult for parsing Google News tab results + + Add `NewsResult` parser for Google News tab search results. Requires setting `tbm: 'nws'` in `requestConfig` and is incompatible with other parsers. + + ```ts + import { NewsResult, search } from "google-sr"; + + const results = await search({ + query: "latest news", + parsers: [NewsResult], + requestConfig: { + queryParams: { + tbm: "nws", // Required for news results + }, + }, + }); + ``` + +- [#89](https://github.com/typicalninja/google-sr/pull/89) [`bb1cc1a`](https://github.com/typicalninja/google-sr/commit/bb1cc1afcd931948b1ebe02bd5627fdc6bc3287e) Thanks [@typicalninja](https://github.com/typicalninja)! - Add thumbnail image to news parser & selector + +- [#90](https://github.com/typicalninja/google-sr/pull/90) [`352ba4c`](https://github.com/typicalninja/google-sr/commit/352ba4c68b19c74596b5f7fed0f243855da50346) Thanks [@typicalninja](https://github.com/typicalninja)! - Add metadata properties to OrganicSearch parser + + The parser now returns an `OrganicResultNode` with the following new properties: + + - `source`: The source of the result, usually a human friendly version of the URL. + - `isAd`: boolean indicating if the result is an ad. + + ```diff + export interface OrganicResultNode extends SearchResultNodeLike { + type: typeof ResultTypes.OrganicResult; + + source: string; + + isAd: boolean; + } + ``` + +- [#94](https://github.com/typicalninja/google-sr/pull/94) [`6c08082`](https://github.com/typicalninja/google-sr/commit/6c08082c298be3ec26c152764de5f05281b375ca) Thanks [@typicalninja](https://github.com/typicalninja)! - Migrate packages to ESM-first with CJS compatibility via dual build + + All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided. + +- [#96](https://github.com/typicalninja/google-sr/pull/96) [`51580a6`](https://github.com/typicalninja/google-sr/commit/51580a698cb9f465d00edcf5f64ba56add0c5814) Thanks [@typicalninja](https://github.com/typicalninja)! - Add RelatedSearchesResult parser for extracting related search queries + + Add `RelatedSearchesResult` parser to extract the "Related searches" suggestions that Google displays at the bottom of search results to help users find similar queries. + + ```ts + import { RelatedSearchesResult, search } from "google-sr"; + + const results = await search({ + query: "nodejs frameworks", + parsers: [RelatedSearchesResult], + }); + + // results[0].queries might contain: ["express.js", "react.js", "vue.js", ...] + ``` + + The parser returns a `RelatedSearchesResultNode` with: + + - `type`: `"RELATED_SEARCHES"` + - `queries`: Array of related search query strings + +### Patch Changes + +- [#98](https://github.com/typicalninja/google-sr/pull/98) [`33993c9`](https://github.com/typicalninja/google-sr/commit/33993c99bcb6f5626f0330f39a441b0de650dac4) Thanks [@typicalninja](https://github.com/typicalninja)! - Fix delay option in searchWithPages function + + The delay option was previously defined in `SearchOptionsWithPages` interface but was not actually implemented in the `searchWithPages` function. This fix adds the missing delay functionality that applies the specified delay (default 1000ms) between page requests, helping to prevent rate limiting. + +- [#83](https://github.com/typicalninja/google-sr/pull/83) [`52d4ed8`](https://github.com/typicalninja/google-sr/commit/52d4ed8229f7c897531904f90bcf0aa5924faa35) Thanks [@typicalninja](https://github.com/typicalninja)! - Optimize parser performance by checking for empty data earlier when noPartialResults is enabled + +- [#65](https://github.com/typicalninja/google-sr/pull/65) [`fe575b5`](https://github.com/typicalninja/google-sr/commit/fe575b56fb8080d155a54f3b0310f209a44c247c) Thanks [@typicalninja](https://github.com/typicalninja)! - Update dependencies to latest versions + +- Updated dependencies [[`352ba4c`](https://github.com/typicalninja/google-sr/commit/352ba4c68b19c74596b5f7fed0f243855da50346), [`cae9f30`](https://github.com/typicalninja/google-sr/commit/cae9f30d98a10b031c8f1833819e30d692f4bfde), [`bb1cc1a`](https://github.com/typicalninja/google-sr/commit/bb1cc1afcd931948b1ebe02bd5627fdc6bc3287e), [`786a8fc`](https://github.com/typicalninja/google-sr/commit/786a8fc47a5d4fc1f32afbf2ad7846d6c614af80), [`51580a6`](https://github.com/typicalninja/google-sr/commit/51580a698cb9f465d00edcf5f64ba56add0c5814), [`6c08082`](https://github.com/typicalninja/google-sr/commit/6c08082c298be3ec26c152764de5f05281b375ca)]: + - google-sr-selectors@3.0.0 + ## 5.0.0 ### Major Changes diff --git a/packages/google-sr/package.json b/packages/google-sr/package.json index 6dd31d3..e99ca4f 100644 --- a/packages/google-sr/package.json +++ b/packages/google-sr/package.json @@ -1,6 +1,6 @@ { "name": "google-sr", - "version": "5.0.0", + "version": "6.0.0", "description": "JavaScript / TypeScript tools to fetch Google search results without an API key.", "repository": { "type": "git", diff --git a/packages/google-that/CHANGELOG.md b/packages/google-that/CHANGELOG.md index 53b9904..ca8e055 100644 --- a/packages/google-that/CHANGELOG.md +++ b/packages/google-that/CHANGELOG.md @@ -1,5 +1,56 @@ # google-that +## 2.0.0 + +### Major Changes + +- [#85](https://github.com/typicalninja/google-sr/pull/85) [`85bae81`](https://github.com/typicalninja/google-sr/commit/85bae810fdf33643545ae289d578cbc3ffa97f41) Thanks [@typicalninja](https://github.com/typicalninja)! - Update CLI to use renamed parser API + + The CLI now uses the new `parsers` option and `ResultParser` type from `google-sr` instead of the old `resultTypes` and `ResultSelector` names. + + **Breaking Change:** + + - The CLI option `--resultTypes`/`-r` is now `--parsers`/`-r` to match the new API. + +### Minor Changes + +- [#79](https://github.com/typicalninja/google-sr/pull/79) [`ae54adf`](https://github.com/typicalninja/google-sr/commit/ae54adf075c39771c09a1cfb719d5affe0dfd49d) Thanks [@typicalninja](https://github.com/typicalninja)! - Rename CurrencyResult to UnitConversionResult + + Rename `CurrencyResult` to `UnitConversionResult` to better reflect its ability to handle all conversion queries (currency, units, measurements, etc.), not just currency conversions. + + **Breaking Changes:** + + - `CurrencyResult` → `UnitConversionResult` + - `CurrencyResultNode` → `UnitConversionResultNode` + - `ResultTypes.CurrencyResult` → `ResultTypes.UnitConversionResult` + + ```diff + - import { CurrencyResult, CurrencyResultNode } from 'google-sr'; + + import { UnitConversionResult, UnitConversionResultNode } from 'google-sr'; + + const results = search({ + query: "100 USD to EUR", + - parsers: [CurrencyResult] + + parsers: [UnitConversionResult] + }); + + - if (result.type === ResultTypes.CurrencyResult) { + + if (result.type === ResultTypes.UnitConversionResult) { + // handle unit conversion result + } + ``` + +- [#94](https://github.com/typicalninja/google-sr/pull/94) [`6c08082`](https://github.com/typicalninja/google-sr/commit/6c08082c298be3ec26c152764de5f05281b375ca) Thanks [@typicalninja](https://github.com/typicalninja)! - Migrate packages to ESM-first with CJS compatibility via dual build + + All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided. + +### Patch Changes + +- [#65](https://github.com/typicalninja/google-sr/pull/65) [`fe575b5`](https://github.com/typicalninja/google-sr/commit/fe575b56fb8080d155a54f3b0310f209a44c247c) Thanks [@typicalninja](https://github.com/typicalninja)! - Update dependencies to latest versions + +- Updated dependencies [[`33993c9`](https://github.com/typicalninja/google-sr/commit/33993c99bcb6f5626f0330f39a441b0de650dac4), [`51828ad`](https://github.com/typicalninja/google-sr/commit/51828ad0e2a94646ddba8727aea5f6bfce1274c4), [`52d4ed8`](https://github.com/typicalninja/google-sr/commit/52d4ed8229f7c897531904f90bcf0aa5924faa35), [`ae54adf`](https://github.com/typicalninja/google-sr/commit/ae54adf075c39771c09a1cfb719d5affe0dfd49d), [`cae9f30`](https://github.com/typicalninja/google-sr/commit/cae9f30d98a10b031c8f1833819e30d692f4bfde), [`bb1cc1a`](https://github.com/typicalninja/google-sr/commit/bb1cc1afcd931948b1ebe02bd5627fdc6bc3287e), [`352ba4c`](https://github.com/typicalninja/google-sr/commit/352ba4c68b19c74596b5f7fed0f243855da50346), [`592ea47`](https://github.com/typicalninja/google-sr/commit/592ea4764a5947ab8c90aa51b06d50cdcb6ff607), [`2722f6d`](https://github.com/typicalninja/google-sr/commit/2722f6d1b39e9103c5f105ca893dcd90ead98193), [`fe575b5`](https://github.com/typicalninja/google-sr/commit/fe575b56fb8080d155a54f3b0310f209a44c247c), [`6c08082`](https://github.com/typicalninja/google-sr/commit/6c08082c298be3ec26c152764de5f05281b375ca), [`4ac1402`](https://github.com/typicalninja/google-sr/commit/4ac14024070f16db370de4c51fa6ce956b16eaa0), [`51580a6`](https://github.com/typicalninja/google-sr/commit/51580a698cb9f465d00edcf5f64ba56add0c5814), [`f462148`](https://github.com/typicalninja/google-sr/commit/f462148023b580d10703b5e767dafd7811ff5a58), [`85bae81`](https://github.com/typicalninja/google-sr/commit/85bae810fdf33643545ae289d578cbc3ffa97f41)]: + - google-sr@6.0.0 + ## 1.1.1 ### Patch Changes diff --git a/packages/google-that/package.json b/packages/google-that/package.json index 751e48f..e92da10 100644 --- a/packages/google-that/package.json +++ b/packages/google-that/package.json @@ -1,6 +1,6 @@ { "name": "google-that", - "version": "1.1.1", + "version": "2.0.0", "description": "CLI tool to scrape google search results without a api key", "author": "typicalninja", "license": "Apache-2.0",