Skip to content

Instantly share code, notes, and snippets.

@jasonreposa
Created April 30, 2012 18:51

Revisions

  1. jasonreposa created this gist Apr 30, 2012.
    8 changes: 8 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    html = Nokogiri::HTML(the_content)
    ...
    html.xpath("//ul[@id='sharebar']").each(&:remove)
    html.xpath('//script').each(&:remove)
    html.xpath('//@onclick').each(&:remove)
    html.xpath('//@class').each(&:remove)
    html.xpath('//@style').each(&:remove)
    ...