diff options
| author | LLLL Colonq <llll@colonq> | 2024-09-13 13:52:38 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-09-13 13:52:38 -0400 |
| commit | d93ab7e848bf0f4bc1087504eecd7c959d19bf6c (patch) | |
| tree | f4f1806ceb56d2a68c9641313000f9a50fa77d78 /src/gizmo/wasp-gcp.el | |
| parent | cc3ccebbd3af825f5e4866532906f1a7a2756518 (diff) | |
Update :3
Diffstat (limited to 'src/gizmo/wasp-gcp.el')
| -rw-r--r-- | src/gizmo/wasp-gcp.el | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gizmo/wasp-gcp.el b/src/gizmo/wasp-gcp.el new file mode 100644 index 00000000..c9c584b0 --- /dev/null +++ b/src/gizmo/wasp-gcp.el @@ -0,0 +1,52 @@ +;;; wasp-gcp --- Global consciousness project integration -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(require 'dash) +(require 's) +(require 'f) +(require 'ht) +(require 'cl-lib) +(require 'request) +(require 'dom) + +(defcustom w/gcp-server "https://global-mind.org" + "Server URL for GCP project." + :type '(string) + :group 'wasp) + +(defvar w/gcp-last-response nil) + +(defun w/gcp-get (loc k) + "Get LOC from GCP, passing the returned HTML to K." + (setf request-message-level -1) + (request + (s-concat w/gcp-server loc) + :type "GET" + :parser (lambda () (libxml-parse-xml-region (point-min) (point-max))) + :success + (cl-function + (lambda (&key data &allow-other-keys) + (setq w/gcp-last-response data) + (funcall k data)))) + t) + +(defun w/gcp-dot (k) + "Pass the current GCP index (as a number between 0 and 1) to K." + (w/gcp-get + "/gcpdot/gcpindex.php" + (lambda (d) + (funcall k (string-to-number (caddar (last (cddr (cadddr d))))))))) + +(defun w/gcp-describe (n) + "Describe GCP index N." + (cond + ((< n 0.05) "Red dot. Significantly large network variance. Suggests broadly shared coherence of thought and emotion.") + ((< n 0.10) "Orange dot. Strongly increased network variance. May be chance fluctuation.") + ((< n 0.40) "Yellow dot. Slightly increased network variance. Probably chance fluctuation.") + ((< n 0.90) "Green dot. Normally random network variance. This is average or expected behavior.") + ((< n 0.95) "Light blue dot. Small network variance. Probably chance fluctuation.") + (t "Blue dot. Significantly small network variance. Suggestive of deeply shared, internally motivated group focus."))) + +(provide 'wasp-gcp) +;;; wasp-gcp.el ends here |
