Sha256: 57722998462308f4ef2a8fc5b661d3b863bea41961b888f9762c8d843d1f1483
Contents?: true
Size: 778 Bytes
Versions: 2
Compression:
Stored size: 778 Bytes
Contents
# Get and filter links module AwesomeBot class << self def links_filter(list) list.reject { |x| x.length < 9 } .map do |x| x.gsub(',','%2c').gsub(/'.*/, '').gsub(/,.*/, '').gsub('/:', '/') end .map do |x| if x.include? ')]' x.gsub /\)\].*/, '' elsif (x.scan(')').count == 2) && (x.scan('(').count == 1) x.gsub(/\)\).*/, ')') elsif x.scan(')').count > 0 x.gsub(/\).*/, '') elsif x.include? '[' # adoc x.gsub(/\[.*/, '') elsif x[-1]=='.' x[0..-2] else x end end end def links_find(content) require 'uri' URI.extract(content, /http()s?/) end end # class end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
awesome_bot-1.8.3 | lib/awesome_bot/links.rb |
awesome_bot-1.8.2 | lib/awesome_bot/links.rb |