mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
minor changes; working on gphy
This commit is contained in:
4 files changed
+8
-9
No files matched your search
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
// Created by neon443 on 02/11/2025.
|
// Created by neon443 on 02/11/2025.
|
||||||
//
|
//
|
||||||
|
|
||||||
VERSION = 1.0
|
VERSION = 2.0
|
||||||
BUILD = 1
|
BUILD = 1
|
||||||
|
|
||||||
// Configuration settings file format documentation can be found at:
|
// Configuration settings file format documentation can be found at:
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import Combine
|
|||||||
class GifHoarder: Hoarder, ObservableObject {
|
class GifHoarder: Hoarder, ObservableObject {
|
||||||
static let container: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
static let container: URL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||||
|
|
||||||
var endpoint: URL = URL(string: "api.giphy.com/v1/gifs/trending")!
|
var endpoint: URL = URL(string: "https://api.giphy.com/v1/gifs/trending")!
|
||||||
var endpointSearch: URL = URL(string: "api.giphy.com/v1/gifs/search")!
|
var endpointSearch: URL = URL(string: "https://api.giphy.com/v1/gifs/search")!
|
||||||
|
|
||||||
@Published var searchTerm: String = ""
|
@Published var searchTerm: String = ""
|
||||||
@Published var trendingGifs: [Gif] = []
|
@Published var trendingGifs: [Gif] = []
|
||||||
@@ -35,9 +35,8 @@ class GifHoarder: Hoarder, ObservableObject {
|
|||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
async let (data, _) = try URLSession.shared.data(from: endpoint)
|
async let (data, _) = try URLSession.shared.data(from: endpoint)
|
||||||
// let decoded: [String: Any] = decoder.decode([String: Any].self, from: await data)
|
|
||||||
dump(await data)
|
dump(await data)
|
||||||
print()
|
print(await data.base64EncodedString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Foundation
|
|||||||
|
|
||||||
enum StickerType: CustomStringConvertible, CaseIterable, Identifiable {
|
enum StickerType: CustomStringConvertible, CaseIterable, Identifiable {
|
||||||
case slackEmoji
|
case slackEmoji
|
||||||
case giphyGif
|
case giphyGifs
|
||||||
|
|
||||||
var id: String { self.description }
|
var id: String { self.description }
|
||||||
|
|
||||||
@@ -17,8 +17,8 @@ enum StickerType: CustomStringConvertible, CaseIterable, Identifiable {
|
|||||||
switch self {
|
switch self {
|
||||||
case .slackEmoji:
|
case .slackEmoji:
|
||||||
return "Slack Emoji"
|
return "Slack Emoji"
|
||||||
case .giphyGif:
|
case .giphyGifs:
|
||||||
return "Giphy GIF"
|
return "Giphy GIFs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ struct BrowseView: View {
|
|||||||
ForEach(hoarder.emojis, id: \.self) { emoji in
|
ForEach(hoarder.emojis, id: \.self) { emoji in
|
||||||
EmojiRow(hoarder: hoarder, emoji: emoji)
|
EmojiRow(hoarder: hoarder, emoji: emoji)
|
||||||
}
|
}
|
||||||
case .giphyGif:
|
case .giphyGifs:
|
||||||
Text("hi")
|
Text("hi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||