Created
July 8, 2015 05:50
-
-
Save mfpiccolo/d75f593f9ffeb2f9da2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'ffi' | |
module Scrape | |
extend FFI::Library | |
ffi_lib './target/debug/libscrape.dylib' | |
attach_function :get_body, [:string], :string | |
end | |
body = Scrape.get_body("http://doc.rust-lang.org")[191..230] | |
puts body.strip == "<title>Rust Documentation</title>" ? "Gone Dun It!" : "Uhhhh????" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment