Skip to content

Commit

Permalink
rescued sending via socket, exception thrown by face recon...
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake McGinty committed Mar 9, 2012
1 parent 2f103b8 commit c7646af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/twitter-sentiment/output/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

module TwitterSentiment
module Output
include PurdyPrint #is this redundant?
include PurdyPrint
class Send
def initialize
pp :info, "Send module initialized successfully."
end

# Sends data to the music generator
# @param [Array] Data in pre-defined form (not in JSON)
# @return [nil]
Expand All @@ -21,6 +21,8 @@ def send_gen data = nil
streamSock = TCPSocket.new( "127.0.0.1", 9133 )
streamSock.write(payload)
streamSock.close
rescue Exception
pp :warn, "Failed to send payload across socket."
end
end #Send
end #Output
Expand Down
1 change: 1 addition & 0 deletions lib/twitter-sentiment/parser/face_recon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def smile_info info = ""
arr = []
info.each do |n|
n = n["attributes"]["smiling"]
next if n.nil?
arr << [n["value"],n["confidence"]]
end
arr
Expand Down

0 comments on commit c7646af

Please sign in to comment.