Skip to content

Commit

Permalink
Merge pull request #5 from RobertoMachorro/linux-support
Browse files Browse the repository at this point in the history
Conditional include of getProfile
  • Loading branch information
RobertoMachorro committed Jul 23, 2023
2 parents 3f8ad9a + 8b15011 commit 99dd882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ Gravatar doesn't have an official spec of the JSON data, so there is a lot of tr
Check the list below on ideas how to help:

* DocC documentation.
* Port getProfile to FoundationNetwork based platforms (URLSession compatibility).
* Convert Photo.Type and InstantMessenger.Type from String to Enums.
* Support for Github Codespaces (Linux based).
* Separate structures into files.
* Add SwiftNIO download support.
* Add built-in SwiftNIO download support.

# Why use Apple Crypto library?

Expand Down
3 changes: 3 additions & 0 deletions Sources/SwiftGravatar/SwiftGravatar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ extension GravatarProfile {
return "https://en.gravatar.com/\(emailMD5).json"
}

// WISHLIST: Port getProfile to FoundationNetwork based platforms, URLSession compatibility
#if !os(Linux)
// Request JSON Profile Data from Gravatar
// Docs: https://en.gravatar.com/site/implement/profiles/json/
public static func getProfile(using email: String) async throws -> GravatarProfile? {
Expand All @@ -101,6 +103,7 @@ extension GravatarProfile {
}
return nil
}
#endif

/* SWIFTNIO
static func get(using email: String, on request: Request) -> EventLoopFuture<GravatarProfile> {
Expand Down

0 comments on commit 99dd882

Please sign in to comment.