Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukasjhan/lab132
lab132
https://github.com/lukasjhan/lab132
Last synced: 12 days ago
JSON representation
lab132
- Host: GitHub
- URL: https://github.com/lukasjhan/lab132
- Owner: lukasjhan
- Created: 2023-03-29T06:33:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-03-29T07:43:50.000Z (over 1 year ago)
- Last Synced: 2024-10-24T08:52:36.521Z (2 months ago)
- Language: TypeScript
- Size: 136 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spam Filter
## How it looks like
```ts
const isSpam = async (
Content: string,
spamLinkDomains: string[],
redirectionDepth: number
): Promise
```## Parameters
@param Content
Is a text string that a user wrote.@param spamLinkDomains
are domains of links that we consider as “spam”.
Such as [“www.naver.com” / “www.daum.net” / “www.google.com” ]@param redirectionDepth
are how many redirections this function would follow to check if the link is spam.
Redirection could be either,
301 / 302 HTTP redirection
Site contains tag.
if it is 0, this function would not follow any redirections.@return Promise
Asynchronously return if the content is a spam.## Example
```ts
import { isSpam } from "spam-filter";
isSpam("spam spam https://a.com", ["cc.com", "b.com"], 3);
```## Directory Structure
* simple: Simple implementation of spam filter. You can find the implementation in `src/isSpam.ts`.
* spam-lambda: AWS Lambda implementation of spam filter with redis cache.