Created
August 4, 2013 23:18
-
-
Save chrisallick/6152454 to your computer and use it in GitHub Desktop.
This application will figure out your host ip and copy to clip board. It also uses the gotonow application so you can easily open it on mobile safari as described by: http://clubsexytime.com/projects/gotonow/
This file contains 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
#!/usr/bin/env ruby | |
require 'socket' | |
require 'net/http' | |
myip = Socket::getaddrinfo(Socket.gethostname,"echo",Socket::AF_INET)[0][3] | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } | |
str | |
end | |
pbcopy( "http://#{myip}:8000" ) | |
#http://gotonow.herokuapp.com/url | |
uri = URI('http://gotonow.herokuapp.com/url') | |
res = Net::HTTP.post_form(uri, 'url' => "http://#{myip}:8000", 'max' => '50') | |
puts res.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment