Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lukasjhan/lab132

lab132
https://github.com/lukasjhan/lab132

Last synced: 12 days ago
JSON representation

lab132

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.