Skip to content

Instantly share code, notes, and snippets.

@greenonion
Created June 17, 2016 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenonion/e801ad9ee8b6c22a681a8a00bc929713 to your computer and use it in GitHub Desktop.
Save greenonion/e801ad9ee8b6c22a681a8a00bc929713 to your computer and use it in GitHub Desktop.
Athens Clojure Dojo - 16/06/2016. Parse Clojure project dependencies from Github (unfinished)
(ns clj_gh.gh
(:require [cheshire.core :as json]))
(defn get-projects [name]
(str "https://raw.githubusercontent.com/"
name
"/master/project.clj"))
(defn retrieve-clj-projects []
(let [uri "https://api.github.com/search/repositories?q=language:clojure"]
(-> (slurp uri)
(json/parse-string true)
:items)))
(defn project-urls []
(map #(get-projects (:full_name %)) (retrieve-clj-projects)))
(defn get-dependencies [uri]
(let [a (slurp uri)]
(map #(-> % first str) (nth (read-string a) 8))))
(defproject clj-gh "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[cheshire "5.6.1"]]
:main ^:skip-aot clj-gh.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment