20
Natalie Arellano Vanessa Dean Tuesday, July 8 Flatiron School Presents FOMO No Mo’

FOMO No Mo

Embed Size (px)

DESCRIPTION

Presented by Vanessa Dean and Natalie Arellano on July 8, 2014 at The Flatiron School.

Citation preview

Page 1: FOMO No Mo

Natalie ArellanoVanessa Dean

Tuesday, July 8

Flatiron School Presents

FOMO No Mo’

Page 2: FOMO No Mo

FOMO

Page 3: FOMO No Mo
Page 4: FOMO No Mo
Page 5: FOMO No Mo

Other Events Happening Tonight

(you made the right choice)

Page 6: FOMO No Mo
Page 7: FOMO No Mo
Page 8: FOMO No Mo
Page 9: FOMO No Mo
Page 10: FOMO No Mo

API Requests

Request URL for members from Flatiron Presents

https://api.meetup.com/2/members?group_id=14306982&key=1afad6758asdfb3q4f

Request URL for events that the member’s groups are hosting in the next week

https://api.meetup.com/2/events?&sign=true&photo-host=public&member_id=9053050&time=1404858600000,%201405463400000

&page=20&key=1afad6758asdfb3q4f

Page 11: FOMO No Mo

Net::HTTP.get(“https://api.meetup.com/2/events?&sign=true&photo-host=public&member_id=9053050& time=1404858600000,%201405463400000&key=1afad6758asdfb3q4f")

YIKES!

Page 12: FOMO No Mo

JSON.parse(Net::HTTP.get(events_request_uri))

Ruby

FTW!

Page 13: FOMO No Mo

Data Structure

Page 14: FOMO No Mo

railroady -M | dot -Tpng > models.png

Schema

Page 15: FOMO No Mo

InitializationMember.all.sample(3).each do |member| my_hash["results"].each do |result|

# create the event if not exists event = Event.find_or_create_by(:name => result["name"], :date => result["time"], :url => result["event_url"])

# create the group if not exists, and assign it to the event event.group = Group.find_or_create_by(:name => result["group"]["name"], :urlname => result["group"]["urlname"])

# assign the group color -- assign color is defined on Group event.group.assign_color

# add the current member to the group if not already a member event.group.members << member unless event.group.members.include?(member)

# add the event date based on the time in milliseconds given by Meetup event.assign_date(Time.at(event.date.to_i/1000).to_date) endend

def assign_date(new_date) my_date = EventDate.find_or_create_by(event_date: new_date) self.event_date = my_dateend

Page 17: FOMO No Mo

Lessons Learned

• APIs can be demystified

• Objects make things easier

• Value of collaboration

Page 18: FOMO No Mo

Next Steps We Could Take

• Add ability to choose the seed group (instead of always sampling from Flatiron Presents members)

• Let user sign in with their Meetup account and choose groups they are a part of

• Add filters, e.g. narrow search results by location, pizza == true

Page 19: FOMO No Mo

Questions?