sendvid

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sendvid contains functions that can be used to accurately extract and validate Sendvid links.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delegate

func Delegate(res, source string) ([]models.Entry, error)

Delegate takes a string as an argument and returns a slice of valid Senvid links found within the response (if any) and an error

func Extract

func Extract(res string) ([]string, error)

Extract returns a slice of all Sendvid links contained within a string, if any.

func ExtractThumbnail

func ExtractThumbnail(sendvidContents string) string

ExtractThumbnail takes the body response/contents of a Sendvid page (raw source/html (formatted as string)) as an argument. The extracted URL is unescaped to ensure validity and returned in string format.

func ExtractTitle

func ExtractTitle(sendvidContents string) string

ExtractTitle takes the body response/contents of a Sendvid page (raw source/html (formatted as string)) as an argument and returns the title as a string.

func ExtractViewCount

func ExtractViewCount(sendvidContents string) int

ExtractViewCount takes the body response/contents of a Sendvid page (raw source/html (formatted as string)) as an argument and returns a string containing the view count, alongside an error. The error will be nil if everything is successful. If a failure occurs, -1 will be returned.

func Validate

func Validate(x string) (bool, error)

Validate performs a GET request to the Sendvid URL and uses the response status code to identify its validity

Types

This section is empty.

Jump to

Keyboard shortcuts

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