Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
function! s:reddit()
tabnew
let res = webapi#json#decode(webapi#http#get('http://www.reddit.com/r/vim.json').content)
let lines = []
for item in res.data.children
call add(lines, "* " . item.data.title)
call add(lines, " " . item.data.url)
let lines += [""] + map(split(item.data.selftext, "\n"), "' '.v:val") + [""]
endfor
call setline(1, lines)
match Title /^\* .*/
endfunction
command! Reddit call s:reddit()
@mattn
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.