Sha256: 70d509f0268f637d585ac394a0bf989e742be7754872faaca0ad0b9e54f9dea4
Contents?: true
Size: 388 Bytes
Versions: 14
Compression:
Stored size: 388 Bytes
Contents
require 'murlsh' module Murlsh # Set the title of imgur images. class AddPre60Imgur < Plugin @hook = 'add_pre' ImgurRe = %r{^http://(?:i\.)?imgur\.com/([a-z\d]+)(\.(?:jpe?g|gif|png))$}i def self.run(url, config) if not url.user_supplied_title? and match = ImgurRe.match(url.url) url.title = "imgur/#{match[1]}s#{match[2]}" end end end end
Version data entries
14 entries across 14 versions & 1 rubygems