Commit 4a1ef882 authored by Bobby Burden III's avatar Bobby Burden III

Merge branch 'master' into 'master'

Lint

See merge request !1
parents ccffa9db f8dc3b58
#!/usr/bin/ruby
GALLERY = 'https://stallman.org/photos/rms-working/'
GALLERY = 'https://stallman.org/photos/rms-working/'.freeze
require 'open-uri'
......@@ -8,9 +8,9 @@ require 'open-uri'
def find_links(file)
contents = file.read
lines = contents.split("\n")
links = Array.new
links = []
lines.each do |line|
links.push(line.match(/\"(.*?)\"/).to_s.gsub(/\"/, '')) if line =~ /<a/
links.push(line.match(/\"(.*?)\"/).to_s.delete('"')) if line =~ /<a/
end
links
end
......@@ -37,7 +37,7 @@ all_links = find_links(random_image_page)
image_links = all_links.delete_if { |x| x =~ /\.html/ }
link = GALLERY + image_links.first
link.slice!("../")
link.slice!('../')
system('echo "' + link + '" | xclip -i -selection clipboard')
puts link
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment