Class: QiitaExport::Fetcher::UserFetcher
- Inherits:
-
ApiFetcher
- Object
- Base
- ApiFetcher
- QiitaExport::Fetcher::UserFetcher
- Defined in:
- lib/qiita-export/fetcher/user_fetcher.rb
Constant Summary collapse
- PER_PAGE =
100
Constants inherited from ApiFetcher
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from QiitaExport::Fetcher::Base
Instance Method Details
#find_articles ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/qiita-export/fetcher/user_fetcher.rb', line 10 def find_articles articles = [] page = 1 while true user_articles = find_user_articles(page) break if user_articles.empty? user_articles.each do |user_article| articles << to_article(user_article) end page += 1 sleep(0.3) end articles.sort { |a, b| a.created_at <=> b.created_at } end |