diff options
| author | Christine Dodrill <me@christine.website> | 2018-11-13 07:30:55 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2018-11-13 07:30:55 -0800 |
| commit | e245d89daa6dffc441be07dcb81b985397446378 (patch) | |
| tree | 0d399b0de689f43fbbfaa979d939dca8aa03e716 /vendor/github.com/Xe/jsonfeed/jsonfeed.go | |
| parent | bc8b7e5471e7f4984ee69af07d8e9632df01b85b (diff) | |
| parent | 8fe5504c3a5e9cd8409d5296d128603a231567ac (diff) | |
| download | xesite-e245d89daa6dffc441be07dcb81b985397446378.tar.xz xesite-e245d89daa6dffc441be07dcb81b985397446378.zip | |
Merge branch 'master' of git@github.com:Xe/site.git
Diffstat (limited to 'vendor/github.com/Xe/jsonfeed/jsonfeed.go')
| -rw-r--r-- | vendor/github.com/Xe/jsonfeed/jsonfeed.go | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/vendor/github.com/Xe/jsonfeed/jsonfeed.go b/vendor/github.com/Xe/jsonfeed/jsonfeed.go deleted file mode 100644 index 913880d..0000000 --- a/vendor/github.com/Xe/jsonfeed/jsonfeed.go +++ /dev/null @@ -1,73 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -package jsonfeed - -import ( - "encoding/json" - "io" - "time" -) - -const CurrentVersion = "https://jsonfeed.org/version/1" - -type Item struct { - ID string `json:"id"` - URL string `json:"url"` - ExternalURL string `json:"external_url"` - Title string `json:"title"` - ContentHTML string `json:"content_html"` - ContentText string `json:"content_text"` - Summary string `json:"summary"` - Image string `json:"image"` - BannerImage string `json:"banner_image"` - DatePublished time.Time `json:"date_published"` - DateModified time.Time `json:"date_modified"` - Author Author `json:"author"` - Tags []string `json:"tags"` -} - -type Author struct { - Name string `json:"name"` - URL string `json:"url"` - Avatar string `json:"avatar"` -} - -type Hub struct { - Type string `json:"type"` - URL string `json:"url"` -} - -type Attachment struct { - URL string `json:"url"` - MIMEType string `json:"mime_type"` - Title string `json:"title"` - SizeInBytes int64 `json:"size_in_bytes"` - DurationInSeconds int64 `json:"duration_in_seconds"` -} - -type Feed struct { - Version string `json:"version"` - Title string `json:"title"` - HomePageURL string `json:"home_page_url"` - FeedURL string `json:"feed_url"` - Description string `json:"description"` - UserComment string `json:"user_comment"` - NextURL string `json:"next_url"` - Icon string `json:"icon"` - Favicon string `json:"favicon"` - Author Author `json:"author"` - Expired bool `json:"expired"` - Hubs []Hub `json:"hubs"` - Items []Item `json:"items"` -} - -func Parse(r io.Reader) (Feed, error) { - var feed Feed - decoder := json.NewDecoder(r) - if err := decoder.Decode(&feed); err != nil { - return Feed{}, err - } - return feed, nil -} |
