Create a gist now

Instantly share code, notes, and snippets.

Reddit Karma Status
;;; Quickload
(ql:quickload "cl-json")
(ql:quickload "drakma")
;;; Settings
(defparameter *username* "cliffwarden")
(setq drakma:*header-stream* nil)
(setq drakma:*text-content-types* (cons '("application" . "json")
;;; Utility
(defun reddit-about-url (username)
(format nil "" username))
;;; Functions
(defun get-about (username)
(json:decode-json-from-string (drakma:http-request (reddit-about-url username\
(defun get-link-karma (about)
(cdr (fifth (cdadr about))))
(defun get-comment-karma (about)
(cdr (sixth (cdadr about))))
(defun get-stats (u)
((about (get-about u)))
(format t "~A: ~A/~A~%" u (get-link-karma about) (get-comment-karma about))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment