-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into atom_version
- Loading branch information
Showing
13 changed files
with
467 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package googleplay // import "miniflux.app/v2/internal/reader/googleplay" | ||
|
||
// Specs: | ||
// https://support.google.com/googleplay/podcasts/answer/6260341 | ||
// https://www.google.com/schemas/play-podcasts/1.0/play-podcasts.xsd | ||
type GooglePlayFeedElement struct { | ||
GooglePlayAuthor string `xml:"http://www.google.com/schemas/play-podcasts/1.0 author"` | ||
GooglePlayEmail string `xml:"http://www.google.com/schemas/play-podcasts/1.0 email"` | ||
GooglePlayImage GooglePlayImageElement `xml:"http://www.google.com/schemas/play-podcasts/1.0 image"` | ||
GooglePlayDescription string `xml:"http://www.google.com/schemas/play-podcasts/1.0 description"` | ||
GooglePlayCategory GooglePlayCategoryElement `xml:"http://www.google.com/schemas/play-podcasts/1.0 category"` | ||
} | ||
|
||
type GooglePlayItemElement struct { | ||
GooglePlayAuthor string `xml:"http://www.google.com/schemas/play-podcasts/1.0 author"` | ||
GooglePlayDescription string `xml:"http://www.google.com/schemas/play-podcasts/1.0 description"` | ||
GooglePlayExplicit string `xml:"http://www.google.com/schemas/play-podcasts/1.0 explicit"` | ||
GooglePlayBlock string `xml:"http://www.google.com/schemas/play-podcasts/1.0 block"` | ||
GooglePlayNewFeedURL string `xml:"http://www.google.com/schemas/play-podcasts/1.0 new-feed-url"` | ||
} | ||
|
||
type GooglePlayImageElement struct { | ||
Href string `xml:"href,attr"` | ||
} | ||
|
||
type GooglePlayCategoryElement struct { | ||
Text string `xml:"text,attr"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package itunes // import "miniflux.app/v2/internal/reader/itunes" | ||
|
||
import "strings" | ||
|
||
// Specs: https://help.apple.com/itc/podcasts_connect/#/itcb54353390 | ||
type ItunesFeedElement struct { | ||
ItunesAuthor string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd author"` | ||
ItunesBlock string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd block"` | ||
ItunesCategories []ItunesCategoryElement `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd category"` | ||
ItunesComplete string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd complete"` | ||
ItunesCopyright string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd copyright"` | ||
ItunesExplicit string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd explicit"` | ||
ItunesImage ItunesImageElement `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd image"` | ||
Keywords string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd keywords"` | ||
ItunesNewFeedURL string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd new-feed-url"` | ||
ItunesOwner ItunesOwnerElement `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd owner"` | ||
ItunesSummary string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd summary"` | ||
ItunesTitle string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd title"` | ||
ItunesType string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd type"` | ||
} | ||
|
||
func (i *ItunesFeedElement) GetItunesCategories() []string { | ||
var categories []string | ||
for _, category := range i.ItunesCategories { | ||
categories = append(categories, category.Text) | ||
if category.SubCategory != nil { | ||
categories = append(categories, category.SubCategory.Text) | ||
} | ||
} | ||
return categories | ||
} | ||
|
||
type ItunesItemElement struct { | ||
ItunesAuthor string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd author"` | ||
ItunesEpisode string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd episode"` | ||
ItunesEpisodeType string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd episodeType"` | ||
ItunesExplicit string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd explicit"` | ||
ItunesDuration string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd duration"` | ||
ItunesImage ItunesImageElement `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd image"` | ||
ItunesSeason string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd season"` | ||
ItunesSubtitle string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd subtitle"` | ||
ItunesSummary string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd summary"` | ||
ItunesTitle string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd title"` | ||
ItunesTranscript string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd transcript"` | ||
} | ||
|
||
type ItunesImageElement struct { | ||
Href string `xml:"href,attr"` | ||
} | ||
|
||
type ItunesCategoryElement struct { | ||
Text string `xml:"text,attr"` | ||
SubCategory *ItunesCategoryElement `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd category"` | ||
} | ||
|
||
type ItunesOwnerElement struct { | ||
Name string `xml:"name"` | ||
Email string `xml:"email"` | ||
} | ||
|
||
func (i *ItunesOwnerElement) String() string { | ||
var name string | ||
|
||
switch { | ||
case i.Name != "": | ||
name = i.Name | ||
case i.Email != "": | ||
name = i.Email | ||
} | ||
|
||
return strings.TrimSpace(name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package rss // import "miniflux.app/v2/internal/reader/rss" | ||
|
||
import "strings" | ||
|
||
type AtomAuthor struct { | ||
Author AtomPerson `xml:"http://www.w3.org/2005/Atom author"` | ||
} | ||
|
||
func (a *AtomAuthor) String() string { | ||
return a.Author.String() | ||
} | ||
|
||
type AtomPerson struct { | ||
Name string `xml:"name"` | ||
Email string `xml:"email"` | ||
} | ||
|
||
func (a *AtomPerson) String() string { | ||
var name string | ||
|
||
switch { | ||
case a.Name != "": | ||
name = a.Name | ||
case a.Email != "": | ||
name = a.Email | ||
} | ||
|
||
return strings.TrimSpace(name) | ||
} | ||
|
||
type AtomLink struct { | ||
URL string `xml:"href,attr"` | ||
Type string `xml:"type,attr"` | ||
Rel string `xml:"rel,attr"` | ||
Length string `xml:"length,attr"` | ||
} | ||
|
||
type AtomLinks struct { | ||
Links []*AtomLink `xml:"http://www.w3.org/2005/Atom link"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.