package module
Version: v0.0.0-...-a402645 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2016 License: MIT Imports: 5 Imported by: 0



Go Library for scraping RSS feed to JSON output

XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horrible crap to exist. - Linus Torvalds


package main

import (

func main() {
	json, err := nu.JSON("")
  	if err != nil {




This section is empty.


This section is empty.


func JSON

func JSON(url string) (JSON []byte, err error)

JSON returns the NU RSS feed as JSON in []byte


type Article

type Article struct {
	Title       string     `xml:"title" json:"title"`
	Link        string     `json:"link"`
	Description string     `xml:"description" json:"description"`
	PubData     string     `xml:"pubDate" json:"pubdate"`
	GUID        int        `xml:"guid" json:"guid"`
	Categories  []string   `xml:"category" json:"categories"`
	Creator     string     `xml:"creator" json:"creator"`
	Rights      string     `xml:"rights" json:"rights"`
	Image       Enclosure  `xml:"enclosure" json:"image"`
	Related     []AtomLink `xml:" link" json:"related"`

Article constains information of single article

type AtomLink struct {
	Link  string `xml:"href,attr"`
	Title string `xml:"title,attr"`

AtomLink contains reference articles

type Channel

type Channel struct {
	Title         string    `xml:"title" json:"title"`
	Description   string    `xml:"description" json:"description"`
	Language      string    `xml:"language" json:"language"`
	Copyright     string    `xml:"copyright" json:"copyright"`
	LastBuildDate string    `xml:"lastBuildDate" json:"lastbuilddate"`
	Item          []Article `xml:"item" json:"item"`

Channel contains channel of NUXML feed

type Enclosure

type Enclosure struct {
	Link string `xml:"url,attr" json:"url"`

Enclosure contains image of article

type XML

type XML struct {
	Channel Channel `xml:"channel"`

XML is a struct containing RSS file

func Struct

func Struct(url string) (feed XML, err error)

Struct returns the NU RSS feed as struct XML

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL