mirror of
https://github.com/chenasraf/snpr.git
synced 2026-05-18 01:39:01 +00:00
Added marshalled snpedia-array, changed job to accomodate. Testing.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
BIN
marshalled_snpedia_array
Normal file
Binary file not shown.
Reference in New Issue
Block a user