Skip to content

Instantly share code, notes, and snippets.

View farleyknight's full-sized avatar
🎯
Focusing

Farley Knight farleyknight

🎯
Focusing
View GitHub Profile
require 'tempfile'
class Firefox
def self.debug(page)
if page.is_a? File
page = page.read
elsif page.respond_to?(:body) and page.body.is_a? String
page = page.body
end
require 'mechanize'
module MathUrl
def mathurl_agent
@agent ||= WWW::Mechanize.new
end
def mathurl_img_for(latex)
page = math_url_agent.get("http://mathurl.com")
form = page.forms.first