studio-client
1.0.0A client library for the Studio image hosting service
About Studio-Client
This is a common lisp client library for the Studio image gallery hosting software.
How To
Note that this requires the r-oauth module to be present on the Radiance instance Studio is hosted on. You will also need to create an oAuth application on the Radiance instance to authenticate through. On the default TyNET instance, this can be done in the admin panel.
Create your application and load up Studio-Client, including the North backend of your choice.
(ql:quickload '(studio-client north-drakma))
Once armed with an application key and secret, you can create a client
instance:
(defvar *client* (make-instance 'studio-client:client
:api-base <API-URL>
:key <KEY>
:secret <SECRET>))
On the default TyNET instance the api-base
would be "https://studio.tymoon.eu/api/"
. Once a client has been created, start the oAuth flow with north:initiate-authentication
and visit the URL it returns.
(north:initiate-authentication *client*)
; => https://studio.tymoon.eu/api/oauth/authorize....
Once you have authorised the application on the page, copy the code it gives you and pass it to north:complete-authentication
(north:complete-authentication *client* "3D6E639C-A0A8-...")
If this succeeds you should be ready to query the Studio API without any problems.
(studio-client:galleries *client*)
; => (#<STUDIO-CLIENT:GALLERY shinmera #1> #<STUDIO-CLIENT:GALLERY anon #11> ...)
(studio-client:uploads *client* (first *))
; => (#<STUDIO-CLIENT:UPLOAD "I know everything" #1286> ...)
(studio-client:file-url *client* (first (studio-client:files (first *))))
; => http://studio.tymoon.eu/api/studio/file?id=1365
See the two primary objects gallery
and upload
for more information.
System Information
Definition Index
-
STUDIO-CLIENT
- ORG.SHIRAKUMO.STUDIO.CLIENT
No documentation provided.-
EXTERNAL CLASS CLIENT
The base client class for Studio connections. To start, you should create an instance of this client with the appropriate :API-BASE, which defaults to "https://studio.tymoon.eu/api/". Then use North's functions NORTH:INITIATE-AUTHENTICATION and NORTH:COMPLETE-AUTHENTICATION to complete the authentication cycle. See NORTH:CLIENT See API-BASE
-
EXTERNAL CLASS GALLERY
Representation of a user's gallery in Studio. See ID See AUTHOR See URL See COVER See DESCRIPTION See MAKE-GALLERY See GALLERY See GALLERIES See DELETE See SAVE
-
EXTERNAL CLASS UPLOAD
Representation of an upload in a gallery on a Studio instance. See ID See URL See TITLE See AUTHOR See TAGS See CREATED See VISIBILITY See DESCRIPTION See FILES See MAKE-UPLOAD See UPLOADS See UPLOAD
-
EXTERNAL GENERIC-FUNCTION API-BASE
- OBJECT
Returns the base API URL that the client will send API requests to. See CLIENT
-
EXTERNAL GENERIC-FUNCTION AUTHOR
- OBJECT
-
EXTERNAL GENERIC-FUNCTION COVER
- OBJECT
Returns the ID of the upload that was set as the gallery's cover image, if any. See GALLERY
-
EXTERNAL GENERIC-FUNCTION (SETF COVER)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CREATED
- OBJECT
Returns the universal-time timestamp of when the upload was created. See UPLOAD
-
EXTERNAL GENERIC-FUNCTION (SETF CREATED)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION DELETE
- CLIENT
- GALLERY
-
EXTERNAL GENERIC-FUNCTION DESCRIPTION
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF DESCRIPTION)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FILE-CONTENT
- CLIENT
- ID
- &KEY
- THUMB
Returns the file's binary payload data as returned by the server. Returns an unsigned-byte 8 vector. This function will error if the requested file does not exist.
-
EXTERNAL GENERIC-FUNCTION FILE-URL
- CLIENT
- ID
- &KEY
- THUMB
Returns the public URL to the file.
-
EXTERNAL GENERIC-FUNCTION FILES
- OBJECT
Accessor to the list of files of the upload. Returned by the server are merely the file IDs, which you can turn into URLs and payloads with FILE-URL and FILE-CONTENT respectively. If you want to add new files, add the pathname to the file at the appropriate position in the file list. Note that setting this will only change the local object. In order to persist the changes, use SAVE. See UPLOAD See SAVE See FILE-URL See FILE-CONTENT
-
EXTERNAL GENERIC-FUNCTION (SETF FILES)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION GALLERIES
- CLIENT
- &KEY
- START
- END
-
EXTERNAL GENERIC-FUNCTION GALLERY
- CLIENT
- AUTHOR
-
EXTERNAL GENERIC-FUNCTION ID
- OBJECT
-
EXTERNAL GENERIC-FUNCTION MAKE-GALLERY
- CLIENT
- &KEY
- DESCRIPTION
-
EXTERNAL GENERIC-FUNCTION MAKE-UPLOAD
- CLIENT
- TITLE
- FILES
- &KEY
- DESCRIPTION
- TAGS
- VISIBILITY
-
EXTERNAL GENERIC-FUNCTION SAVE
- CLIENT
- GALLERY
-
EXTERNAL GENERIC-FUNCTION TAGS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF TAGS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION TITLE
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF TITLE)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION UPLOAD
- CLIENT
- ID
-
EXTERNAL GENERIC-FUNCTION UPLOADS
- CLIENT
- AUTHOR
- &KEY
- TAG
- DATE
- START
- END
-
EXTERNAL GENERIC-FUNCTION URL
- OBJECT
-
EXTERNAL GENERIC-FUNCTION VISIBILITY
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF VISIBILITY)
- NEW-VALUE
- OBJECT
No documentation provided.