class SoapboxApi::UsersPosts
Attributes
token[R]
Public Class Methods
new(token)
click to toggle source
# File lib/soapbox_api.rb, line 10 def initialize(token) @token = token end
Public Instance Methods
fetch_posts()
click to toggle source
# File lib/soapbox_api.rb, line 14 def fetch_posts result = JSON.parse(Nokogiri::HTML(open('http://localhost:3000/api/fetch_posts.json?consumer_key=' + token[:consumer_key] + '&consumer_secret=' + token[:consumer_secret]))) raise "401: Not authorized" if (result.empty?) result end