Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( PUDELEK_BASE_URL = "https://pudelek.pl" PUDL_CONFIG_FILE = ".pudl.yaml" )
View Source
const ( SELECTOR_BASE = "[data-st-area=main-stream-%d]" MEDIA_STREAMS_COUNT = 21 )
View Source
const (
REFRESH_THROTTLE = 10
)
View Source
const (
TIMEOUT = 2
)
View Source
const (
VERSION = "v0.0.2"
)
Variables ¶
View Source
var (
ErrNothingCached = errors.New("Nothing is cached yet")
)
View Source
var (
ErrNothingFound = errors.New("Did not found anything on the page. Maybe structure has changed! Please update pudl")
)
View Source
var (
ErrOutOfCacheBounds = errors.New("index provided by user is out of usable bounds")
)
View Source
var (
SHOW_LOG = false
)
Functions ¶
func Display ¶
Example ¶
package main func pudlsForTesting() (*[]Pudl, *[]Pudl) { oldPudls := &[]Pudl{ { Title: "A", Url: "https://lol.com/A", }, { Title: "B", Url: "https://lol.com/B", }, { Title: "C", Url: "https://lol.com/C", }, { Title: "D", Url: "https://lol.com/D", }, } pudlsToShow := &[]Pudl{ { Title: "A", Url: "https://lol.com/A", }, { Title: "J", Url: "https://lol.com/J", }, { Title: "O", Url: "https://lol.com/O", }, } return oldPudls, pudlsToShow } func main() { oldPudls, pudlsToShow := pudlsForTesting() Display(pudlsToShow, oldPudls, -1) }
Output: ⭐⭐⭐ 😹 Lista tematow z pudla 🐩 😹 ⭐⭐⭐ 1: A 2:⭐ J 3:⭐ O
func EnableLogs ¶
func EnableLogs()
func ScrapePudelekFrontPage ¶
Types ¶
type PudlData ¶
type PudlData struct { Config struct { TopCount int } `yaml:"config"` LastFetchTime time.Time Data []Pudl `yaml:"db"` }
func LoadConfigFromFile ¶
func LoadDataFromYaml ¶
func (*PudlData) SaveToFile ¶
Click to show internal directories.
Click to hide internal directories.