Skip to content

Commit

Permalink
Avoid global usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fbacall committed Jan 15, 2025
1 parent 3b72d3f commit 2101473
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/tasks/topics.rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
namespace :tess do

$api_key = Rails.application.config.secrets.bioportal_api_key


desc 'Query BioPortal for scientific topics'
task get_topics: :environment do
outfile = File.open('scientific_topics.csv', 'w')
Expand Down Expand Up @@ -36,7 +32,8 @@ namespace :tess do
}
clean_desc = desc.encode(Encoding.find('ASCII'), encoding_options).gsub(/[\n#]/,'')

url = "http://data.bioontology.org/annotator?include=prefLabel&text=#{clean_desc}&ontologies=EDAM&longest_only=false&exclude_numbers=false&whole_word_only=true&exclude_synonyms=false&apikey=#{$api_key}"
api_key = Rails.application.config.secrets.bioportal_api_key
url = "http://data.bioontology.org/annotator?include=prefLabel&text=#{clean_desc}&ontologies=EDAM&longest_only=false&exclude_numbers=false&whole_word_only=true&exclude_synonyms=false&apikey=#{api_key}"

annotations = []

Expand Down

0 comments on commit 2101473

Please sign in to comment.