/**
 * External API endpoints for various resources
 * @return {Function -> Object}
 */

export const chan = function(boardID, threadID) {
    return {
        boardlist: `http://a.4cdn.org/boards.json`,
        board: `https://a.4cdn.org/${boardID}/catalog.json`,
        thread: `http://a.4cdn.org/${boardID}/thread/${threadID}.json`,
        archive: `https://a.4cdn.org/${boardID}/archive.json`,
        image: `https://i.4cdn.org/${boardID}/`,
        thumbnail: `https://t.4cdn.org/${boardID}/`,
    }
}

export const reddit = function({type="default", limit=50}) {
    // @param type  - default, popular, new, gold
    // @param limit - the maximum number of items desired (default: 25, maximum: 100)
    return {
        subreddits: `http://reddit.com/subreddits/${type}/.json?limit=${limit}`
    }
}


@@ -49,40 +49,8 @@
 ces%0A
- * @return %7BFunction -%3E Object%7D%0A
  */%0A
@@ -67,12 +67,19 @@
 nst 
+four
 chan
+API
  = f
@@ -498,27 +498,40 @@
 t reddit
- = function
+API = %7B%0A    subreddits: 
 (%7Btype=%22
@@ -550,15 +550,23 @@
 mit=
-5
+10
 0%7D) 
-%7B%0A
+=%3E %7B%0A    
     
@@ -611,16 +611,20 @@
 w, gold%0A
+    
     // @
@@ -701,16 +701,20 @@
 m: 100)%0A
+    
     retu
@@ -716,26 +716,94 @@
  return 
-%7B
+%60http://reddit.com/subreddits/$%7Btype%7D/.json?limit=$%7Blimit%7D%60
 %0A    
+%7D,%0A
     
+search_
 subreddi
@@ -805,25 +805,142 @@
 reddits:
+ (%7Bquery%7D) =%3E %7B%0A        if (!query) %7B%0A            throw new Error('No query supplied')%0A        %7D%0A%0A        return
  %60http
+s
 ://
+www.
 reddit.c
@@ -943,32 +943,232 @@
 it.com/s
-ubreddits/$%7Btype
+earch/.json?q=$%7Bquery%7D%60%0A    %7D,%0A    board: (%7BboardID, limit=100%7D) =%3E %7B%0A        if (!boardID) %7B%0A            throw new Error('No boardID supplied to reddit')%0A        %7D%0A%0A        return %60https://www.reddit.com/r/$%7BboardID
 %7D/.json?
@@ -1179,21 +1179,22 @@
 t=$%7Blimit%7D%60%0A
+%0A
     %7D%0A%7D%0A%0A

Rename exports, add reddit search + board