Class: Quotefm::Article

Inherits:
Object show all
Defined in:
lib/quotefm/article.rb

Class Method Summary collapse

Class Method Details

.getByID(id) ⇒ Object



4
5
6
# File 'lib/quotefm/article.rb', line 4

def self.getByID id
  res = HTTParty.get("https://quote.fm/api/article/get/?id="+id.to_s)
end

.getByURL(url) ⇒ Object



8
9
10
# File 'lib/quotefm/article.rb', line 8

def self.getByURL url
  res = HTTParty.get("https://quote.fm/api/article/get/?url="+url)
end

.listByCategories(ids, options = {}) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/quotefm/article.rb', line 18

def self.listByCategories ids, options={}
  options = options.merge({:ids => ids})
  url = "https://quote.fm/api/article/listByCategories/?"+options.to_param

  puts url

  res = HTTParty.get(url)
end

.listByPage(id, options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/quotefm/article.rb', line 12

def self.listByPage id, options={}
  options = options.merge({:id => id})
  url = "https://quote.fm/api/article/listByPage/?"+options.to_param
  res = HTTParty.get(url)
end