Added marshalled snpedia-array, changed job to accomodate. Testing.

This commit is contained in:
Philipp
2011-10-29 14:08:06 +10:00
parent 87013d0a47
commit 92c7e009ee
3 changed files with 12 additions and 3 deletions

View File

@@ -9,6 +9,14 @@ class Snpedia
def self.perform(snp_id)
@snp = Snp.find(snp_id)
# get the marshalled array
File.open("#{Rails.root}/marshalled_snpedia_array", "r") do |file|
namearray = Marshal.load(file)
end
if !namearray.include?(@snp.name)
puts @snp.name + " not included in the array"
else
if @snp.snpedia_updated < 31.days.ago
mw = MediaWiki::Gateway.new("http://www.snpedia.com/api.php")
# return an array of page-titles
@@ -60,5 +68,6 @@ class Snpedia
else
print "snpedia: time threshold not met\n"
end
end
end
end

View File

@@ -130,9 +130,9 @@ ActiveRecord::Schema.define(:version => 20111028212506) do
t.string "allele_frequency"
t.integer "ranking"
t.integer "number_of_users", :default => 0
t.datetime "mendeley_updated", :default => '2011-08-24 03:44:32'
t.datetime "plos_updated", :default => '2011-08-24 03:44:32'
t.datetime "snpedia_updated", :default => '2011-08-24 03:44:32'
t.datetime "mendeley_updated", :default => '2011-08-27 16:54:19'
t.datetime "plos_updated", :default => '2011-08-27 16:54:19'
t.datetime "snpedia_updated", :default => '2011-08-27 16:54:19'
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"

BIN
marshalled_snpedia_array Normal file

Binary file not shown.