Documentation ¶
Index ¶
- type ClientOptionFunc
- type CreatePageReq
- type CreatePageResp
- type ExtractingContentReq
- type ExtractingContentResp
- type Feedbin
- func (r *Feedbin) CreatePage(ctx context.Context, request *CreatePageReq) (*CreatePageResp, error)
- func (r *Feedbin) ExtractingContent(ctx context.Context, request *ExtractingContentReq) (*ExtractingContentResp, error)
- func (r *Feedbin) ExtractingContentURL(ctx context.Context, request *ExtractingContentReq) string
- func (r *Feedbin) GetSubscriptions(ctx context.Context, request *GetSubscriptionsReq) (*GetSubscriptionsResp, error)
- func (r *Feedbin) GetTaggings(ctx context.Context) (*GetTaggingsResp, error)
- type GetSubscriptionsReq
- type GetSubscriptionsResp
- type GetTaggingsResp
- type Subscription
- type Tagging
Examples ¶
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
func WithTimeout ¶ added in v0.2.0
func WithTimeout(timeout time.Duration) ClientOptionFunc
type CreatePageReq ¶
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).
Example ¶
url := "" cli := feedbin.New(feedbin.WithCredential("username", "password")) resp, err := cli.CreatePage(context.Background(), &feedbin.CreatePageReq{ URL: url, }) if err != nil { panic(err) } fmt.Println("title", resp.Title) fmt.Println("content", resp.Content)
Output:
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.
Example ¶
url := "" cli := feedbin.New() resp, err := cli.ExtractingContent(context.Background(), &feedbin.ExtractingContentReq{ URL: url, }) if err != nil { panic(err) } fmt.Println("title", resp.Title) fmt.Println("content", resp.Content)
Output:
func (*Feedbin) ExtractingContentURL ¶
func (r *Feedbin) ExtractingContentURL(ctx context.Context, request *ExtractingContentReq) string
func (*Feedbin) GetSubscriptions ¶ added in v0.3.0
func (r *Feedbin) GetSubscriptions(ctx context.Context, request *GetSubscriptionsReq) (*GetSubscriptionsResp, error)
Example ¶
cli := feedbin.New(feedbin.WithCredential("username", "password")) resp, err := cli.GetSubscriptions(context.Background(), &feedbin.GetSubscriptionsReq{}) if err != nil { panic(err) } fmt.Println("subscriptions length:", len(resp.Subscriptions)) for _, v := range resp.Subscriptions { fmt.Println(v.ID, v.Title, v.FeedURL) }
Output:
func (*Feedbin) GetTaggings ¶ added in v0.4.0
func (r *Feedbin) GetTaggings(ctx context.Context) (*GetTaggingsResp, error)
type GetSubscriptionsReq ¶ added in v0.3.0
type GetSubscriptionsResp ¶ added in v0.3.0
type GetSubscriptionsResp struct {
Subscriptions []*Subscription `json:"subscriptions"`
}
type GetTaggingsResp ¶ added in v0.4.0
type GetTaggingsResp struct {
Taggings []*Tagging `json:"taggings"`
}
type Subscription ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.