Releases: typicalninja/google-sr
[email protected]
What's Changed
Major Changes
-
563bfc4: Update dictionary selectors with accurate definitions (@typicalninja in #28)
This uses the updated dictionary definitions from google-sr-selectors as a response to google updating their result structure.
Previously, dictionary definitions were returned as a [string, string]. Now, they are returned as an object with the following properties:
interface DictionaryDefinition { partOfSpeech: string; definition: string; example: string; synonyms: string[]; }
Please take steps to update your code to use the new dictionary definition structure.
-
c332095: Rewrite the api to be customizable (@typicalninja in #15/#32)
google-sr has been completely rewritten to be more customizable. It is possible to create your own selector functions and use them to scrape the data you want.
filterResults
option was replaced byresultTypes
which accepts a function instead of a string. This allows you to add your own custom selectors to be used as a parser.search({ - filterResults: [ResultTypes.SearchResult] + resultTypes: [] })
Check the newly added api documentation here
Minor Changes
-
5676a7a: Support custom selectors (@typicalninja in #33)
Use the new
ResultNodeTyper
to create a custom node, and use theResultSelector
to create a function that will parse the raw html for results and return a node.import { ResultNodeTyper, ResultSelector } from "google-sr"; // first argument is the "type" value (string) of the node, second is all the properties of the node type DidYouKnow = ResultNodeTyper< "SOMETYPE", "prop1" | "prop2" > & // properties that are not string can be defined as this { descriptions: string[] }; const selector: ResultSelector<DidYouKnow> = ($, strictSelector) => { // return node }; search({ resultTypes: [selector] });
-
d98c496: Remove uneeded top level options (@typicalninja in #37)
Removed the
safemode
top-level options as the same result can be achieved using the requestConfig option.const queryResult = await search({ - safemode: true, // requestConfig is of type AxiosRequestConfig + requestConfig: { + params: { + // enable "safe mode" + safe: 'active' + }, + }, });
Full Changelog: https://github.com/typicalninja/google-sr/blob/master/packages/google-sr/CHANGELOG.md
Release v3.3.1
What's Changed
- Fixed google-sr package publishing bug, where pnpm did not set package version for a workspace package. reported in #13
Full Changelog: v3.3.0...v3.3.1
Release v3.3.0
What's Changed
- fix: Website behaves weirdly on first load by @typicalninja in #10 (minor non publishing)
- Add a delay to searching pages by @typicalninja in #11 (minor)
Full Changelog: v3.2.1...v3.3.0
Release patch v3.2.1
Selector patches
Patches link
selectors in google-sr-selectors
commit: bb84456
Version updates
-
google-sr-selectors v0.0.2 to npm (commit:
d1802a6
) -
google-that v0.1.3 to npm (commit:
8651bb0
) -
This is a patch version, please update soon as possible (does not include breaking changes)
Full Changelog: v3.1.0...v3.2.1
Release 3.1.0 (minor)
What's Changed
- Add Dictionary results by @typicalninja in #3
- Add Date time results by @typicalninja in #4
- Add Currency conversions results by @typicalninja in #5
Full Changelog: v3.0.0...v3.1.0
Install the latest "minor" release: https://www.npmjs.com/package/google-sr
Release 3.0.0
After I sort of abandoned this project last year, its back!!! all selectors have been updated and now search results are being successfully scraped again. new website is also launched
Full Changelog: https://github.com/typicalninja493/google-sr/commits/v3.0.0