NewsScanner

package
v0.0.0-...-372f0b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleScanner

type GoogleScanner struct {
	// contains filtered or unexported fields
}

GoogleScanner implements INewsScanner using google APIs in the backend

func NewGoogleScanner

func NewGoogleScanner() *GoogleScanner

NewGoogleScanner returns a new GoogleScanner

func (*GoogleScanner) IsFake

func (g *GoogleScanner) IsFake(news string) (isFake bool, err error)

IsFake tells whether the supplied news is fake

func (*GoogleScanner) SetApiKey

func (g *GoogleScanner) SetApiKey(key string)

SetApiKey sets key to be used to access the APIs

func (*GoogleScanner) SetMaxAgeDays

func (g *GoogleScanner) SetMaxAgeDays(maxAgeDays int)

SetMaxAgeDays sets the maximum age(in days) for the returned search resutls

type INewsScanner

type INewsScanner interface {
	IsFake(string) (bool, error)
	SetMaxAgeDays(int)
	SetApiKey(string)
}

INewsScanner is an interface which defines a fake news scanner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL