Skip to content

Commit

Permalink
use basic het/http to support hosted meetup icals
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacchansky committed Nov 17, 2014
1 parent f489a4a commit bf0c0f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gem 'datamapper'
gem 'dm-postgres-adapter'
gem 'pg'
gem 'icalendar'
gem 'http'

gem 'dotenv-rails', :groups => [:development, :test]

Expand Down
10 changes: 5 additions & 5 deletions scripts/harvest.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require 'icalendar'
require 'http'
require_relative '../app/app.rb'
require 'net/http'
require './app/app.rb'

sources = Source.all


def harvest_events(source)
puts "\nHarvesting Events from source: \"#{source.name}\" (#{source.url})..."
response = HTTP.get source.url
puts response
cals = Icalendar.parse response.body
uri = URI source.url
response = Net::HTTP.get uri
cals = Icalendar.parse response
puts "Found #{cals.count} calendar(s)..."

cals.each do |cal|
Expand Down

0 comments on commit bf0c0f3

Please sign in to comment.