Skip to content

Instantly share code, notes, and snippets.

@garrytan
Created December 17, 2009 23:41
Show Gist options
  • Select an option

  • Save garrytan/259134 to your computer and use it in GitHub Desktop.

Select an option

Save garrytan/259134 to your computer and use it in GitHub Desktop.
if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end
if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end if !use_javascript
body = body.gsub(/<script src="(http:\/\/gist.github.com\/.+?).js"><\/script>/i) do
github_url = $1
begin
SystemTimer.timeout(5) do
(Hpricot.new(open(github_url).read) % 'div.data').to_html
end
rescue Timeout::Error => detail
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
rescue => e
logger.debug(e)
%Q[<p><a href="#{github_url}">github_url</a></p>]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment