2019-05-28 19:08:15 +02:00
|
|
|
//
|
|
|
|
// GoogleReaderCompatibleFeed.swift
|
|
|
|
// Account
|
|
|
|
//
|
2019-06-19 13:56:25 +02:00
|
|
|
// Created by Jeremy Beker on 5/28/19.
|
2019-05-28 19:08:15 +02:00
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RSCore
|
|
|
|
import RSParser
|
|
|
|
|
2019-06-15 18:27:21 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
{
|
|
|
|
"numResults":0,
|
|
|
|
"error": "Already subscribed! https://inessential.com/xml/rss.xml
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct GoogleReaderCompatibleQuickAddResult: Codable {
|
|
|
|
let numResults: Int
|
|
|
|
let error: String?
|
|
|
|
let streamId: String?
|
|
|
|
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case numResults = "numResults"
|
|
|
|
case error = "error"
|
|
|
|
case streamId = "streamId"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:08:19 +02:00
|
|
|
struct GoogleReaderCompatibleSubscriptionContainer: Codable {
|
|
|
|
let subscriptions: [GoogleReaderCompatibleSubscription]
|
|
|
|
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case subscriptions = "subscriptions"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
{
|
|
|
|
"id": "feed/1",
|
|
|
|
"title": "Questionable Content",
|
|
|
|
"categories": [
|
|
|
|
{
|
|
|
|
"id": "user/-/label/Comics",
|
|
|
|
"label": "Comics"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"url": "http://www.questionablecontent.net/QCRSS.xml",
|
|
|
|
"htmlUrl": "http://www.questionablecontent.net",
|
|
|
|
"iconUrl": "https://rss.confusticate.com/f.php?24decabc"
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
2019-05-28 19:08:15 +02:00
|
|
|
struct GoogleReaderCompatibleSubscription: Codable {
|
2019-06-01 14:08:19 +02:00
|
|
|
let feedID: String
|
2019-05-28 19:08:15 +02:00
|
|
|
let name: String?
|
2019-06-01 14:08:19 +02:00
|
|
|
let categories: [GoogleReaderCompatibleCategory]
|
2019-05-28 19:08:15 +02:00
|
|
|
let url: String
|
|
|
|
let homePageURL: String?
|
2019-06-01 14:08:19 +02:00
|
|
|
let iconURL: String?
|
2019-05-28 19:08:15 +02:00
|
|
|
|
|
|
|
enum CodingKeys: String, CodingKey {
|
2019-06-01 14:08:19 +02:00
|
|
|
case feedID = "id"
|
2019-05-28 19:08:15 +02:00
|
|
|
case name = "title"
|
2019-06-01 14:08:19 +02:00
|
|
|
case categories = "categories"
|
|
|
|
case url = "url"
|
|
|
|
case homePageURL = "htmlUrl"
|
|
|
|
case iconURL = "iconUrl"
|
2019-05-28 19:08:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:08:19 +02:00
|
|
|
struct GoogleReaderCompatibleCategory: Codable {
|
|
|
|
let categoryId: String
|
|
|
|
let categoryLabel: String
|
|
|
|
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case categoryId = "id"
|
|
|
|
case categoryLabel = "label"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-28 19:08:15 +02:00
|
|
|
struct GoogleReaderCompatibleCreateSubscription: Codable {
|
|
|
|
let feedURL: String
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case feedURL = "feed_url"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct GoogleReaderCompatibleUpdateSubscription: Codable {
|
|
|
|
let title: String
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case title
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct GoogleReaderCompatibleSubscriptionChoice: Codable {
|
|
|
|
|
|
|
|
let name: String?
|
|
|
|
let url: String
|
|
|
|
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case name = "title"
|
|
|
|
case url = "feed_url"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|