Example #1
0
func main() {
	user := "******"
	params := hbapi.NewFavoriteFeedParams(user)
	//params.SetUser("yukihir0")
	//params.SetPage(1)
	//params.SetUntil(time.Now().Add(7 * 24 * -time.Hour))
	//params.EnableWithMe()
	//params.DisableWithMe()

	feed, err := hbapi.GetFavoriteFeed(params)
	if err != nil {
		panic(err)
	}

	for _, item := range feed.Items {
		fmt.Println(item.Title)
	}
}
Example #2
0
func (api HttpAPI) RequestFavoriteBookmarks(user string, page int) []Bookmark {
	params := hbapi.NewFavoriteFeedParams(user)
	params.SetPage(page)
	feed, err := hbapi.GetFavoriteFeed(params)
	if err != nil {
		return []Bookmark{}
	}

	bookmarks := []Bookmark{}
	for _, item := range feed.Items {
		bookmarks = append(bookmarks, Bookmark{
			Title: item.Title,
			URL:   item.Link,
			Count: item.BookmarkCount,
		})
	}

	return bookmarks
}