Method: Fourchan::Kit::API.get_page

Defined in:
lib/fourchan/kit/api.rb

.get_page(board, page) ⇒ Array

Returns the threads at a page number on specified board.

4chan stopped using zero-index pages in April. Instead of first page is at 0, it is now at 1. 0 returns nothing.

Parameters:

  • board (String)

    the board.

  • page (Integer)

    the thread number.

Returns:

  • (Array)

    all threads from a page.



57
58
59
# File 'lib/fourchan/kit/api.rb', line 57

def self.get_page(board, page)
  JSON.parse(open("http://a.4cdn.org/#{board}/#{page}.json").read)['threads']
end