Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (19 sloc) 0.515 kB
require 'rubygems'
require 'httparty'
require 'json'
class Moby
def self.fetch
result = HTTParty.get(
'http://api.mobypicture.com/',
:query => {
:action => 'searchPosts',
:k => '2bejXK0oEnftvaYu',
:format => 'json',
:searchUsername => 'jkreeftmeijer',
:searchItemsPerPage => 1
}
)
url = JSON.parse(result)['results'].first['post']['media']['url_full']
%x(mkdir -p _site/images && curl -o _site/images/background.jpg #{url})
end
end
Jump to Line
Something went wrong with that request. Please try again.