Skip to content

Instantly share code, notes, and snippets.

View wethu's full-sized avatar

Ellis wethu

  • Ellis Gray
  • Gold Coast
View GitHub Profile
@wethu
wethu / liquid_shell.rb
Created August 1, 2016 02:56 — forked from trishume/liquid_shell.rb
Liquid Templating Language REPL
require 'liquid'
require 'readline'
require 'colorize'
$state = {'test' => 5, 'wat' => "yup"}
def eval_liquid(str)
temp = Liquid::Template.parse(str)
temp.render($state)
end
response = JSON.parse(Net::HTTP.get(URI.parse('https://api.instagram.com/v1/tags/myTag/media/recent?client_id=myClinetID')))
img = response["data"][0]["images"]["low_resolution"]["url"]
caption = response["data"][0]["caption"]["text"]
if Image.where(:url = img).blank?
saveImage = Image.create(:url => img, :text => caption)
end
When I run this, I get:
@wethu
wethu / Property.rb
Last active August 29, 2015 13:55 — forked from anonymous/Property.rb
class Property < ActiveRecord::Base
belongs_to :detail
end