add pixiv id search
This commit is contained in:
@@ -2,5 +2,14 @@
|
||||
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
|
||||
|
||||
kv = KeyValue.find_or_create_by_key("ApiCacheGenerator.generate_tag_cache")
|
||||
kv.update_attribute(:value, "0")
|
||||
1.upto(2) do |i|
|
||||
Post.where("source like ?", "http://i#{i}.pixiv.net%").find_each do |post|
|
||||
post.parse_pixiv_id
|
||||
post.update_column(:pixiv_id, post.pixiv_id) if post.pixiv_id.present?
|
||||
end
|
||||
end
|
||||
|
||||
Post.where("source like ?", "http://www.pixiv.net%").find_each do |post|
|
||||
post.parse_pixiv_id
|
||||
post.update_column(:pixiv_id, post.pixiv_id) if post.pixiv_id.present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user