Skip to content

Instantly share code, notes, and snippets.

@deependersingla
Created February 28, 2014 15:03
Show Gist options
  • Save deependersingla/fa00dfd197e5269d362f to your computer and use it in GitHub Desktop.
Save deependersingla/fa00dfd197e5269d362f to your computer and use it in GitHub Desktop.
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