commands

package
v0.0.0-...-9797080 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_UNREAD  = "unread"
	STATE_ARCHIVE = "archive"
	STATE_ALL     = "all"

	TAG_UNTAGGED = "_untagged_"

	CONTENT_TYPE_ARTICLE = "article"
	CONTENT_TYPE_VIDEO   = "video"
	CONTENT_TYPE_IMAGE   = "image"

	SORT_NEWEST = "newest"
	SORT_OLDEST = "oldest"
	SORT_TITLE  = "title"
	SORT_SITE   = "site"

	DETAIL_TYPE_SIMPLE   = "simple"
	DETAIL_TYPE_COMPLETE = "complete"
)

Variables

View Source
var (
	URLs = map[string]string{
		"Add":      "https://getpocket.com/v3/add",
		"Retrieve": "https://getpocket.com/v3/get",
		"Modify":   "https://getpocket.com/v3/send",
	}
)

Functions

This section is empty.

Types

type Add

type Add struct {
	URL string
	// contains filtered or unexported fields
}

@see http://getpocket.com/developer/docs/v3/add

func NewAdd

func NewAdd(consumerKey string, request utils.HttpRequest, targetURL string) *Add

func (*Add) Exec

func (a *Add) Exec(user auth.Authenticated) (*AddResponse, error)

func (*Add) SetConsumerKey

func (c *Add) SetConsumerKey(consumerKey string)

func (*Add) SetRequest

func (c *Add) SetRequest(request utils.HttpRequest)

func (*Add) SetTags

func (a *Add) SetTags(tags string) *Add

func (*Add) SetTitle

func (a *Add) SetTitle(title string) *Add

This can be included for cases where an item does not have a title, which is typical for image or PDF URLs. If Pocket detects a title from the content of the page, this parameter will be ignored.

func (*Add) SetTweetID

func (a *Add) SetTweetID(tweet_id string) *Add

type AddResponse

type AddResponse struct {
	Item   Item
	Status int
}

type Item

type Item struct {
	Id             string                `json:"item_id"`
	NormalURL      string                `json:"normal_url"`
	ResolvedId     string                `json:"resolved_id"`
	ResolvedURL    string                `json:"resolved_url"`
	DomainId       string                `json:"domain_id"`
	OriginDomainId string                `json:"origin_domain_id"`
	ResponseCode   string                `json:"response_code"`
	MimeType       string                `json:"mime_type"`
	ContentLength  string                `json:"content_length"`
	Encoding       string                `json:"encoding"`
	DateResolved   string                `json:"date_resolved"`
	DatePublished  string                `json:"date_published"`
	Title          string                `json:"title"`
	Excerpt        string                `json:"excerpt"`
	WordCount      string                `json:"word_count"`
	HasImage       string                `json:"has_image"`
	HasVideo       string                `json:"has_video"`
	IsIndex        string                `json:"is_index"`
	Authors        map[string]ItemAuthor `json:"authors"`
	Images         map[string]ItemImage  `json:"images"`
	Videos         map[string]ItemVideo  `json:"videos"`
}

type ItemAuthor

type ItemAuthor struct {
	Id   string `json:"author_id"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

type ItemImage

type ItemImage struct {
	Id      string `json:"item_id"`
	ImageId string `json:"image_id"`
	Src     string `json:"src"`
	Width   string `json:"width"`
	Height  string `json:"height"`
	Credit  string `json:"credit"`
}

type ItemTag

type ItemTag struct {
	Id  string `json:"item_id"`
	Tag string `json:"tag"`
}

type ItemVideo

type ItemVideo struct {
	Id      string `json:"item_id"`
	VideoId string `json:"video_id"`
	Src     string `json:"src"`
	Width   string `json:"width"`
	Height  string `json:"height"`
	Type    string `json:"credit"`
	Vid     string `json:"vid"`
	Length  string `json:"length"`
}

type Modify

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

@see http://getpocket.com/developer/docs/v3/add

func NewModify

func NewModify(consumerKey string, request utils.HttpRequest, actions []modify.Action) *Modify

func (*Modify) Exec

func (c *Modify) Exec(user auth.Authenticated) (*ModifyResponse, error)

func (*Modify) SetConsumerKey

func (c *Modify) SetConsumerKey(consumerKey string)

func (*Modify) SetRequest

func (c *Modify) SetRequest(request utils.HttpRequest)

type ModifyResponse

type ModifyResponse struct {
	ActionResults []bool `json:"action_results"`
	Status        int    `json:"status"`
}

type Retrieve

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

@see http://getpocket.com/developer/docs/v3/retrieve

func NewRetrieve

func NewRetrieve(consumerKey string, request utils.HttpRequest) *Retrieve

func (*Retrieve) Exec

func (c *Retrieve) Exec(user auth.Authenticated) (*RetrieveResponse, error)

func (*Retrieve) SetConsumerKey

func (c *Retrieve) SetConsumerKey(consumerKey string)

func (*Retrieve) SetContentType

func (c *Retrieve) SetContentType(contentType string) error

func (*Retrieve) SetDetailType

func (c *Retrieve) SetDetailType(detailType string) error

func (*Retrieve) SetFavorite

func (c *Retrieve) SetFavorite(favorite bool) *Retrieve

func (*Retrieve) SetRequest

func (c *Retrieve) SetRequest(request utils.HttpRequest)

func (*Retrieve) SetSort

func (c *Retrieve) SetSort(sort string) error

func (*Retrieve) SetState

func (c *Retrieve) SetState(state string) error

func (*Retrieve) SetTag

func (c *Retrieve) SetTag(tag string) *Retrieve

func (*Retrieve) SetUntagged

func (c *Retrieve) SetUntagged() *Retrieve

type RetrieveItem

type RetrieveItem struct {
	Id            string                `json:"item_id"`
	ResolvedId    string                `json:"resolved_id"`
	GivenURL      string                `json:"given_url"`
	ResolvedURL   string                `json:"resolved_url"`
	GivenTitle    string                `json:"given_title"`
	ResolvedTitle string                `json:"resolved_title"`
	Favorite      string                `json:"favorite"`
	Status        string                `json:"status"`
	Excerpt       string                `json:"excerpt"`
	IsArticle     string                `json:"is_article"`
	HasImage      string                `json:"has_image"`
	HasVideo      string                `json:"has_video"`
	WordCount     string                `json:"word_count"`
	TimeAdded     string                `json:"time_added"`
	TimeUpdated   string                `json:"time_updated"`
	TimeRead      string                `json:"time_read"`
	TimeFavorited string                `json:"time_favorited"`
	SortId        int                   `json:"sort_id"`
	IsIndex       string                `json:"is_index"`
	Tags          map[string]ItemTag    `json:"tags"`
	Authors       map[string]ItemAuthor `json:"authors"`
	Images        map[string]ItemImage  `json:"images"`
	Videos        map[string]ItemVideo  `json:"videos"`
}

type RetrieveResponse

type RetrieveResponse struct {
	List     map[string]RetrieveItem `json:"list"`
	Status   int                     `json:"status"`
	Complete int                     `json:"complete"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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