Skip to content

Commit 426d699

Browse files
authored
Merge pull request #17 from enpitut2019/add/more-papers
Add/more papers
2 parents 0148d6f + a0deefc commit 426d699

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/controllers/search_controller.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ class SearchController < ApplicationController
66
def get_xml
77
# 検索ワードのエスケープ処理
88
search_word = URI.encode_www_form_component(params['search_word'])
9-
9+
page = params[:page].to_i || 0
10+
1011
# arXiv APIのエンドポイントURLを構築
11-
url = URI.parse("http://export.arxiv.org/api/query?search_query=abs:#{search_word}&start=0&max_results=30")
12+
url = URI.parse("http://export.arxiv.org/api/query?search_query=%28abs:%22#{search_word}%22+OR+au:%22#{search_word}%22%29&start=#{page*30}&max_results=30&sortBy=lastUpdatedDate&sortOrder=descending")
1213

1314
# arXiv APIを叩いてデータを取得する
1415
res = Net::HTTP.get_response(url) ## 生のレスポンス

0 commit comments

Comments
 (0)