Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit ad50ed3

Browse files
committed
Updated to use with CS2 blog
1 parent 2d56957 commit ad50ed3

7 files changed

Lines changed: 125 additions & 379 deletions

File tree

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
"project": "./tsconfig.json"
1919
},
2020
"rules": {
21+
"@typescript-eslint/strict-boolean-expressions": 0
2122
}
2223
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
dist
2+
dist
3+
.idea/

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
# CS Blog and Updates Scraper
2-
Get Blog and Update posts from CSGO
2+
Get Blog and Update posts from CS2
33
### Usage:
44
```ts
5-
import { getBlogPosts, getUpdatePosts } from "csblogscraper";
5+
import { getBlogPosts, getUpdatePosts } from "@cstleagueorg/cs2-blog-scraper";
66

77
const blogPosts = await getBlogPosts();
88
const updatePosts = await getUpdatePosts();
99
```
1010
OR
1111
```ts
12-
import getPosts from "csblogscraper";
12+
import getPosts from "@cstleagueorg/cs2-blog-scraper";
1313

14-
const posts = await getPosts("https://blog.counter-strike.net/");
14+
const posts = await getPosts();
15+
```
16+
OR
17+
```ts
18+
import { UpdatesListener, Post } from "@cstleagueorg/cs2-blog-scraper";
19+
function receiveUpdate(post: Post) {
20+
console.log(post)
21+
}
22+
const listener = new UpdatesListener(receiveUpdate); // check updates every 10 minutes
23+
...
24+
listener.stopListening();
1525
```
1626
### Output:
1727
```ts
@@ -22,4 +32,4 @@ interface Post {
2232
image?: string;
2333
content: string;
2434
}
25-
```
35+
```

0 commit comments

Comments
 (0)