Skip to content

Commit 696e11d

Browse files
authored
refactor: reformat docs (#55)
* docs: reformat main readme center the header readme * docs: reformat docs, fix typos * docs(gsr-selectors): fix header links * docs(gsr): fix links section
1 parent ac7115f commit 696e11d

File tree

5 files changed

+139
-128
lines changed

5 files changed

+139
-128
lines changed

README.md

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
# google-sr
1+
[npm-gsr]: https://www.npmjs.com/package/google-sr
2+
[stargazers]: https://github.com/typicalninja/google-sr/stargazers
3+
[discord]: https://discord.gg/ynwckXS9T2
4+
[test-action]: https://github.com/typicalninja/google-sr/actions/workflows/tests.yml
5+
[api-docs]: https://typicalninja.github.io/google-sr/
6+
[codefactor]: https://www.codefactor.io/repository/github/typicalninja/google-sr
27

3-
[![testing workflow](https://github.com/typicalninja/google-sr/actions/workflows/tests.yml/badge.svg)](https://github.com/typicalninja/google-sr)
4-
[![GitHub issues](https://img.shields.io/github/issues/typicalninja/google-sr)](https://github.com/typicalninja/google-sr/issues)
5-
[![GitHub Repo stars](https://img.shields.io/github/stars/typicalninja/google-sr)](https://github.com/typicalninja/google-sr/stargazers)
6-
[![CodeFactor](https://www.codefactor.io/repository/github/typicalninja/google-sr/badge)](https://www.codefactor.io/repository/github/typicalninja/google-sr)
7-
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
8-
[![Discord](https://img.shields.io/discord/807868280387665970)](https://discord.gg/ynwckXS9T2)
8+
<h1 align="center">Google-sr</h1>
99

10-
Scrape google-sr search results without an API key with javascript/typescript.
10+
<p align="center">Scrape google search results without an API key with javascript/typescript.</p>
11+
12+
<div align="center">
13+
14+
[![testing workflow](https://img.shields.io/github/actions/workflow/status/typicalninja/google-sr/tests.yml?style=flat)][test-action]
15+
[![GitHub Repo stars](https://img.shields.io/github/stars/typicalninja/google-sr?style=flat)][stargazers]
16+
[![Discord](https://img.shields.io/discord/807868280387665970?style=flat)][discord]
17+
[![Monthly downloads](https://img.shields.io/npm/dm/google-sr?style=flat)][npm-gsr]
18+
[![CodeFactor](https://www.codefactor.io/repository/github/typicalninja/google-sr/badge)][codefactor]
19+
20+
</div>
21+
22+
<div align="center">
23+
24+
**[Installation](#install) |
25+
[Getting started](#usage) |
26+
[API Documentation][api-docs] |
27+
[Disclaimer](#disclaimer)**
28+
29+
</div>
1130

1231
# Install
1332

@@ -17,7 +36,7 @@ Scrape google-sr search results without an API key with javascript/typescript.
1736

1837
- [Node.js](https://nodejs.org/en)
1938
- [Bun](https://bun.sh/)
20-
- [Deno](https://deno.com/) (with the [`npm:` specifier](https://docs.deno.com/runtime/fundamentals/node/#using-npm-packages))
39+
- [Deno](https://deno.com/)
2140

2241
To get started, you can install **google-sr** using your preferred package manager:
2342

@@ -63,10 +82,6 @@ console.log(queryResult[0].type === ResultTypes.OrganicResult); // true
6382
6483
- Additional examples can be found in [apps/examples](https://github.com/typicalninja/google-sr/tree/master/apps/examples) directory
6584

66-
# google-sr API
67-
68-
Please refer to the google-sr API [here](https://typicalninja.github.io/google-sr/)
69-
7085
# Monorepo
7186

7287
Welcome to the 📦 monorepo of GSR Project.
@@ -75,7 +90,7 @@ Welcome to the 📦 monorepo of GSR Project.
7590

7691
> **[google-sr](https://github.com/typicalninja/google-sr/blob/master/packages/google-sr)**
7792
78-
[![npm downloads for google-sr](https://img.shields.io/npm/dw/google-sr)](https://www.npmjs.com/package/google-sr)
93+
[![npm downloads for google-sr](https://img.shields.io/npm/dw/google-sr)][npm-gsr]
7994
[![NPM license for google-sr](https://img.shields.io/npm/l/google-sr)](https://www.npmjs.com/package/google-sr)
8095
[![npm version for google-sr](https://img.shields.io/npm/v/google-sr)](https://www.npmjs.com/package/google-sr)
8196

packages/google-sr-selectors/API.md

+2-65
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,3 @@
1-
# Table of Contents
1+
# Documentation Moved
22

3-
* [google-sr-selectors API](#google-sr-selectors-api)
4-
* [OrganicResult](#organicresult)
5-
* [TranslateResult](#translateresult)
6-
* [DictionaryResult](#dictionaryresult)
7-
* [TimeResult](#timeresult)
8-
* [CurrencyResult](#currencyresult)
9-
10-
# google-sr-selectors API
11-
12-
## OrganicResult
13-
14-
```ts
15-
interface OrganicSearchSelector: {
16-
block: string;
17-
link: string;
18-
title: string;
19-
description: string;
20-
};
21-
```
22-
23-
## TranslateResult
24-
25-
```ts
26-
interface TranslateSearchSelector: {
27-
sourceLanguage: string;
28-
targetLanguage: string;
29-
translationText: string;
30-
sourceText: string;
31-
pronunciation: string;
32-
};
33-
```
34-
35-
## DictionaryResult
36-
37-
```ts
38-
interface DictionarySearchSelector: {
39-
audio: string;
40-
phonetic: string;
41-
word: string;
42-
definition: string;
43-
definitionPartOfSpeech: string;
44-
definitionExample: string;
45-
definitionSynonyms: string;
46-
};
47-
```
48-
49-
## TimeResult
50-
51-
```ts
52-
interface TimeSearchSelector: {
53-
location: string;
54-
time: string;
55-
timeInWords: string;
56-
};
57-
```
58-
59-
## CurrencyResult
60-
61-
```ts
62-
interface CurrencyConvertSelector: {
63-
from: string;
64-
to: string;
65-
};
66-
```
3+
Moved to github pages: **https://typicalninja.github.io/google-sr/**

packages/google-sr-selectors/README.md

+37-16
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
1-
# google-sr-selectors
1+
[npm]: https://www.npmjs.com/package/google-sr-selectors
2+
[github-gsr]: https://github.com/typicalninja/google-sr/tree/master/packages/google-sr
3+
[github-gt]: https://github.com/typicalninja/google-sr/tree/master/packages/google-that
4+
[stargazers]: https://github.com/typicalninja/google-sr/stargazers
5+
[discord]: https://discord.gg/ynwckXS9T2
6+
[test-action]: https://github.com/typicalninja/google-sr/actions/workflows/tests.yml
7+
[api-docs]: https://typicalninja.github.io/google-sr/modules/google-sr-selectors_src.html
8+
[usage]: https://github.com/typicalninja/google-sr/blob/reformat-docs/packages/google-sr/src/results.ts
29

3-
[![testing workflow](https://github.com/typicalninja/google-sr/actions/workflows/tests.yml/badge.svg)](https://github.com/typicalninja/google-sr)
4-
[![npm downloads](https://img.shields.io/npm/dw/google-sr-selectors)](https://www.npmjs.com/package/google-sr-selectors)
5-
[![GitHub issues](https://img.shields.io/github/issues/typicalninja/google-sr)](https://github.com/typicalninja/google-sr/issues)
6-
[![NPM license](https://img.shields.io/npm/l/google-sr-selectors)](https://www.npmjs.com/package/google-sr-selectors)
7-
[![npm version](https://img.shields.io/npm/v/google-sr-selectors)](https://www.npmjs.com/package/google-sr-selectors)
8-
[![Discord](https://img.shields.io/discord/807868280387665970)](https://discord.gg/ynwckXS9T2)
9-
[![CodeFactor](https://www.codefactor.io/repository/github/typicalninja/google-sr/badge)](https://www.codefactor.io/repository/github/typicalninja/google-sr)
10+
<h1 align="center">Google-sr-selectors</h1>
1011

11-
**For simple use cases, refer to [google-sr](https://github.com/typicalninja/google-sr/tree/master/packages/google-sr)**
12+
<p align="center">CSS Selectors for Google search page</p>
13+
14+
<div align="center">
15+
16+
[![testing workflow](https://img.shields.io/github/actions/workflow/status/typicalninja/google-sr/tests.yml?style=flat)][test-action]
17+
[![GitHub Repo stars](https://img.shields.io/github/stars/typicalninja/google-sr?style=flat)][stargazers]
18+
[![Discord](https://img.shields.io/discord/807868280387665970?style=flat)][discord]
19+
[![Monthly downloads](https://img.shields.io/npm/dm/google-sr-selectors?style=flat)][npm]
20+
21+
</div>
22+
23+
<div align="center">
24+
25+
**[Usage example][usage] |
26+
[API Documentation][api-docs] |
27+
[Disclaimer](#disclaimer)**
28+
29+
</div>
30+
31+
**For simple use cases, refer to [google-sr][github-gsr]**
1232

1333
This package provides a set of CSS selectors for parsing Google search results, using tools such as [cheerio](https://github.com/cheeriojs/cheerio), etc...
1434

@@ -18,28 +38,29 @@ These selectors are compatible only with the search results page returned when t
1838
#### Important Note:
1939
Due to the constantly evolving nature of Google's search page structure, we cannot guarantee consistent
2040
usage/validity of these selectors. Unless you are an advanced user with specific requirements, **we highly recommend
21-
using the [google-sr](https://github.com/typicalninja/google-sr/tree/master/packages/google-sr) package instead** of
41+
using the [google-sr][github-gsr] package instead** of
2242
relying directly on google-sr-selectors.
2343

2444
# Disclaimer
2545

2646
This is not sponsored, supported, or affiliated with Google.
2747

2848
The source code within this repository is intended solely for **educational & research purposes**.
29-
The author (typicalninja) & contributors takes **NO** responsibility for any issues that arise from its use, such as IP blocking by Google. Your discretion in usage is advised.
49+
The author & contributors takes **NO** responsibility for any issues that arise from its use.
50+
Your discretion in usage is advised.
3051

3152
# Links
3253

33-
- [API Documentation](https://typicalninja.github.io/google-sr)
54+
- [API Documentation][api-docs]
3455
- [GitHub Repository](https://github.com/typicalninja/google-sr)
35-
- [NPM Package](https://www.npmjs.com/package/google-sr-selectors)
36-
- [Discord](https://discord.gg/ynwckXS9T2)
56+
- [NPM Package][npm]
57+
- [Discord][discord]
3758

3859

3960
# Related projects 🥂
4061

41-
* [google-sr](https://g-sr.vercel.app/google/sr) - Simple tool to programmatically get google search results
42-
* [google-that](https://g-sr.vercel.app/google/that) - CLI wrapper around google-sr
62+
* [google-sr][github-gsr] - Simple tool to programmatically get google search results
63+
* [google-that][github-gt] - CLI wrapper around google-sr
4364

4465
# License
4566

packages/google-sr/README.md

+36-17
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
1-
# google-sr 🔍
1+
[npm-gsr]: https://www.npmjs.com/package/google-sr
2+
[stargazers]: https://github.com/typicalninja/google-sr/stargazers
3+
[discord]: https://discord.gg/ynwckXS9T2
4+
[test-action]: https://github.com/typicalninja/google-sr/actions/workflows/tests.yml
5+
[api-docs]: https://typicalninja.github.io/google-sr/modules/google-sr_src.html
6+
[github-gt]: https://github.com/typicalninja/google-sr/tree/master/packages/google-that
7+
[github-gsrs]: https://github.com/typicalninja/google-sr/tree/master/packages/google-sr-selectors
28

3-
[![testing workflow](https://github.com/typicalninja/google-sr/actions/workflows/tests.yml/badge.svg)](https://github.com/typicalninja/google-sr)
4-
[![npm downloads](https://img.shields.io/npm/dw/google-sr)](https://www.npmjs.com/package/google-sr)
5-
[![GitHub issues](https://img.shields.io/github/issues/typicalninja/google-sr)](https://github.com/typicalninja/google-sr/issues)
6-
[![NPM](https://img.shields.io/npm/l/google-sr)](https://www.npmjs.com/package/google-sr)
7-
[![npm version](https://img.shields.io/npm/v/google-sr)](https://www.npmjs.com/package/google-sr)
8-
[![Discord](https://img.shields.io/discord/807868280387665970)](https://discord.gg/ynwckXS9T2)
9-
[![CodeFactor](https://www.codefactor.io/repository/github/typicalninja/google-sr/badge)](https://www.codefactor.io/repository/github/typicalninja/google-sr)
9+
<h1 align="center">Google-sr</h1>
1010

11-
Simple & Fast Package for scraping Google search results without the need for an API key. 🚀
11+
<p align="center">Scrape google search results without an API key with javascript/typescript.</p>
12+
13+
<div align="center">
14+
15+
[![testing workflow](https://img.shields.io/github/actions/workflow/status/typicalninja/google-sr/tests.yml?style=flat)][test-action]
16+
[![GitHub Repo stars](https://img.shields.io/github/stars/typicalninja/google-sr?style=flat)][stargazers]
17+
[![Discord](https://img.shields.io/discord/807868280387665970?style=flat)][discord]
18+
[![Monthly downloads](https://img.shields.io/npm/dm/google-sr?style=flat)][npm-gsr]
19+
20+
</div>
21+
22+
<div align="center">
23+
24+
**[Installation](#install) |
25+
[Getting started](#usage) |
26+
[API Documentation][api-docs] |
27+
[Disclaimer](#disclaimer)**
28+
29+
</div>
1230

1331
# Features
1432

@@ -18,7 +36,7 @@ Simple & Fast Package for scraping Google search results without the need for an
1836
- [Well tested 🔄](#tests)
1937
- [Supports multiple runtimes](#runtime-support)
2038

21-
# Install 📦
39+
# Install
2240

2341
### Runtime Support
2442

@@ -77,25 +95,26 @@ console.log(queryResult[0].type === ResultTypes.OrganicResult); // true
7795
This is not sponsored, supported, or affiliated with Google.
7896

7997
The source code within this repository is intended solely for **educational & research purposes**.
80-
The author (typicalninja) & contributors takes **NO** responsibility for any issues that arise from its use, such as IP blocking by Google. Your discretion in usage is advised.
98+
The author & contributors takes **NO** responsibility for any issues that arise from its use.
99+
Your discretion in usage is advised.
81100

82101
# Links
83102

84-
- [API Documentation](https://typicalninja.github.io/google-sr)
103+
- [API Documentation][api-docs]
85104
- [GitHub Repository](https://github.com/typicalninja/google-sr)
86-
- [NPM Package](https://www.npmjs.com/package/google-sr)
87-
- [Discord](https://discord.gg/ynwckXS9T2)
105+
- [NPM Package][npm-gsr]
106+
- [Discord][discord]
88107

89108
# Related projects 🥂
90109

91-
- [google-that](https://g-sr.vercel.app/google/that) - CLI wrapper around google-sr
92-
- [google-sr-selectors](https://g-sr.vercel.app/google/selectors) - Selectors for google search results used by google-sr
110+
- [google-that][github-gt] - CLI wrapper around google-sr
111+
- [google-sr-selectors][github-gsrs] - Selectors for Google search results used by google-sr
93112

94113
# Tests
95114

96115
Tests are written using [vitest](https://vitest.dev/) and can be run by using the `test` script.
97116

98-
> Weekly tests are executed using a github action to ensure compatibility and catch breakage due to google changes
117+
> Weekly tests are executed using a GitHub action to ensure compatibility and catch breakage due to google changes
99118
100119
```bash
101120
pnpm run test

packages/google-that/README.md

+35-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
1-
# google-that
1+
[npm]: https://www.npmjs.com/package/google-that
2+
[github-gsr]: https://github.com/typicalninja/google-sr/tree/master/packages/google-sr
3+
[github-gsrs]: https://github.com/typicalninja/google-sr/tree/master/packages/google-sr-selectors
4+
[stargazers]: https://github.com/typicalninja/google-sr/stargazers
5+
[discord]: https://discord.gg/ynwckXS9T2
6+
[test-action]: https://github.com/typicalninja/google-sr/actions/workflows/tests.yml
27

3-
[![npm downloads](https://img.shields.io/npm/dw/google-that)](https://www.npmjs.com/package/google-that)
4-
[![GitHub issues](https://img.shields.io/github/issues/typicalninja/google-sr)](https://github.com/typicalninja/google-sr/issues)
5-
[![NPM](https://img.shields.io/npm/l/google-that)](https://www.npmjs.com/package/google-that)
6-
[![npm version](https://img.shields.io/npm/v/google-that)](https://www.npmjs.com/package/google-that)
7-
[![Discord](https://img.shields.io/discord/807868280387665970)](https://discord.gg/ynwckXS9T2)
8-
[![CodeFactor](https://www.codefactor.io/repository/github/typicalninja/google-sr/badge)](https://www.codefactor.io/repository/github/typicalninja/google-sr)
8+
<h1 align="center">Google-that</h1>
99

10-
CLI tool to scrape google search results without an api key 🚀.
11-
This is a demo project to showcase the usage and performance of the [google-sr](https://npmjs.com/package/google-sr) package. google-that is able to output parsed results to a file or to stdout, please check the help page for more info.
10+
<p align="center">CLI tool to scrape google search results without an api key</p>
1211

13-
# Install 📦
12+
<div align="center">
13+
14+
[![testing workflow](https://img.shields.io/github/actions/workflow/status/typicalninja/google-sr/tests.yml?style=flat)][test-action]
15+
[![GitHub Repo stars](https://img.shields.io/github/stars/typicalninja/google-sr?style=flat)][stargazers]
16+
[![Discord](https://img.shields.io/discord/807868280387665970?style=flat)][discord]
17+
[![Monthly downloads](https://img.shields.io/npm/dm/google-that?style=flat)][npm]
18+
19+
</div>
20+
21+
<div align="center">
22+
23+
**[Installation](#install) |
24+
[Getting started](#usage) |
25+
[Disclaimer](#disclaimer)**
26+
27+
</div>
28+
29+
30+
> This is a demo project to showcase the usage and performance of the [google-sr][github-gsr] package.
31+
32+
# Install
1433

1534
To get started, you can install **google-that** using your preferred package manager:
1635

@@ -41,7 +60,7 @@ google-that --help
4160
google-that -q "Nodejs"
4261

4362
# Multiple queries
44-
# Seperate queries with a space, the option is case insensitive (Q)
63+
# Separate queries with a space, the option is case insensitive (Q)
4564
google-that -Q query1 "queries with spaces need to be quoted"
4665

4766
# Writing the results to a file
@@ -53,18 +72,18 @@ google-that -q "Nodejs" -w
5372
This is not sponsored, supported, or affiliated with Google.
5473

5574
The source code within this repository is intended solely for **educational & research purposes**.
56-
The author (typicalninja) & contributors takes **NO** responsibility for any issues that arise from its use, such as IP blocking by Google. Your discretion in usage is advised.
75+
The author & contributors takes **NO** responsibility for any issues that arise from its use. Your discretion in usage is advised.
5776

5877
# Links
5978

6079
- [GitHub Repository](https://github.com/typicalninja/google-sr)
61-
- [NPM Package](https://www.npmjs.com/package/google-that)
62-
- [Discord](https://discord.gg/ynwckXS9T2)
80+
- [NPM Package][npm]
81+
- [Discord][discord]
6382

6483
# Related projects 🥂
6584

66-
- [google-sr](https://g-sr.vercel.app/google/sr) - Core project used in google-that
67-
- [google-sr-selectors](https://g-sr.vercel.app/google/selectors) - Selectors for google search results used by google-sr
85+
- [google-sr][github-gsr] - Core project used in google-that
86+
- [google-sr-selectors][github-gsrs] - Selectors for Google search results used by google-sr
6887

6988
# License
7089

0 commit comments

Comments
 (0)