getpocket: github.com/Shaked/getpocket/commands Index | Files | Directories

package commands

import "github.com/Shaked/getpocket/commands"

Index

Package Files

add.go commands.go modify.go retrieve.go

Constants

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

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

type Add Uses

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

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

func NewAdd Uses

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

func (*Add) Exec Uses

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

func (*Add) SetConsumerKey Uses

func (c *Add) SetConsumerKey(consumerKey string)

func (*Add) SetRequest Uses

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

func (*Add) SetTags Uses

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

func (*Add) SetTitle Uses

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 Uses

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

type AddResponse Uses

type AddResponse struct {
    Item   Item
    Status int
}

type Item Uses

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 Uses

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

type ItemImage Uses

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 Uses

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

type ItemVideo Uses

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 Uses

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

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

func NewModify Uses

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

func (*Modify) Exec Uses

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

func (*Modify) SetConsumerKey Uses

func (c *Modify) SetConsumerKey(consumerKey string)

func (*Modify) SetRequest Uses

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

type ModifyResponse Uses

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

type Retrieve Uses

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

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

func NewRetrieve Uses

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

func (*Retrieve) Exec Uses

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

func (*Retrieve) SetConsumerKey Uses

func (c *Retrieve) SetConsumerKey(consumerKey string)

func (*Retrieve) SetContentType Uses

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

func (*Retrieve) SetDetailType Uses

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

func (*Retrieve) SetFavorite Uses

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

func (*Retrieve) SetRequest Uses

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

func (*Retrieve) SetSort Uses

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

func (*Retrieve) SetState Uses

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

func (*Retrieve) SetTag Uses

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

func (*Retrieve) SetUntagged Uses

func (c *Retrieve) SetUntagged() *Retrieve

type RetrieveItem Uses

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 Uses

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

Directories

PathSynopsis
modify

Package commands imports 9 packages (graph). Updated 2016-07-16. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).