diff --git a/lib/remote_announcement.rb b/lib/remote_announcement.rb index 141dab58d..8864c2172 100644 --- a/lib/remote_announcement.rb +++ b/lib/remote_announcement.rb @@ -3,7 +3,7 @@ require 'open-uri' require 'json' require 'date' -@db = Mongo::Connection.new("localhost", 27017).db("fgu_orbit") +@db = Mongo::Connection.new("localhost", 27017).db("test_site") @coll_bulletin = @db["bulletins"] @coll_cat = @db["bulletin_categories"] @@ -23,6 +23,7 @@ def get_remote_bulletins_json(url) lang = b[1]=='zh-tw' ? "zh_tw".to_sym : "en".to_sym next if b[2]=="" + next if @categories["#{b[7]}"].nil? bulletin = { _type: "Bulletin", postdate: Time.parse(b[8]),