2017-06-21 06:18:46 +02:00
|
|
|
//
|
|
|
|
// RSHTMLMetadata.h
|
2017-06-25 23:06:01 +02:00
|
|
|
// RSParser
|
2017-06-21 06:18:46 +02:00
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 3/6/16.
|
|
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
@import Foundation;
|
|
|
|
|
|
|
|
@class RSHTMLMetadataFeedLink;
|
|
|
|
@class RSHTMLMetadataAppleTouchIcon;
|
2017-11-26 20:38:03 +01:00
|
|
|
@class RSHTMLOpenGraphProperties;
|
|
|
|
@class RSHTMLOpenGraphImage;
|
|
|
|
@class RSHTMLTag;
|
2017-11-26 20:49:01 +01:00
|
|
|
@class RSHTMLTwitterProperties;
|
2017-06-21 06:18:46 +02:00
|
|
|
|
|
|
|
@interface RSHTMLMetadata : NSObject
|
|
|
|
|
2017-11-26 20:38:03 +01:00
|
|
|
- (instancetype)initWithURLString:(NSString *)urlString tags:(NSArray <RSHTMLTag *> *)tags;
|
2017-06-21 06:18:46 +02:00
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSString *baseURLString;
|
2017-11-26 20:38:03 +01:00
|
|
|
@property (nonatomic, readonly) NSArray <RSHTMLTag *> *tags;
|
2017-06-21 06:18:46 +02:00
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSString *faviconLink;
|
|
|
|
@property (nonatomic, readonly) NSArray <RSHTMLMetadataAppleTouchIcon *> *appleTouchIcons;
|
|
|
|
@property (nonatomic, readonly) NSArray <RSHTMLMetadataFeedLink *> *feedLinks;
|
|
|
|
|
2017-11-26 20:38:03 +01:00
|
|
|
@property (nonatomic, readonly) RSHTMLOpenGraphProperties *openGraphProperties;
|
2017-11-26 20:49:01 +01:00
|
|
|
@property (nonatomic, readonly) RSHTMLTwitterProperties *twitterProperties;
|
|
|
|
|
2017-06-21 06:18:46 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@interface RSHTMLMetadataAppleTouchIcon : NSObject
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSString *rel;
|
|
|
|
@property (nonatomic, readonly) NSString *sizes;
|
2017-11-27 05:40:07 +01:00
|
|
|
@property (nonatomic, readonly) CGSize size;
|
2017-06-21 06:18:46 +02:00
|
|
|
@property (nonatomic, readonly) NSString *urlString; // Absolute.
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@interface RSHTMLMetadataFeedLink : NSObject
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSString *title;
|
|
|
|
@property (nonatomic, readonly) NSString *type;
|
|
|
|
@property (nonatomic, readonly) NSString *urlString; // Absolute.
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2017-11-26 20:38:03 +01:00
|
|
|
@interface RSHTMLOpenGraphProperties : NSObject
|
|
|
|
|
|
|
|
// TODO: the rest. At this writing (Nov. 26, 2017) I just care about og:image.
|
|
|
|
// See http://ogp.me/
|
|
|
|
|
|
|
|
- (instancetype)initWithURLString:(NSString *)urlString tags:(NSArray <RSHTMLTag *> *)tags;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSArray <RSHTMLOpenGraphImage *> *images;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RSHTMLOpenGraphImage : NSObject
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSString *url;
|
|
|
|
@property (nonatomic, readonly) NSString *secureURL;
|
|
|
|
@property (nonatomic, readonly) NSString *mimeType;
|
|
|
|
@property (nonatomic, readonly) CGFloat width;
|
|
|
|
@property (nonatomic, readonly) CGFloat height;
|
|
|
|
@property (nonatomic, readonly) NSString *altText;
|
|
|
|
|
|
|
|
@end
|
2017-11-26 20:49:01 +01:00
|
|
|
|
|
|
|
@interface RSHTMLTwitterProperties : NSObject
|
|
|
|
|
|
|
|
// TODO: the rest. At this writing (Nov. 26, 2017) I just care about twitter:image:src.
|
|
|
|
|
|
|
|
- (instancetype)initWithURLString:(NSString *)urlString tags:(NSArray <RSHTMLTag *> *)tags;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) NSString *imageURL; // twitter:image:src
|
|
|
|
|
|
|
|
@end
|
|
|
|
|