Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct { // Name describes the human-friendly name of the author Name string `json:"name"` // Handle describes the preferred nickname of the author. This is used in the URL Handle string `json:"handle"` // Link describes the link to the author's page Link string `json:"link"` // AvatarLink describes the link to the avatar of the author AvatarLink string `json:"avatarLink"` }
Author describes the SD profile of the person that's created the presentations
type Location ¶
type Location struct { // RequestedAddress is populated from the original "requested" address mentioned in the // talk description (e.g. "TUAS-talo, Aalto University") RequestedAddress string `json:"requestedAddress"` // ResolvedAddress is populated by the Google Maps Geocoding API, and is the official street address // (or similar) of the place. In the above example: "Maarintie 8, 02150 Espoo, Finland" ResolvedAddress string `json:"resolvedAddress"` // Lat describes the latitude of the location Lat float64 `json:"lat"` // Lng describes the longitude of the location Lng float64 `json:"lng"` }
Location describes a geographical location for the talk This struct is populated by the LocationExtension, and is set based on a "Location: <address>" string in the talk description. For instance, if you put "Location: TUAS-talo, Aalto University" in the talk description, Location will be populated with coordinates based on Google Maps data.
type Talk ¶
type Talk struct { // TalkPreview is embedded here as it contains all the data we want to display here, too TalkPreview // Date represents the talk presentation date Date time.Time `json:"date"` // Author describes the Speakerdeck profile of the person that's created the presentations Author Author `json:"author"` // Category is a string of Speakerdeck-specific categories you can choose from when uploading a // presentation, e.g. "Technology" Category string `json:"category"` // CategoryLink is the link to other presentations belonging to the same category, e.g. // https://speakerdeck.com/c/technology. CategoryLink string `json:"categoryLink"` // DownloadLink is the link from where you can download the underlying PDF DownloadLink string `json:"downloadLink"` // ExtraLinks contains parsed URLs found in the talk description, mapped by their domain name ExtraLinks map[string][]string `json:"extraLinks"` // Hide is set to true if the talk description contains a "Hide: true" string, // indicating it should not be visible for the API. If a talk has set Hide=true, // it will be returned as normal, and the user of the API can choose whether to ignore // or respect that pledge Hide bool `json:"hide"` // Location describes a geographical location for the talk // This field is populated by the LocationExtension, and is set based on // a "Location: <address>" string in the talk description. For instance, // if you put "Location: TUAS-talo, Aalto University" in the talk description, // Location will be populated with coordinates based on Google Maps data. Location *Location `json:"location,omitempty"` }
Talk describes a presentation on Speakerdeck
type TalkPreview ¶
type TalkPreview struct { // Title describes the talk title Title string `json:"title"` // ID describes the URL-encoded descriptor for the talk, used in the URL as // https://speakerdeck.com/{user-handle}/{talk-id}. The ID is unique per user, but // not globally across users ID string `json:"id"` // Views describes how many views a talk has got Views uint32 `json:"views"` // Stars describes how many other users have starred this talk Stars uint32 `json:"stars"` // Link describes the link to the talk at Speakerdeck Link string `json:"link"` // DataID represents the key used to embed Speakerdeck presentations on an other website DataID string `json:"dataID"` }
TalkPreview contains the information about a talk that can be seen on the user page
type TalkScraper ¶
type TalkScraper struct{}
TalkScraper implements scraper.Scraper
func (*TalkScraper) Hooks ¶
func (s *TalkScraper) Hooks() []scraper.Hook
Hooks returns mappings between DOM paths in the scraped web pages, and handler functions to extract data out of them
func (*TalkScraper) InitialData ¶
func (s *TalkScraper) InitialData() interface{}
InitialData returns the struct pointer passed around between the handler functions registered in Hooks() This pointer is passed as the second argument to all handlers. The handlers can cast it from interface{} to its real type, and modify its data.
func (*TalkScraper) Name ¶
func (s *TalkScraper) Name() string
Name returns the name of the TalkScraper
type Talks ¶
type Talks []Talk
Talks orders the Talk objects by time
func ScrapeTalks ¶
func ScrapeTalks(userHandle, talkID string, opts *scraper.ScrapeOptions) (Talks, error)
ScrapeTalks returns either one sepecific talk if both userHandle and talkID are set, or a set of all the users' talks in detail if only userHandle is set. In opts you can set extensions
type User ¶
type User struct { // Author describes the Speakerdeck profile of the person that's created the presentations Author Author `json:"author"` // Abstract contains a short description of the user Abstract string `json:"abstract"` // TalkPreviews is a list of TalkPreview objects, containing information about each talk // as seen on the user page TalkPreviews []TalkPreview `json:"talkPreviews"` }
User represents a user on as browsed on the user page (i.e. https://speakerdeck.com/{user-handle})
func ScrapeUser ¶
func ScrapeUser(userHandle string, opts *scraper.ScrapeOptions) (*User, error)
ScrapeUser returns an user object based on the given user handle. In opts, you may specify possible scraping extensions, or log levels.
type UserScraper ¶
type UserScraper struct{}
UserScraper implements scraper.Scraper
func (*UserScraper) Hooks ¶
func (s *UserScraper) Hooks() []scraper.Hook
Hooks returns mappings between DOM paths in the scraped web pages, and handler functions to extract data out of them
func (*UserScraper) InitialData ¶
func (s *UserScraper) InitialData() interface{}
InitialData returns the struct pointer passed around between the handler functions registered in Hooks() This pointer is passed as the second argument to all handlers. The handlers can cast it from interface{} to its real type, and modify its data.
func (*UserScraper) Name ¶
func (s *UserScraper) Name() string
Name returns the name of the UserScraper
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
The scraper package contains generic, high-level scraper functionality built on top of github.com/gocolly/colly In order to use it, create a struct (e.g.
|
The scraper package contains generic, high-level scraper functionality built on top of github.com/gocolly/colly In order to use it, create a struct (e.g. |