class Trendious::Client
Public Class Methods
new()
click to toggle source
# File lib/trendious/client.rb, line 7 def initialize end
Public Instance Methods
posts_by_name(name, page = 0)
click to toggle source
# File lib/trendious/client.rb, line 22 def posts_by_name(name, page = 0) form_name = name.gsub!(' ', '%20') search({q: name, without_type: "user,tag", page: page}) end
search(hash = {})
click to toggle source
# File lib/trendious/client.rb, line 10 def search(hash = {}) query = {q: "marvel"}.merge!(hash) query = query.map {|k,v| "#{k}=#{v}" }.join("&") uri = URI("http://api.moviepilot.com/v3/search?#{query}") puts "Request URI: #{uri}" Trendious::Search.new Net::HTTP.get(uri) end