 
 
   my channel= UC4-vzjcBolmvYWYP6ldbLbA
-  another channel id = UC4u8goEsLgpPvDX2mKD70nQ
-  "
-  [api-key channel-id]
+  another channel id = UC4u8goEsLgpPvDX2mKD70nQ "
+  [channel-id]
   (let [url (str config/api-base "activities?part=snippet&channelId=" channel-id "&key=" api-key)
-        body (-> @(http/get url) :body)]
+        body (-> (http/get url {:as :json}) :body)]
     (log/debug (str "Got activites: " body))
     body))
 
 (defn search-videos
   "Original Url: https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC-lHJZR3Gqxm24_Vd_AJ5Yw&key=
 
-  Search all videos of pewdiepie's channel, ordered by date, newest first
-  https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UC-lHJZR3Gqxm24_Vd_AJ5Yw&order=date&key=
-
   Use like: `(search-videos api-key 'UC-lHJZR3Gqxm24_Vd_AJ5Yw')`
   ^ pewds channel
 
   my channel= UC4-vzjcBolmvYWYP6ldbLbA
-  another channel id = UC4u8goEsLgpPvDX2mKD70nQ
-  "
-  [api-key channel-id]
+  another channel id = UC4u8goEsLgpPvDX2mKD70nQ "
+  [channel-id]
   (let [url (str config/api-base "search?part=snippet&channelId=" channel-id
                  "&key=" api-key "&order=date")
-        body (-> @(http/get url) :body)]
+        body (-> (http/get url {:as :json}) :body)]
     (log/debug (str "Got videos from search: " body))
     (let [as-json (json/read-str body)]
       ;; TODO: go through the items, parse and getting info we want
       (get as-json "items"))))
 
-;; (defn parse-videos
-;;   "Loop through videos for things that interest us..."
-;;   []
-;;   "")
-
-;; ;; (get-video-commentThreads api-key "d2dNb0wdJF0")
-
-;; ;; (search-videos api-key "UC-lHJZR3Gqxm24_Vd_AJ5Yw")
-
-;; ;; videos for a channel:
+(defn parse-videos
+  "Loop through videos, find all comment threads, scan each,
+  store bad ones on a file..."
+  []
+  "")
+
+;; (get-video-commentThreads api-key "d2dNb0wdJF0")
+
+;; (search-videos api-key "UC-lHJZR3Gqxm24_Vd_AJ5Yw")
+
+;; videos for a channel:
 ;; [{"kind" "youtube#searchResult",
 ;;  "etag" "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/xL2Kk-wHmX7jWjGq4UC1iRNQW00\"",
 ;;  "id" {"kind" "youtube#video",

   (catch [:status 401] e (log/error e))))

(defn get-video-commentThreads
  "
  https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=UTXCu1VQDRw&key=

  Use like:
  "
  [api-key video-id]
  (try+
   (let [url (str config/api-base "commentThreads?part=snippet&videoId="
                  video-id "&order=time&key=" api-key)
         body (-> @(http/get url) :body)]
     (let [as-json (json/read-str body)
           items (get as-json "items")]
       ;; TODO: go through the items, parse and getting info we want
       (log/trace "Got commentThreads for a video:")
       items))
   (catch [:status 401] e (log/error e))))

(defn get-video-comments
  "Specific Comment by Id
   https://www.googleapis.com/youtube/v3/comments?id=z124jjhzrlfitdvcw23xfzyrdya4ij0kj&part=snippet&key="
  [api-key parent-id]
  (try+
   (let [url (str config/api-base "comments?part=snippet&parentId="
                  parent-id "&key=" api-key)
         body (-> @(http/get url) :body)]
     (let [as-json (json/read-str body)
           items (get as-json "items")]
       ;; TODO: go through the items, parse and getting info we want

;;  "publishedAt" "2017-02-18T19:49:00.000Z"}},
;;  "canReply" false,
;;  "totalReplyCount" 0,
;;  "isPublic" true}} {"kind" "youtube#commentThread",
;;  "etag" "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/6rzPsBSlGgYUbsFdaNT1W8lYb5g\"",
;;  "id" "z13xvl2ovsqtiz1wj04cfrpxgkmwhvb5zok0k",
;;  "snippet" {"videoId" "d2dNb0wdJF0",
;;  "topLevelComment" {"kind" "youtube#comment",
;;  "etag" "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/vO1aAbS4eSd6Z2Swj-6PS4KtZ-c\"",
;;  "id" "z13xvl2ovsqtiz1wj04cfrpxgkmwhvb5zok0k",
;;  "snippet" {"textOriginal" "This is Bob - 🐨\nBob has no penis\n1 like = 1 penis 🍆",
;;  "updatedAt" "2017-02-18T19:48:59.000Z",
;;  "authorProfileImageUrl" "https://yt3.ggpht.com/-1FlFWIb0gFY/AAAAAAAAAAI/AAAAAAAAAAA/mFk1cYFrwxM/s28-c-k-no-mo-rj-c0xffffff/photo.jpg",
;;  "authorDisplayName" "iArvin",
;;  "videoId" "d2dNb0wdJF0",
;;  "textDisplay" "This is Bob - 🐨<br />Bob has no penis<br />1 like = 1 penis 🍆",
;;  "authorChannelUrl" "http://www.youtube.com/channel/UC7eXcXvkGEoYpjjYv2hrqxA",
;;  "canRate" false,
;;  "authorChannelId" {"value" "UC7eXcXvkGEoYpjjYv2hrqxA"},
;;  "likeCount" 0,
;;  "viewerRating" "none",
;;  "publishedAt" "2017-02-18T19:48:59.000Z"}},
;;  "canReply" false,
;;  "totalReplyCount" 0,
;;  "isPublic" true}} {"kind" "youtube#commentThread",
;;  "etag" "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/1Dn25Gd_MVoW1IWVobV4AvRgxlo\"",
;;  "id" "z12dwv2h2t3bwjznt22zhjliux3dj3ok2",
;;  "snippet" {"videoId" "d2dNb0wdJF0",
