diff options
author | Vincent Ambo <mail@tazj.in> | 2021-12-15T20·58+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2021-12-15T21·14+0000 |
commit | 75ca24c60a57ab894da4d404755b8b4094284ad8 (patch) | |
tree | b6eac4b7035b3c73f0de8d9a26b04b85386d87e3 /third_party/lisp/trivial-backtrace/dev/mucking.lisp | |
parent | fa73841a4b8bf305e375bdebf0c5b10b3fec4113 (diff) |
chore(3p/lisp): use nixpkgs sources for trivial-backtrace r/3257
Change-Id: If4ee3f9a0afea74759493de14c7f672714739f45 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4341 Autosubmit: tazjin <mail@tazj.in> Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'third_party/lisp/trivial-backtrace/dev/mucking.lisp')
-rw-r--r-- | third_party/lisp/trivial-backtrace/dev/mucking.lisp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/third_party/lisp/trivial-backtrace/dev/mucking.lisp b/third_party/lisp/trivial-backtrace/dev/mucking.lisp deleted file mode 100644 index 2be26a5a870e..000000000000 --- a/third_party/lisp/trivial-backtrace/dev/mucking.lisp +++ /dev/null @@ -1,75 +0,0 @@ -(in-package #:metabang.gsn) - -#| -Need to account for different kinds of links - in gsn-nodes-from-json, need to return pairs of node and attributes - -hash-table for nodes to prevent duplicates -queue or stack for nodes to expand -hash-table for links (triples of A link B?) to handle duplicates -|# - -(defgeneric expand-node (context node) - ) - -(defgeneric find-neighbors (context node) - ) - -(defgeneric expand-node-p (context node) - ) - -(defgeneric add-node (context node) - ) - -(defgeneric add-link (context node neighbor direction) - ) - -(defgeneric update-node-data (context node data) - ) - -(defclass abstract-context () - ()) - -(defclass gsn-context (abstract-context) - ()) - -(defparameter +gsn-root+ "http://socialgraph.apis.google.com/") - -(defmethod expand-node ((context abstract-context) node) - (bind (((to from) (find-neighbors context node))) - (dolist (neighbor to) - (add-node context neighbor) - (add-link context node neighbor :to)) - (dolist (neighbor from) - (add-node context neighbor) - (add-link context node neighbor :from)))) - - - -(defmethod find-neighbors ((context gsn-context) node) - (bind (((result headers stream) - (http-get - (format nil "~alookup?edo=1&edi=1&pretty=1&q=~a" - +gsn-root+ node))) - json) - (unwind-protect - (setf json (json:decode-json stream)) - (close strea)) - (update-node-data context node json) - (list (gsn-nodes-from-json json :to) - (gsn-nodes-from-json json :from)))) - -(gsn-nodes-from-json x :from) - -(defun gsn-test (who) - (destructuring-bind (result headers stream) - (http-get - (format nil "http://socialgraph.apis.google.com/lookup?edo=1&edi=1&pretty=1&q=~a" who)) - (declare (ignore result headers)) - (json:decode-json stream))) - -(assoc :nodes_referenced - (assoc :nodes (gsn-test "TWITTER.COM/GWKING") :key #'first)) - - -(setf x (gsn-test "TWITTER.COM/GWKING")) |