Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
First attempt at a Reddit Karma "getter"
;;; Quickload
(ql:quickload "drakma")
;;; Settings
(defparameter *username* "cliffwarden")
(setq drakma:*header-stream* nil)
(setq drakma:*text-content-types* (cons '("application" . "json")
drakma:*text-content-types*))
;;; Utility
(defun reddit-about-url (username)
(format nil "http://www.reddit.com/user/~A/about.json" username))
;;; Functions
(defun get-about (username)
(drakma:http-request (reddit-about-url username))
;;; Our "main" function
(defun get-stats (u)
(get-about u))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment