feedbin

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

go-feedbin

codecov go report card test status Apache-2.0 license Go.Dev reference Go project version

Feedbin API Documentation: https://github.com/feedbin/feedbin-api.

Install

go get github.com/chyroc/go-feedbin

Usage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOptionFunc

type ClientOptionFunc func(*Feedbin)

func WithCredential

func WithCredential(username, password string) ClientOptionFunc

type CreatePageReq

type CreatePageReq struct {
	URL   string `json:"url,omitempty"`
	Title string `json:"title,omitempty"` // The title is optional and will only be used if Feedbin cannot find the title of the content.
}

type CreatePageResp

type CreatePageResp struct {
	ID                  int64       `json:"id"`
	FeedID              int         `json:"feed_id"`
	Title               string      `json:"title"`
	Author              interface{} `json:"author"`
	Summary             string      `json:"summary"`
	Content             string      `json:"content"`
	URL                 string      `json:"url"`
	ExtractedContentURL string      `json:"extracted_content_url"`
	Published           time.Time   `json:"published"`
	CreatedAt           time.Time   `json:"created_at"`
}

type ExtractingContentReq

type ExtractingContentReq struct {
	URL string `json:"url,omitempty"`
}

type ExtractingContentResp

type ExtractingContentResp struct {
	Title         string      `json:"title"`
	Author        interface{} `json:"author"`
	DatePublished time.Time   `json:"date_published"`
	Dek           interface{} `json:"dek"`
	LeadImageURL  string      `json:"lead_image_url"`
	Content       string      `json:"content"`
	NextPageURL   interface{} `json:"next_page_url"`
	URL           string      `json:"url"`
	Domain        string      `json:"domain"`
	Excerpt       string      `json:"excerpt"`
	WordCount     int         `json:"word_count"`
	Direction     string      `json:"direction"`
	TotalPages    int         `json:"total_pages"`
	RenderedPages int         `json:"rendered_pages"`
}

type Feedbin

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

func New

func New(options ...ClientOptionFunc) *Feedbin

func (*Feedbin) CreatePage

func (r *Feedbin) CreatePage(ctx context.Context, request *CreatePageReq) (*CreatePageResp, error)

CreatePage can be used to [create a new entry](https://feedbin.com/blog/2019/08/20/save-webpages-to-read-later/) from the URL of an article.

If successful, the response will be the full [entry](https://github.com/feedbin/feedbin-api/blob/master/content/entries.md).

func (*Feedbin) ExtractingContent

func (r *Feedbin) ExtractingContent(ctx context.Context, request *ExtractingContentReq) (*ExtractingContentResp, error)

ExtractingContent uses [Mercury Parser](https://github.com/postlight/mercury-parser) to attempt to extract the full content of a webpage.

The extract service is only available to consumer apps that sync with feedbin.com. It is possible to get a cached article without an account, which is probably why you occasionally get a result.

func (*Feedbin) ExtractingContentURL

func (r *Feedbin) ExtractingContentURL(ctx context.Context, request *ExtractingContentReq) string

Jump to

Keyboard shortcuts

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