Skip to content

Commit

Permalink
Add new params as vars in ParselyMetadata class
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinAkram committed Jan 19, 2024
1 parent 83103cb commit aa5396c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Sources/Metadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,66 @@ import Foundation
public class ParselyMetadata {
var canonical_url: String?
var pub_date: Date?
var save_date: Date?
var title: String?
var authors: Array<String>?
var image_url: String?
var section: String?
var tags: Array<String>?
var duration: TimeInterval?
var page_type: String?
var urls: String?
var post_id: String?
var pub_date_tmsp: Date?
var custom_metadata: String?
var save_date_tmsp: Date?
var thumb_url: String?
var full_content_word_count: Int?
var share_urls: Array<String>?
var data_source: String?
var canonical_hash: String?
var canonical_hash64: String?
var video_platform: String?
var language: String?
var full_content: String?
var full_content_sha512: String?
var network_id_str: String?
var network_canonical: String?
var content_enrichments: Dictionary<String, Any>?


/**
A class to manage and re-use metadata. Metadata contained in an instance of this
class will conform to Parsely's schema.

- Parameter canonical_url: A post's canonical url. For videos, it is overridden with the vId and thus can be omitted.
- Parameter pub_date: Date this piece of content was published.
- Parameter save_date: Date this piece of content was saved.
- Parameter title: Title of the content.
- Parameter authors: Up to 10 authors are accepted.
- Parameter image_url: Where the main image for this post is hosted.
- Parameter section: Same as section for website integration.
- Parameter tags: Up to 20 tags on an event are allowed.
- Parameter duration: Durations passed explicitly to trackVideoStart take precedence over any in metadata.
- Parameter page_type: The type of page being tracked
- Parameter urls: A list of urls associated with this post.
- Parameter post_id: A unique identifier for this post.
- Parameter pub_date_tmsp: Date this piece of content was published.
- Parameter custom_metadata: A string of custom metadata.
- Parameter save_date_tmsp: Date this piece of content was saved.
- Parameter thumb_url: Where the thumbnail image for this post is hosted.
- Parameter full_content_word_count: The number of words in the full content.
- Parameter share_urls: A list of urls associated with this post.
- Parameter data_source: The data source for this post.
- Parameter canonical_hash: The canonical hash for this post.
- Parameter canonical_hash64: The canonical hash for this post.
- Parameter video_platform: The video platform for this post.
- Parameter language: The language for this post.
- Parameter full_content: The full content for this post.
- Parameter full_content_sha512: The full content sha512 for this post.
- Parameter network_id_str: The network id for this post.
- Parameter network_canonical: The network canonical for this post.
- Parameter content_enrichments: The content enrichments for this post.
*/
public init(canonical_url: String? = nil,
pub_date: Date? = nil,
Expand Down

0 comments on commit aa5396c

Please sign in to comment.