Documentation ¶
Index ¶
- Constants
- Variables
- func Count(urlStr string) (int, error)
- type Authenticator
- func (a *Authenticator) AddBookmark(br BookmarkForm) (*Bookmark, error)
- func (a *Authenticator) AuthURL(w http.ResponseWriter, r *http.Request) (string, error)
- func (a *Authenticator) DeleteBookmark(uri string) (bool, error)
- func (a *Authenticator) GetBookmark(uri string) (*Bookmark, error)
- func (a *Authenticator) GetBookmarkedEntry(uri string) (*BookmarkEntry, error)
- func (a *Authenticator) GetProfile() (*Profile, error)
- func (a *Authenticator) Token(w http.ResponseWriter, r *http.Request) (*oauth.Credentials, error)
- type Bookmark
- type BookmarkEntry
- type BookmarkForm
- type BookmarkUser
- type Client
- func (c *Client) Count(urlStr string) (int, error)
- func (c *Client) EntryInfo(urlStr string) (*EntryInformation, error)
- func (c *Client) GetStar(urlStr string) (*EntryStars, error)
- func (c *Client) HotEntry(category string) (*Entries, error)
- func (c *Client) HotEntryAll() (*Entries, error)
- func (c *Client) NewEntry(category string, options map[string]string) (*Entries, error)
- func (c *Client) NewEntryAll(options map[string]string) (*Entries, error)
- func (c *Client) SearchEntry(searchWord string, searchType string, options map[string]string) (*Entries, error)
- func (c *Client) SearchUrlEntry(searchUrl string, options map[string]string) (*Entries, error)
- func (c *Client) UserStar(username string) (*UserStars, error)
- type ColoredStars
- type Entries
- func HotEntry(category string) (*Entries, error)
- func HotEntryAll() (*Entries, error)
- func NewEntry(category string, options map[string]string) (*Entries, error)
- func NewEntryAll(options map[string]string) (*Entries, error)
- func SearchEntry(searchWord string, searchType string, options map[string]string) (*Entries, error)
- func SearchUrlEntry(searchUrl string, options map[string]string) (*Entries, error)
- type Entry
- type EntryInformation
- type EntryPost
- type EntryStars
- type Profile
- type RelatedEntry
- type Star
- type UserStars
Constants ¶
View Source
const ( ReadPublic = "read_public" ReadPrivate = "read_private" WritePublic = "write_public" WritePrivate = "write_private" )
Variables ¶
View Source
var ( // DefaultClient is the default client that is used by the wrapper functions // that don't require authorization. If you need to authenticate, create // your own client with `Authenticator.NewClient`. DefaultClient = &Client{ http: new(http.Client), } )
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func NewAuthenticator ¶
func NewAuthenticator(consumerKey string, consumerSecret string, redirectUri string, scopes []string) *Authenticator
func (*Authenticator) AddBookmark ¶
func (a *Authenticator) AddBookmark(br BookmarkForm) (*Bookmark, error)
ブックマーク API ブックマークを追加または更新する
func (*Authenticator) AuthURL ¶
func (a *Authenticator) AuthURL(w http.ResponseWriter, r *http.Request) (string, error)
func (*Authenticator) DeleteBookmark ¶
func (a *Authenticator) DeleteBookmark(uri string) (bool, error)
ブックマーク API ブックマークを削除する
func (*Authenticator) GetBookmark ¶
func (a *Authenticator) GetBookmark(uri string) (*Bookmark, error)
ブックマーク API ブックマーク情報を取得する
func (*Authenticator) GetBookmarkedEntry ¶
func (a *Authenticator) GetBookmarkedEntry(uri string) (*BookmarkEntry, error)
エントリー API ブックマークされたエントリーの情報を取得する
func (*Authenticator) GetProfile ¶
func (a *Authenticator) GetProfile() (*Profile, error)
はてなブックマークの
func (*Authenticator) Token ¶
func (a *Authenticator) Token(w http.ResponseWriter, r *http.Request) (*oauth.Credentials, error)
type Bookmark ¶
type Bookmark struct { CommentRaw string `json:"comment_raw"` Private bool `json:"private"` Eid int `json:"eid"` CreatedEpoch int `json:"created_epoch"` Tags []string `json:"tags"` Permalink string `json:"permalink"` Comment string `json:"comment"` CreatedDatetime string `json:"created_datetime"` User string `json:"user"` }
type BookmarkEntry ¶
type BookmarkEntry struct { Count int `json:"count"` FaviconURL string `json:"favicon_url"` Eid int `json:"eid"` ImageLastEditor string `json:"image_last_editor"` EntryURL string `json:"entry_url"` RootURL string `json:"root_url"` IsInvalidURL bool `json:"is_invalid_url"` SmartphoneAppEntryURL string `json:"smartphone_app_entry_url"` TitleLastEditor string `json:"title_last_editor"` ImageURL string `json:"image_url"` URL string `json:"url"` Title string `json:"title"` HasAsin bool `json:"has_asin"` ImageHatenaURL string `json:"image_hatena_url"` }
type BookmarkForm ¶
type BookmarkForm struct {
// contains filtered or unexported fields
}
type BookmarkUser ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for working with the Hatena Web API. To create an authenticated client, use the `Authenticator.NewClient` method. If you don't need to authenticate, you can use `DefaultClient`.
func (*Client) HotEntryAll ¶
func (*Client) NewEntryAll ¶
func (*Client) SearchEntry ¶
func (*Client) SearchUrlEntry ¶
type ColoredStars ¶
type Entries ¶
type Entries struct { Title string `xml:"channel>title"` Link string `xml:"channel>link"` Description string `xml:"channel>description"` Entry []Entry `xml:"item"` }
func HotEntryAll ¶
func NewEntry ¶
Categories : social, economics, life, knowledge, it, fun, entertainment, game Option : sort=recent, sort=popular, threshold={3}
func SearchEntry ¶
searchType : keyword, title, tag Option : sort=recent, sort=popular, threshold={10}, date_begin={YYYY-MM-DD}, date_end={YYYY-MM-DD}, safe={on/off}
type EntryInformation ¶
type EntryInformation struct { Eid int `json:"eid"` Title string `json:"title"` Count int `json:"count"` Url string `json:"url"` EntryUrl string `json:"entry_url"` Screenshot string `json:"screenshot"` Bookmarks []BookmarkUser `json:"bookmarks"` RelatedEntries []RelatedEntry `json:"related"` }
type EntryPost ¶
type EntryPost struct { Stars []Star `json:"stars"` CanComment int `json:"can_comment"` ColoredStars []ColoredStars `json:"colored_stars"` URI string `json:"uri"` }
type EntryStars ¶
func GetStar ¶
func GetStar(urlStr string) (*EntryStars, error)
はてなスター取得 API ある URL に対して付与されたスターを取得できる。
type Profile ¶
type Profile struct { IsOauthMixiCheck bool `json:"is_oauth_mixi_check"` MixiCheckChecked string `json:"mixi_check_checked"` IgnoresRegex string `json:"ignores_regex"` IsOauthEvernote bool `json:"is_oauth_evernote"` TwitterChecked string `json:"twitter_checked"` Plususer bool `json:"plususer"` BookmarkCount int `json:"bookmark_count"` UserPageVersion string `json:"user_page_version"` EvernoteChecked string `json:"evernote_checked"` FacebookChecked string `json:"facebook_checked"` Name string `json:"name"` Private bool `json:"private"` Rkm string `json:"rkm"` IsOauthTwitter bool `json:"is_oauth_twitter"` Login bool `json:"login"` Rks string `json:"rks"` IsOauthFacebook bool `json:"is_oauth_facebook"` IsStaff bool `json:"is_staff"` }
type RelatedEntry ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.