From feb2362a4949cb499b2217a1db06f3d4d950019c Mon Sep 17 00:00:00 2001 From: ghostrigger Date: Mon, 30 Jun 2014 23:03:53 +0800 Subject: [PATCH] #2213: limited support for diarypro doesn't support the following: * those with customized subdirectories * those that replaced the default diary.cgi with other page * those that moved to other domains * deleted or reset entry numbers * domains that switched to other blog service provider --- app/models/post.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/post.rb b/app/models/post.rb index 873d7f8fc..270176551 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -360,6 +360,11 @@ class Post < ActiveRecord::Base imgly_id = imgly_id.gsub(/[^0-9]/, '') base_62 = imgly_id.to_i.encode62 "http://img.ly/#{base_62}" + + when %r{(\Ahttp://.+)/diarypro/d(?:ata/upfile/|iary\.cgi\?mode=image&upfile=)(\d+)}i + base_url = $1 + entry_no = $2 + "#{base_url}/diarypro/diary.cgi?no=#{entry_no}" else source