Last active
August 29, 2015 14:13
-
-
Save brabadu/7d007f11f4ebd82f98b0 to your computer and use it in GitHub Desktop.
Generate a oneline descriptions for github repo with API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns example | |
(:require [clojure.data.json :as json] | |
[clojure.string :as string])) | |
(defn descriptions [repos] | |
(map (fn [html-repo] (let [ | |
api-repo (string/replace html-repo #"github.com" "api.github.com/repos") | |
json-resp (json/read-str (slurp api-repo) | |
:key-fn keyword) | |
name (:name json-resp) | |
url (:html_url json-resp) | |
description (:description json-resp) | |
homepage (:homepage json-resp) | |
line (format "* [%s](%s) %s %s" name url description homepage)] | |
line)) | |
repos)) | |
(def myreps [ | |
"https://github.com/MfgLabs/mfglabs-iconset" | |
"https://github.com/parkerbennett/stackicons" | |
"https://github.com/samcollins/css-social-buttons" | |
"https://github.com/Keyamoon/IcoMoon-Free" | |
"https://github.com/jhogue/PE-Analog-Clock-icon-font" | |
"https://github.com/erikflowers/weather-icons" | |
]) | |
(println (string/join "\n" (descriptions myreps))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment