Skip to content

Commit

Permalink
Merge pull request #20 from timlkelly/fetch
Browse files Browse the repository at this point in the history
listen service
  • Loading branch information
timlkelly authored Sep 8, 2016
2 parents 942df32 + 0d8898a commit 7f8f928
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/killmail_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ def parse_killmail(package)
end

def listen
1000.times do
km_json = JSON.parse(fetch_killmail.body)
if km_json['package'] && km_json['package']['killmail']
puts "killmailID: #{km_json['package']['killID']}"
parse_killmail(km_json)
else
puts "received #{km_json}... breaking"
break
end
km_json = JSON.parse(fetch_killmail.body)
if km_json['package'] && km_json['package']['killmail']
puts "killmailID: #{km_json['package']['killID']}"
parse_killmail(km_json)
listen
end
puts "finished"
end

def json_to_killmail(url_array = create_url_array)
Expand Down

0 comments on commit 7f8f928

Please sign in to comment.