Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Carpenter committed May 15, 2012
1 parent debe735 commit 27cfd36
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/tasks/scheduler.rake
Expand Up @@ -18,7 +18,12 @@ task :update_feed => :environment do
# end

if Thing.where('user_id IS NOT NULL').any?
@account_sid = 'AC0b322d7367604e7a852a1d59193738a2'
@auth_token = 'c32bcf082cb7cee728a99832858db23b'
@client = Twilio::REST::Client.new(@account_sid, @auth_token)
@account = @client.account
@thing = Thing.new

Thing.where('user_id IS NOT NULL').find_each do |thing|
snow_amounts = @thing.get_snow_amounts(LibXML::XML::Reader.string(Net::HTTP.get(URI('http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXMLclient.php?lat=' + thing.lat.to_s + '&lon=' + thing.lng.to_s + '&product=time-series&begin=' + DateTime.now.utc.new_offset(0).to_s + '&end=' + DateTime.now.utc.new_offset(0).to_s + '&snow=snow'))))
snow_amounts.each do |amount|
Expand Down

2 comments on commit 27cfd36

@sferik
Copy link

@sferik sferik commented on 27cfd36 May 26, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, probably best not to publish your auth token. 😱

@ahcarpenter
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha.

Please sign in to comment.