Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Junker committed Jul 18, 2024
1 parent c288cd1 commit 5ccd6d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,35 @@ This system can be installed from [UltraLisp](https://ultralisp.org/) like this:
(defvar *service-file* "/myproject/config/google-service.json")
;; Translate
(defparameter *client* (gapi:make-client-with-service-account service-file
:scopes '("https://www.googleapis.com/auth/cloud-translation")))
(defparameter *client*
(gapi:make-client-with-service-account
service-file :scopes '("https://www.googleapis.com/auth/cloud-translation")))
(defparameter *project-id* (gapi:client-project-id *client*))
(gapi:auth *client*)
(gapi:request *client* (format nil "https://translate.googleapis.com/v3beta1/projects/~A:detectLanguage" *project-id*)
(gapi:request *client* (format nil
"https://translate.googleapis.com/v3beta1/projects/~A:detectLanguage"
*project-id*)
:method :POST :payload '(:|content| "Hello"))
;; => (:|languages| ((:|confidence| 1 :|languageCode| "en")))
;; FCM
(defparameter *client* (gapi:make-client-with-service-account service-file
:scopes '("https://www.googleapis.com/auth/firebase.messaging")))
(defparameter *client*
(gapi:make-client-with-service-account
service-file :scopes '("https://www.googleapis.com/auth/firebase.messaging")))
(defparameter *project-id* (gapi:client-project-id *client*))
(gapi:auth *client*)
(defvar *message*
(list :|token| *token*
:|notification| (list :|title| "Message Title"
:|body| "Message body")))
(gapi:request *client* (format nil "https://fcm.googleapis.com/v1/projects/~A/messages:send" *project-id*)
(gapi:request *client* (format nil "https://fcm.googleapis.com/v1/projects/~A/messages:send"
*project-id*)
:method :POST :data (list :|message| *message*))
etc
;;etc
```

## Documentation

- [Google APIs Explorer](https://developers.google.com/apis-explorer)
2 changes: 1 addition & 1 deletion gapi.asd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defsystem "gapi"
(defsystem gapi
:version "0.1.0"
:author "Dmitrii Kosenkov"
:license "MIT"
Expand Down

0 comments on commit 5ccd6d2

Please sign in to comment.