-
-
Save deependersingla/fa00dfd197e5269d362f 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
class ScreenerStock | |
# `screener_id` is usually the scrip_id for BSE. | |
# If the scrip is not listed on BSE it might be the NSE id. | |
def initialize(screener_id) | |
@id = screener_id | |
end | |
def url | |
"http://www.screener.in/company/?q=#{@id}" | |
end | |
def fetch | |
cached_callback("screener_stock", "#{@id}") { | |
puts "Screener stock: #{@id}" | |
http = Curl.get(url) { |http| | |
http.headers['Cookie'] = FinLib.screener_cookie | |
} and http.body_str | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment