This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'liquid' | |
require 'readline' | |
require 'colorize' | |
$state = {'test' => 5, 'wat' => "yup"} | |
def eval_liquid(str) | |
temp = Liquid::Template.parse(str) | |
temp.render($state) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Property < ActiveRecord::Base | |
belongs_to :detail | |
end |