Created
September 19, 2010 16:01
-
-
Save gmcintire/586862 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 'socket' # Sockets are in standard library | |
hostname = 'texas.aprs2.net' | |
#hostname = 'first.aprs.net' | |
port = 14580 | |
begin | |
s = TCPSocket.open(hostname, port) | |
rescue | |
puts "error: #{$!}" | |
else | |
s.print("user KC5VQD-RB pass -1 vers RubyAPRS 0.1 filter r/33.25/-96.5/200\n\n") | |
while line = s.gets # Read lines from the socket | |
puts line.chop # And print with platform line terminator | |
end | |
s.close # Close the socket when done | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment