lib/onebox/engine/twitter_status_onebox.rb in onebox-1.3.8 vs lib/onebox/engine/twitter_status_onebox.rb in onebox-1.3.9
- old
+ new
@@ -3,17 +3,10 @@
class TwitterStatusOnebox
include Engine
include LayoutSupport
include HTML
- matches do
- http
- maybe("www.")
- domain("twitter")
- tld("com")
- anything
- has("/status/")
- end
+ matches_regexp Regexp.new("^http(?:s)?://(?:www\\.)?(?:(?:\\w)+\\.)?(twitter)\\.com(?:/)?(?:.)*/status/")
private
def match
@match ||= @url.match(%r{twitter\.com/.+?/status/(?<id>\d+)})