updated gifhoarder

added giphy api models
This commit is contained in:
Nihaal Sharma committed 2026-03-16 14:21:19 +00:00
1 parent 224269a849
commit 1feb27c721
9 files changed
+257 -11

No files matched your search

@@ -0,0 +1,27 @@
//
// SlackResponse.swift
// StickerSlack
//
// Created by neon443 on 15/10/2025.
//
import Foundation
struct SlackResponse: Identifiable, Codable {
var type: String
var id: UUID
var name: String
var imageUrl: String
var alias: String?
static func toEmojis(from response: [SlackResponse]?) -> [Emoji]? {
guard let response else { return nil }
return response.map { item in
Emoji(
name: item.name,
url: URL(string: item.imageUrl)!,
id: item.id
)
}
}
}
+32
View File
@@ -0,0 +1,32 @@
//
// GifObject.swift
// StickerSlack
//
// Created by neon443 on 16/03/2026.
//
import Foundation
struct GifObject: Codable, Identifiable {
var type: String
var id: String
var slug: String
var url: String
var bitly_url: String
var embed_url: String
var username: String
var source: String
var rating: String
var content_url: String?
var user: GiphyUser
var source_tld: String
var source_post_url: String
var update_datetime: Date
var create_datetime: Date
var import_datetime: Date
var trending_datetime: Date
var images: GiphyImages
var title: String
var alt_text: String
var is_low_contrast: Bool
}
@@ -0,0 +1,95 @@
//
// GiphyImages.swift
// StickerSlack
//
// Created by neon443 on 16/03/2026.
//
import Foundation
struct GiphyImages: Codable {
//fixed height of 200px
var fixed_height: motion
//fixed height of 200px still
var fixed_height_still: still
//fixed height 200px with 6 frames
var fixed_height_downsampled: downsampled
//fixed height of 100px
var fixed_height_small: motion
//fixed height of 100px still
var fixed_height_small_still: still
//fixed width of 200px
var fixed_width: motion
//fixed width of 200px
var fixed_width_still: still
//fixed width 200px with 6 frames
var fixed_width_downsampled: downsampled
//fixed width of 100px
var fixed_width_small: motion
//fixed width of 100px still
var fixed_width_small_still: still
//under 2mb
var downsized: downsized
//downsized still
var downsized_still: still
//under 8mb
var downsized_large: downsized
//under 5mb
var downsized_medium: downsized
//under 200kb
var downsized_small: video
var original: motion
var original_still: still
//15s looping version
var looping: looping
//mp4 format 50kb, first 1-2s of the gif
var preview: video
//50kb first 1-2s of the gif
var preview_gif: still
struct motion: Codable {
var url: String
var width: String
var height: String
var size: String
var mp4: String
var mp4_size: String
var webp: String
var webp_size: String
}
struct still: Codable {
var url: String
var width: String
var height: String
}
struct downsampled: Codable {
var url: String
var width: String
var height: String
var size: String
var webp: String
var webp_size: String
}
struct downsized: Codable {
var url: String
var width: String
var height: String
var size: String
}
struct looping: Codable {
var mp4: String
}
struct video: Codable {
var mp4: String
var mp4_size: String
var width: String
var height: String
}
}
+16
View File
@@ -0,0 +1,16 @@
//
// GiphyUser.swift
// StickerSlack
//
// Created by neon443 on 16/03/2026.
//
import Foundation
struct GiphyUser: Codable {
var avatar_url: String
var banner_url: String
var profile_url: String
var username: String
var display_name: String
}
+19
View File
@@ -0,0 +1,19 @@
//
// Meta.swift
// StickerSlack
//
// Created by neon443 on 16/03/2026.
//
import Foundation
struct Meta: Codable, Identifiable {
var msg: String
var status: Int
var response_id: String
var id: String { response_id }
static var example: Meta {
Meta(msg: "OK", status: 200, response_id: "57eea03c72381f86e05c35d2")
}
}
@@ -0,0 +1,18 @@
//
// Pagination.swift
// StickerSlack
//
// Created by neon443 on 16/03/2026.
//
import Foundation
struct Pagination: Codable {
var offset: Int
var total_count: Int?
var count: Int
static var example: Pagination {
Pagination(offset: 2591, total_count: 250, count: 25)
}
}
+14
View File
@@ -0,0 +1,14 @@
//
// Trending.swift
// StickerSlack
//
// Created by neon443 on 16/03/2026.
//
import Foundation
struct Trending: Codable {
var data: [GifObject]
var pagination: Pagination
var meta: Meta
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.