Project

General

Profile

バグ #624 » openimg-20131104.diff

hycon miyagi, 2013-11-04 00:33

View differences:

core/plugin/openimg/openimg.rb
86 86

  
87 87
  def get_tag_by_attributes(tag)
88 88
    attribute = {}
89
    tag.each_matches(/([a-zA-Z0-9]+?)=(['"])(.*?)\2/){ |pair, pos|
89
    tag.each_matches(/([^\s=]+)=(['"])(.*?)\2/){ |pair, pos|
90 90
      key, val = pair[1], pair[3]
91 91
      attribute[key] = val }
92 92
    attribute.freeze end
......
208 208
    t = fetch(url)
209 209
    /^(http:\/\/[^\/]+\/)post(\/\d+)/ =~ t
210 210
    if $~
211
      imgurlresolver($1 + "image" + $2, 'id' => 'content-image')
211
      imgurlresolver($1 + "image" + $2, {'tag' => 'img', 'id' => 'content-image', 'attribute' => 'data-src'})
212 212
    else
213 213
      warn "たんぶらの記事ページじゃないっぽい"
214 214
      nil
core/plugin/openimg/pattern_file.json
92 92
		}
93 93
	},
94 94
	"jigokuno.com": {
95
		"url": "^http://jigokuno\\.com/\\?eid=\\d+$",
95
		"url": "^http://jigokuno\\.com/\\?eid=\\d+",
96 96
		"attribute": {
97 97
			"src": {
98 98
				"json_class": "Regexp",
......
104 104
	"Tumblr image": {
105 105
		"url": "^http://[-0-9a-z]+\\.tumblr\\.com/image/\\d+",
106 106
		"attribute": {
107
			"id": "content-image"
107
			"id": "content-image",
108
			"attribute": "data-src",
109
			"tag": "img"
108 110
		}
109 111
	},
110 112
	"はてなフォトライフ": {
(3-3/3)