xaviershay / enki-vim

Publish to enki with VIM. That's pretty neat.

enki-vim / script / list_posts.rb
100644 17 lines (14 sloc) 0.377 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env ruby
[
  'enki_vim_config',
  'remote_enki_blog',
  'vim_buffer'
].each do |file|
  require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', file))
end
 
buffer = VimBuffer.new
buffer.clear!
 
blog = RemoteEnkiBlog.new(EnkiVimConfig[:url], EnkiVimConfig[:key])
blog.posts.each do |post|
  buffer.append([post['id'], post['title']].join(" - "))
end