<commit_before>(ns photosure.server
  (:gen-class :main true)
  (:require [org.httpkit.server :as srv]
            [clj-http.client :as client]
            [environ.core :refer [env]])
  (:use [compojure.route :only [files not-found resources]]
        [compojure.handler :only [site]]
        [compojure.core :only [defroutes GET POST DELETE ANY context]]
        [ring.util.response :only [file-response response]]
        [ring.middleware.transit :refer [wrap-transit-response
                                         wrap-transit-params]]))

(def api "http://api.tumblr.com/v2/blog/cpleblow.tumblr.com/posts?api_key=<KEY>")

(def root (env :root))

(defn posts [page]
  (let [offset (str "&offset=" (* 20 (read-string page)))
        req (str api offset)]
    (get-in (client/get req {:as :json}) [:body :response :posts])))

(defn trim-posts [posts]<commit_msg>pulling tumblr api key from profile now<commit_after>(ns photosure.server
  (:gen-class :main true)
  (:require [org.httpkit.server :as srv]
            [clj-http.client :as client]
            [environ.core :refer [env]])
  (:use [compojure.route :only [files not-found resources]]
        [compojure.handler :only [site]]
        [compojure.core :only [defroutes GET POST DELETE ANY context]]
        [ring.util.response :only [file-response response]]
        [ring.middleware.transit :refer [wrap-transit-response
                                         wrap-transit-params]]))

(def root (env :root))
(def tumblr-api (str "http://api.tumblr.com/v2/blog/cpleblow.tumblr.com/posts?api_key=" (env :tumblr-key)))

(defn posts [page]
  (let [offset (str "&offset=" (* 20 (read-string page)))
        req (str tumblr-api offset)]
    (get-in (client/get req {:as :json}) [:body :response :posts])))

(defn trim-posts [posts]
{'fraction_non_alphanumeric': 0.1553072625698324, 'fraction_numerical': 0.0033519553072625698, 'mean_word_length': 2.8433476394849784, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4865216', 'n_tokens_mistral': 617, 'n_tokens_neox': 592, 'n_words': 152}