DeviantArtFs 0.7.0
See the version list below for details.
dotnet add package DeviantArtFs --version 0.7.0
NuGet\Install-Package DeviantArtFs -Version 0.7.0
<PackageReference Include="DeviantArtFs" Version="0.7.0" />
paket add DeviantArtFs --version 0.7.0
#r "nuget: DeviantArtFs, 0.7.0"
// Install DeviantArtFs as a Cake Addin #addin nuget:?package=DeviantArtFs&version=0.7.0 // Install DeviantArtFs as a Cake Tool #tool nuget:?package=DeviantArtFs&version=0.7.0
DeviantArtFs
A .NET / F# library to interact with the DeviantArt / Sta.sh API.
If you're using this library in a .NET Framework project and it doesn't run, make sure that the dependencies (FSharp.Core, FSharp.Json, FSharp.Control.AsyncSeq) are installed via NuGet.
Notes
Each request that can be made to DeviantArt is represented by a module somewhere in the DeviantArtFs.Requests namespace. These modules have static methods that take an IDeviantArtAccessToken (see "Authentication" below) and usually at least one other parameter.
In most cases, these static methods exist in pairs - one method will use F# async and use F# features such as records and option types, while the other will return a Task<T> and use interfaces and null values for interoperability with C# and VB.NET.
Some modules also have ToAsyncSeq and ToArrayAsync methods, which can be used to fetch an arbitary amount of data as needed. (Keep in mind that some of the endpoints under /browse/ might consist of many, many pages...)
Currently unsupported features
- The following groups of endpoints are not currently implemented:
- Feed
- Messages
- Notes
- The "expand" parameter (user.details, user.geo, etc) is not currently supported.
- The "ext_preload" parameter (gallery/folders, collections/folders) is not currently supported.
- The "mature_content" parameter is not currently supported.
Supported endpoints
Browse
- GET /browse/categorytree
- GET /browse/dailydeviations
- GET /browse/hot
- GET /browse/morelikethis
- GET /browse/morelikethis/preview
- GET /browse/newest
- GET /browse/popular
- GET /browse/tags
- GET /browse/tags/search
- GET /browse/undiscovered
- GET /browse/user/journals
Collections
- GET /collections/{folderid}
- GET /collections/folders
- POST /collections/fave
- POST /collections/unfave
- POST /collections/folders/create
- GET /collections/folders/remove/{folderid}
Comments
- GET /comments/{commentid}/siblings
- GET /comments/deviation/{deviationid}
- POST /comments/post/deviation/{deviationid}
- POST /comments/post/profile/{username}
- POST /comments/post/status/{statusid}
- GET /comments/profile/{username}
- GET /comments/status/{statusid}
Data
- GET /data/countries
- GET /data/privacy
- GET /data/submission
- GET /data/tos
Deviation
- GET /deviation/{deviationid}
- GET /deviation/content
- GET /deviation/download/{deviationid}
- GET /deviation/embeddedcontent
- GET /deviation/metadata
- GET /deviation/whofaved
Gallery
- GET /gallery/gallery/{folderid}
- GET /gallery/all
- GET /gallery/folders
- POST /gallery/folders/create
- GET /gallery/folders/remove/{folderid}
Stash
- GET /stash/{stackid}
- GET /stash/{stackid}/contents
- POST /stash/delete
- GET /stash/delta
- GET /stash/item/{itemid}
- POST /stash/move/{stackid}
- POST /stash/position/{stackid}
- POST /stash/publish
- GET /stash/publish/categorytree
- GET /stash/publish/userdata
- GET /stash/space
- POST /stash/submit
- POST /stash/update/{stackid}
The DeviantArtFs.Stash.Marshal library (https://github.com/libertyernie/DeviantArtFs.Stash.Marshal) provides a StashRoot object that can process delta entries.
User
- GET /user/damntoken
- GET /user/friends/{username}
- GET /user/friends/search
- GET /user/friends/unwatch/{username}
- POST /user/friends/watch/{username}
- GET /user/friends/watching/{username}
- GET /user/profile/{username}
- POST /user/profile/update
- GET /user/statuses
- GET /user/statuses/{statusid}
- POST /user/statuses/post
- GET /user/watchers/{username}
- GET /user/whoami
- POST /user/whois
Util
- GET /placebo
Usage
Example (C#):
var list = new List<IBclDeviation>();
int offset = 0;
while (true) {
var req = new DeviantArtFs.Requests.Gallery.GalleryAllViewRequest();
var paging = new PagingParams {
Offset = offset,
Limit = 24
};
IBclDeviantArtPagedResult<IBclDeviation> resp =
await DeviantArtFs.Requests.Gallery.GalleryAllView.ExecuteAsync(token, paging, req);
list.AddRange(resp.Results);
offset = resp.NextOffset ?? 0;
if (!resp.HasMore) break;
}
Example (F#):
let list = new ResizeArray<Deviation>()
let mutable offset = 0
let mutable more = true
while more do
let req = new DeviantArtFs.Requests.Gallery.GalleryAllViewRequest()
let paging = new PagingParams(Offset = 0, Limit = Nullable 24)
let! (resp: DeviantArtPagedResult<Deviation>) = DeviantArtFs.Requests.Gallery.GalleryAllView.AsyncExecute token paging req
list.AddRange(resp.results)
offset <- resp.next_offset |> Option.defaultValue 0
more <- resp.has_more
Note how the result from AsyncExecute is DeviantArtPagedResult
, which has a next_offset field of int option
,
while the result from ExecuteAsync is IBclDeviantArtPagedResult
, which has a NextOffset field of int?
.
See ENDPOINTS.md for more information.
Examples
The Examples folder in the source code repository contains small applications that use DeviantArtFs:
- RecentSubmissions.CSharp: A C# console application that shows the most recent submission, journal, and status for a user, along with any favorites or comments. (WinForms is needed for the login window, however.) Uses the Implicit grant and stores tokens in a file.
- RecentSubmissions.FSharp: As above, but in F#, to demonstrate how DeviantArtFs has both F#-style and .NET-style functions and types.
- GalleryViewer: A VB.NET app that lets you see the "All" view of someone's gallery and read the descriptions of individual submissions. Uses the Client Credentials grant and stores tokens in a file.
- WebApp: An ASP.NET Core 2.1 app written in C# that lets you view someone's gallery folders and corresponding submission thumbnails. Uses the Client Credentials grant and stores tokens in a database.
Authentication
See also: https://www.deviantart.com/developers/authentication
Both Authorization Code (recommended) and Implicit grant types are supported. If you are writing a Windows desktop application, you can use the forms in the DeviantArtFs.WinForms package to get a code or token from the user using either grant type.
The DeviantArtAuth class provides methods to support the Authorization Code grant type (getting tokens from an authorization code and refreshing tokens).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FSharp.Control.AsyncSeq (>= 2.0.21)
- FSharp.Core (>= 4.5.4)
- FSharp.Json (>= 0.3.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DeviantArtFs:
Package | Downloads |
---|---|
DeviantArtFs.Stash.Marshal
An F#/.NET library to interact with the Sta.sh API and manage state (.NET Standard 2.0) |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
11.0.0 | 80 | 10/28/2024 |
11.0.0-beta2 | 66 | 10/28/2024 |
10.1.0-beta2 | 89 | 10/20/2024 |
10.1.0-beta1 | 73 | 9/21/2024 |
10.0.0 | 122 | 8/8/2024 |
10.0.0-rc1 | 95 | 8/8/2024 |
9.2.1-rc1 | 79 | 8/7/2024 |
9.2.0 | 108 | 6/19/2024 |
9.2.0-beta1 | 94 | 6/19/2024 |
9.1.1 | 120 | 4/27/2024 |
9.1.0-rc1 | 210 | 11/27/2023 |
9.0.0 | 271 | 11/22/2023 |
9.0.0-beta4 | 142 | 5/30/2023 |
9.0.0-beta2 | 108 | 5/28/2023 |
8.0.0 | 463 | 5/30/2021 |
8.0.0-beta4 | 280 | 5/30/2021 |
8.0.0-beta3 | 334 | 5/30/2021 |
8.0.0-beta2 | 235 | 5/30/2021 |
7.0.1 | 402 | 1/11/2021 |
7.0.0 | 381 | 1/9/2021 |
7.0.0-beta1 | 293 | 1/9/2021 |
6.0.2 | 366 | 1/5/2021 |
6.0.1 | 432 | 12/28/2020 |
6.0.0 | 343 | 12/27/2020 |
6.0.0-beta2 | 328 | 12/26/2020 |
6.0.0-beta1 | 320 | 12/26/2020 |
5.0.0 | 517 | 2/11/2020 |
5.0.0-beta1 | 435 | 2/11/2020 |
4.0.0 | 503 | 1/23/2020 |
4.0.0-beta2 | 450 | 1/23/2020 |
4.0.0-beta1 | 459 | 1/22/2020 |
3.0.0 | 552 | 1/17/2020 |
2.2.0 | 555 | 1/6/2020 |
2.1.0 | 531 | 9/9/2019 |
2.0.0-beta3 | 504 | 3/9/2019 |
2.0.0-beta2 | 483 | 3/8/2019 |
2.0.0-beta1 | 478 | 3/6/2019 |
1.1.0-beta1 | 473 | 3/5/2019 |
1.0.0 | 700 | 2/10/2019 |
0.9.0 | 1,349 | 1/29/2019 |
0.8.0 | 692 | 1/28/2019 |
0.7.3 | 714 | 1/22/2019 |
0.7.2 | 693 | 1/22/2019 |
0.7.1 | 1,356 | 1/19/2019 |
0.7.0 | 728 | 1/18/2019 |
0.6.0 | 1,388 | 1/14/2019 |
0.5.0 | 1,358 | 1/11/2019 |
0.4.0 | 1,380 | 1/3/2019 |
0.3.0 | 1,383 | 12/31/2018 |
0.2.0-alpha | 1,182 | 12/27/2018 |
0.1.0-alpha | 618 | 12/21/2018 |
0.7.0: More refactoring, add Comments-related methods, switch deserialization library to FSharp.Json