fomo no mo
Post on 08-Sep-2014
89 Views
Preview:
DESCRIPTION
TRANSCRIPT
Natalie ArellanoVanessa Dean
Tuesday, July 8
Flatiron School Presents
FOMO No Mo’
FOMO
Other Events Happening Tonight
(you made the right choice)
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
Net::HTTP.get(“https://api.meetup.com/2/events?&sign=true&photo-host=public&member_id=9053050& time=1404858600000,%201405463400000&key=1afad6758asdfb3q4f")
YIKES!
JSON.parse(Net::HTTP.get(events_request_uri))
Ruby
FTW!
Data Structure
railroady -M | dot -Tpng > models.png
Schema
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
Lessons Learned
• APIs can be demystified
• Objects make things easier
• Value of collaboration
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
Questions?
Thanks!
We are:
Natalie Arellanonatalie.p.arellano@gmail.com
and
Vanessa Deanvanessa.dean@gmail.com
top related