Skip to content

Instantly share code, notes, and snippets.

@clojj
Created Jan 23, 2015
Embed
What would you like to do?
github v3 api with tentacles
(ns github-api.core
(:gen-class)
(:require [tentacles.repos :as repos])
(:use [clojure.pprint])
(:import (java.time Period LocalDateTime)))
(let [starred (repos/starring "clojj"
{:per-page 4
:accept "application/vnd.github.v3.star+json"})
;git-urls (map #(get-in % [:repo :git_url]) starred)
users-and-names (map (fn [s] [(get-in s [:repo :owner :login]) (get-in s [:repo :name])]) starred)]
(pprint users-and-names)
(let [commits-last-week
(for [[user repo] users-and-names :let [commits (repos/commits user repo {:per-page 100 :since (-> (LocalDateTime/now) (.minus (Period/ofYears 1)) (.toString))})]]
(map #(str repo " : " (get-in % [:commit :message]))
commits))]
(pprint commits-last-week)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment