Documentation ¶
Overview ¶
Package bookmarks lets you fetch saved bookmarks from all common browsers databases. The New.. methods return a new BookmarkGrabber that implements the Grabber interface.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bookmark ¶
type Bookmark struct { BookmarkGrabber DateAdded time.Time Name string URL string Type BookmarkType // contains filtered or unexported fields }
Bookmark represents a chromium browser bookmark. Bookmark can be of type URL or of type FOLDER
func NewChromiumGrabber ¶ added in v0.2.0
func NewChromiumGrabber(profile browserutils.ProfileDir, area BookmarkArea) (*Bookmark, error)
NewChromiumGrabber return a new grabber of type Bookmark, with the wanted BookmarkArea.
Example ¶
profiles, err := browserutils.GetChromiumProfileDirs() if err != nil { log.Fatal(err) } profile := profiles[0] bookmarks, err := NewChromiumGrabber(profile, BOOKMARK_BAR) if err != nil { log.Fatal(err) } for b := range bookmarks.Iterate() { if b.IsFolder() { fmt.Println(b.Name, b.DateAdded) } else { fmt.Println(b.Name, b.URL, b.DateAdded) } }
Output:
func (Bookmark) IsFolder ¶
IsFolder returns true if the bookmark type is folder. This will help you to iterate on nested bookmarks and folders.
func (*Bookmark) Iterate ¶
Iterate lets you iterate on all the available bookmarks with a basic for loop.
type BookmarkArea ¶
type BookmarkArea int
const ( BOOKMARK_BAR BookmarkArea = iota OTHER SYNCED )
func (BookmarkArea) String ¶
func (b BookmarkArea) String() string
type BookmarkGrabber ¶
BookmarkGrabber extends the Grabber interface, for bookmarks specific grabbing.