diff --git a/README.md b/README.md index 9be643f..29bc41a 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,4 @@ Adding a scraper manually: 2. `Import.create(url: "https://api.morph.io/[scraper]/data.json?key=[api_key]&query=[sql]")` 3. `exit` -Now import everything via `bundle exec rake import_papers:from_morph`. +Now import everything via `bundle exec rake import_papers`. diff --git a/lib/tasks/import_papers.rake b/lib/tasks/import_papers.rake index 31abc45..28f77b0 100644 --- a/lib/tasks/import_papers.rake +++ b/lib/tasks/import_papers.rake @@ -1,10 +1,8 @@ -namespace :import_papers do - desc 'Import Paper records from CSV' - task :from_morph => :environment do - require 'open-uri' - Importer.all.each do |importer| - uri = URI.parse(importer.url) - Paper.import_from_json(uri.read) - end +desc 'Import Paper records from setup importers' +task import_papers: :environment do + require 'open-uri' + Importer.all.each do |importer| + uri = URI.parse(importer.url) + Paper.import_from_json(uri.read) end end