fix for artist search

This commit is contained in:
albert
2013-02-19 21:41:35 -05:00
parent 3baebcbb41
commit 7f11fb4583
3 changed files with 3 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ module Sources
@agent ||= begin
mech = Mechanize.new
mech.get("http://seiga.nicovideo.jp/login/redirect?next_url=") do |page|
mech.get("https://secure.nicovideo.jp/secure/login_form") do |page|
page.form_with do |form|
form["mail"] = Danbooru.config.nico_seiga_login
form["password"] = Danbooru.config.nico_seiga_password

View File

@@ -230,7 +230,7 @@ class Artist < ActiveRecord::Base
q = active
return q if params.blank?
case params[:name].present?
case params[:name]
when /^http/
q = q.url_matches(params[:name])

View File

@@ -6,6 +6,7 @@ module Sources
class NicoSeigaTest < ActiveSupport::TestCase
context "The source site for nico seiga" do
setup do
# Sources::Strategies::NicoSeiga.new("http://lohas.nicoseiga.jp/priv/2853566?e=1361296671&h=794b3686b02edfd64c22ed2f99a4c55650371854")
@site = Sources::Site.new("http://seiga.nicovideo.jp/seiga/im1464351?track=ranking")
@site.get
end