Coverage Status

Circle CI

Url2Event

A ruby gem for getting metadata from event URLs.

Installation

Add this line to your application's Gemfile:

gem 'url_2_event'

And then execute:

$ bundle

Or install it yourself as:

$ gem install url_2_event

Usage

require 'url_2_event'

url = "http://www.meetup.com/BKtechmeetup/events/191161262/"
event = Url2Event.parse_event_from_uri(url)
ap event
# =>
{
          "title" => "BK Tech Meetup - Education",
       "begin_at" => 2014-07-30 12:00:00 -0700,
         "end_at" => 2014-07-30 15:00:00 -0700,
       "location" => "HUGE, Inc., 45 Main St.  Suite 220, Brooklyn",
    "description" => "Education! Let's all take our Smarties, meet up to talk about what's going on in Education and hear from two people who are leading major changes in the industry. We're going to be having two incredibly amazing speakers followed by $3 beers and a reserved hang out area at Superfine, just down the street from Huge, where we'll continue mingling. Speakers: Adam Enbar from The Flatiron School Learn to build awesome things with code.We're a school for passionate people who want to love what they do. Stephanie Dua from Homer Homer's mission is to be the world's leading provider of quality early learning experiences for children. We create innovative products that parents trust, children love, and communities unite around. \n\n\n\nHave a company that you would like to demo? Interested in sponsoring our events? Want to join the BK Tech team? Contact us at:  [masked] [masked] [masked]",
          "price" => "5 USD",
           "link" => "http://www.meetup.com/BKtechmeetup/events/191161262/"
}

# unsupported URL
url = "http://www.meetup.com/about"
begin
  event = Url2Event.parse_event_from_uri(url)
rescue Url2Event::UnsupportedSourceError
  puts "#{url} is not a supported URL"
end
# => http://www.example.com/page is not a supported URL

Contributing

Refer to CONTRIBUTING.md

Contributors

This project was originally built for Startup Digest by dcromer.