Created
March 18, 2017 01:46
-
-
Save bnymn/40597662642a37c21ffb9f992f7f6552 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetch(file_name, url) | |
value = %x( wget --user-agent="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" "#{url}" -O #{file_name} ) | |
file = nil | |
if value | |
file = open(file_name) | |
end | |
file | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment