class SycLink::InternetExplorer

Importer for Internet Explorer

Importer for Internet Explorer

Public Instance Methods

read() click to toggle source

Reads the links from the Internet Explorer's bookmarks directory

# File lib/syclink/internet_explorer.rb, line 10
def read
  files = Dir.glob(File.join(path, "**/*"))
  
  regex = Regexp.new("(?<=#{path}).*")

  files.map do |file|
    unless ((File.directory? file) || (File.extname(file).upcase != ".URL"))
      url = File.read(file).scan(/(?<=\nURL=)(.*)$/).flatten.first.chomp
      name = url_name(File.basename(file, ".*"))
      description = ""
      tag         = extract_tags(File.dirname(file).scan(regex))
      [url, name, description, tag]
    end
  end.compact
end