Skip to content

Commit

Permalink
chore: merge pull request #14 from threeal/main
Browse files Browse the repository at this point in the history
Version 0.2.0 Release
  • Loading branch information
threeal authored Jul 25, 2023
2 parents 270de2a + f936dfe commit 8a7e06c
Show file tree
Hide file tree
Showing 31 changed files with 906 additions and 174 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
commit-message:
prefix: chore
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@ $ npm install --global google-rank
To retrieve the rank of a website for a specific keyword, run the `google-rank` tool followed by the website URL and the search keyword:

```
$ google-rank wikipedia.org krakatoa
$ google-rank wikipedia.org --keywords krakatoa
Ranks for wikipedia.org website:
1 krakatoa
page 1 rank 1 krakatoa
```

Multiple keywords can also be specified:

```
$ google-rank wikipedia.org krakatoa mit 'social media'
$ google-rank wikipedia.org --keywords krakatoa facebook 'social media'
Ranks for wikipedia.org website:
1 krakatoa
2 mit
1 social media
page 1 rank 1 krakatoa
page 2 rank 2 facebook
page 1 rank 1 social media
```

If the website is not found for the specified keywords, it will output the rank as `?`:

```
$ google-rank wikipedia.org 'best city to travel'
$ google-rank wikipedia.org --keywords 'best city to travel'
Ranks for wikipedia.org website:
? best city to travel
page ? rank ? best city to travel
```

## License
Expand Down
56 changes: 42 additions & 14 deletions lib/google-rank.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/google-rank.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions lib/utils.d.ts

This file was deleted.

41 changes: 0 additions & 41 deletions lib/utils.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/utils.js.map

This file was deleted.

27 changes: 27 additions & 0 deletions lib/utils/arguments.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Represents the arguments and options of the program.
*/
export interface Arguments {
/** Website name. */
website: string;
/** Keywords to search for. */
keywords: string[];
/** Maximum page to search for. */
maxPage: number;
}
/**
* Represents the arguments and options parser of the program.
*/
export declare class ArgumentsParser {
#private;
/**
* Constructs a new instance of the arguments and options parser of the program.
*/
constructor();
/**
* Parses the arguments and options of the program.
* @param argv - An optional array of strings representing the command-line arguments.
* @returns A promise that resolves to the arguments and options.
*/
parse(argv?: readonly string[]): Promise<Arguments>;
}
102 changes: 102 additions & 0 deletions lib/utils/arguments.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/utils/arguments.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions lib/utils/format.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { GoogleWebsiteRank } from "./google";
/**
* Formats the rank of a keyword as a string.
* @param keyword - The keyword string.
* @param rank - The rank of the keyword.
* @returns A formatted string. The rank will be displayed as a question mark if it is undefined.
*/
export declare function formatKeywordRank(keyword: string, rank?: GoogleWebsiteRank): string;
32 changes: 32 additions & 0 deletions lib/utils/format.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/utils/format.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8a7e06c

Please sign in to comment.