mirror of
https://codeberg.org/librarian/feeds
synced 2024-12-06 19:16:24 +01:00
rename syndicate -> feeds, paths jmoiron/syndicate -> gorilla/feeds
This commit is contained in:
@@ -1,13 +1,21 @@
|
|||||||
Syndication (feed) generator library for golang.
|
## gorilla/feeds
|
||||||
|
|
||||||
Usage:
|
Web feed generator library.
|
||||||
|
|
||||||
|
### Goals
|
||||||
|
|
||||||
|
* simple interface to create both Atom & RSS 2.0 feeds
|
||||||
|
* full support for Atom/RSS2.0 spec elements
|
||||||
|
* ability to modify particulars for each spec
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
"github.com/jmoiron/syndicate"
|
"github.com/gorilla/syndicate"
|
||||||
)
|
)
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package syndicate
|
package feeds
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Syndication (feed) generator library for golang.
|
|||||||
|
|
||||||
Installing
|
Installing
|
||||||
|
|
||||||
go get github.com/jmoiron/syndicate
|
go get github.com/gorilla/feeds
|
||||||
|
|
||||||
Syndicate provides a simple, generic Feed interface with a generic Item object as well as RSS and Atom specific RssFeed and AtomFeed objects which allow access to all of each spec's defined elements.
|
Syndicate provides a simple, generic Feed interface with a generic Item object as well as RSS and Atom specific RssFeed and AtomFeed objects which allow access to all of each spec's defined elements.
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ Create a Feed and some Items in that feed using the generic interfaces:
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
. "github.com/jmoiron/syndicate"
|
. "github.com/gorilla/feeds
|
||||||
)
|
)
|
||||||
|
|
||||||
now = time.Now()
|
now = time.Now()
|
||||||
@@ -54,7 +54,7 @@ From here, you can output Atom or RSS versions of this feed easily
|
|||||||
atom, err := feed.ToAtom()
|
atom, err := feed.ToAtom()
|
||||||
rss, err := feed.ToRss()
|
rss, err := feed.ToRss()
|
||||||
|
|
||||||
You can also get access to the underlying objects that syndicate uses to export its XML
|
You can also get access to the underlying objects that feeds uses to export its XML
|
||||||
|
|
||||||
atomFeed := &Atom{feed}.AtomFeed()
|
atomFeed := &Atom{feed}.AtomFeed()
|
||||||
rssFeed := &Rss{feed}.RssFeed()
|
rssFeed := &Rss{feed}.RssFeed()
|
||||||
@@ -63,8 +63,8 @@ From here, you can modify or add each syndication's specific fields before outpu
|
|||||||
|
|
||||||
atomFeed.Subtitle = "plays the blues"
|
atomFeed.Subtitle = "plays the blues"
|
||||||
atom, err := ToXML(atomFeed)
|
atom, err := ToXML(atomFeed)
|
||||||
rssFeed.Generator = "Golang Syndicate v1.0 (github.com/jmoiron/syndicate)"
|
rssFeed.Generator = "gorilla/feeds v1.0 (github.com/gorilla/feeds)"
|
||||||
rss, err := ToXML(rssFeed)
|
rss, err := ToXML(rssFeed)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
package syndicate
|
package feeds
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package syndicate
|
package feeds
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package syndicate
|
package feeds
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package syndicate
|
package feeds
|
||||||
|
|
||||||
// rss support
|
// rss support
|
||||||
// validation done according to spec here:
|
// validation done according to spec here:
|
||||||
@@ -7,7 +7,6 @@ package syndicate
|
|||||||
import (
|
import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"fmt"
|
"fmt"
|
||||||
//"net/url"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package syndicate
|
package feeds
|
||||||
|
|
||||||
// relevant bits from https://github.com/abneptis/GoUUID/blob/master/uuid.go
|
// relevant bits from https://github.com/abneptis/GoUUID/blob/master/uuid.go
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package syndicate
|
package feeds
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|||||||
Reference in New Issue
Block a user