Skip to content

mikegetz/godrudge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISCLAIMER:

This project is an independent, unofficial implementation and is not affiliated with or endorsed by Drudge. It is provided for educational and experimental purposes only.

Please note that this implementation relies on parsing the website's current HTML DOM and the unofficial Drudge Report RSS feed.

image

Example Usage:

How to access the parsed headlines from the client

package main

import (
    "fmt"

    "github.com/mikegetz/godrudge"
)

func main() {
    client := godrudge.NewClient()
    err := client.ParseRSS()
    if err != nil {
        fmt.Println("Error parsing", err)
    }

    //Access the first headline title from Column 1
    fmt.Println(client.Page.HeadlineColumns[0][0].Title)
    fmt.Println(client.Page.HeadlineColumns[0][0].Href)

    //Access the first headline title from Column 2
    fmt.Println(client.Page.HeadlineColumns[1][0].Title)
    fmt.Println(client.Page.HeadlineColumns[1][0].Href)

    //Access the first headline title from Column 3
    fmt.Println(client.Page.HeadlineColumns[2][0].Title)
    fmt.Println(client.Page.HeadlineColumns[2][0].Href)
}

About

Golang SDK for accessing drudge headlines

Resources

License

Stars

Watchers

Forks

Contributors

Languages