May the Yelps be with You

May brings us talks from the Python meetup, another mind-blowing talk from Designers + Geeks, and a talk from Products That Count on brand naming. I’m also excited to give you a sneak peak into June: we’re hosting our second annual WWDC after party. We promise this after party will be so good, you won’t want to leave for the hotel lobby (even if R. Kelly himself invites you).

For our Pythonista readers, let’s take a deeper look into the the upcoming Python meetup. Packaging turns out to be an important part of any language. Great packaging encourages language adoption, focuses the community on 1-2 of the best solutions to a problem, and encourages modular design. But it’s also a surprisingly tricky problem: support for a variety of OS, interactions with compiled libraries, organization of namespaces, programmatic specification of dependencies, and discovery and documentation are just some of the problems that need to be tackled. We haven’t even covered the difference between installing packages “locally” vs system wide, and the implications for deploying a set of packages!

Luckily, next week Noah Kantrowitz is going to help us sort through these issues with two presentations covering Python packaging and deployments. In between the main talks, we’ll see lightning talks and get a chance to mingle and ask questions. Hope you can join us!

Mark your calendars now for next month’s WWDC: Yelp is opening our doors for an after party to top them all! Meet some of the cool cats who work on our award-winning iPhone app and get an inside look at Yelp life. There will be plenty of 5-star hors d’oeuvres and wine served from our own customized barrels! Please RSVP here and don’t forget to bring your conference badge.


More Yelp in your Ruby

Posted by Tomer E.

What’s that you say? Your Ruby applications are feeling a little empty and meaningless without Yelp data to make them shine? Well, consider your prayers answered because today we’re launching our official Ruby Gem for interfacing with the Yelp API!

Find the gem online now, and start using Yelp data in your Ruby applications with ease. Install the gem with bundle by adding ‘yelp’ to your Gemfile, or without a Gemfile by running gem install yelp.

Your first step on the road to Yelp data awesomeness is to register and get API keys from our developer site. Next, create a new client with your API keys and use that to make requests against the API.

client = Yelp::Client.new({ consumer_key: YOUR_CONSUMER_KEY,
                            consumer_secret: YOUR_CONSUMER_SECRET,
                            token: YOUR_TOKEN,
                            token_secret: YOUR_TOKEN_SECRET

Integrated into the gem is our Search API, which allows you to to find businesses based on the location provided and any search terms given:

results = client.search('San Francisco', { term: 'restaurants' })
results.businesses # => [<..., name = 'Gary Danko', …>, <..., name = 'Little Delhi', …>, …]

Additionally, the Business API allows for retrieval of more information on specific businesses using the business id returned from the search:

business = client.business('gary-danko-san-francisco')
business.name # => "Gary Danko"
business.rating # => 4.5
business.review_count # => 3701

Yelp + Rails
If you’re still fairly new to Ruby, want to work on a Rails app, and still want to use the gem then we’ve got a solution for you! We’ve created a small sample application to demo the gem and we’ve open sourced that as well.

All you need to do is create a file inside of config/initializers with a configuration block that sets your API keys:

inside config/initializers/yelp.rb
Yelp.client.configure do |config|
  config.consumer_key = YOUR_CONSUMER_KEY
  config.consumer_secret = YOUR_CONSUMER_SECRET
  config.token = YOUR_TOKEN
  config.token_secret = YOUR_TOKEN_SECRET

Here, we’re using a configuration block to tell Yelp what your API keys is. This will automatically create a client instance for you that lives inside of Yelp.client, allowing you to use your client instance over and over again in different places throughout your application.

Inside of your controller you can call Yelp.client with one of the API methods

inside app/controllers/home_controller.rb
class HomeController < ApplicationController
  # ...

  def search
    parameters = { term: params[:term], limit: 16 }
    render json: Yelp.client.search('San Francisco', parameters)

And that’s it! You’re now able to use the Yelp gem throughout your Rails application. Using the gem should work similarly in other Ruby applications.

Head over to GitHub to check out the source code for the gem and the example app, and find more information on how to use the gem with the readme and documentation

We can’t wait to see what you create. Learn more about the Yelp API at yelp.com/developers and make sure to share your apps with us!

Please remember to read and follow the Terms of Use and display requirements before creating your applications.

If you want to work with our API team (and why wouldn’t you?!), check out yelp.com/careers for available positions.


April Showers Bring More Talks to Yelp

Yelp is hosting many exciting talks this month! Let’s take a closer look at two, but be sure to check out all of the links below to see what’s in the pipeline.

What does it take to monitor an architecture that is continually in flux and being changed by hundreds of developers? A seriously flexible monitoring framework: Sensu! A resident Yelp Site Reliability Engineer, Kyle Anderson, will be giving a tour of how Sensu works at Yelp. He’ll be explaining how Sensu hooks into the Yelp SOA architecture to empower individual development teams to monitor their own services in real time. He’ll also be discussing the difficulty of monitoring servers in AWS, and how Sensu can be used to track them.

Yelp hosts this talk, put on by San Francisco Dev Ops, tomorrow April 8th!

Next up is a talk about RxJava. Functional reactive programming is an interesting, relatively new paradigm that models application state as a set of dependencies updated via a stream of data. As a concrete example, one option of building a UI that depends on mouse clicks is to write a callback function. When the mouse is clicked, the function is called to do some processing and optionally update the UI. However, callbacks can quickly get complicated, especially when they involve multiple threads that may interact with each other.

The reactive alternative treats all mouse clicks as a iterable stream of events (Observable, in Rx jargon). An Observer can apply functional constructs -- such as filter, map, or zip -- to the stream of clicks and can in turn update other Observable objects. For examples involving real code, check out the blog post by Netflix.

Sound cool? Then come check out Greg Benson, a software engineer on the Android @ Netflix team, as he presents on incorporating reactive programming into your Android apps with RxJava. Sign up for this April 10th presentation at San Francisco Android Livecode!

  • Tuesday, April 8, 2014 - 6:00PM - Sensu @ Yelp: A Guided Tour (San Francisco Dev Ops)
  • Wednesday, April 9, 2014 - 6:00PM - Java 8 Lambda Expressions & Streams (Java User Group)
  • Thursday, April 10, 2014 - 7:00PM - Reactive Programming on Android Using RxJava with Greg Benson! (San Francisco Android Livecode)
  • Thursday, April 17, 2014 - 6:30PM - Working Hard, or Artily Twerking Kongsciousness (Designers + Geeks)
  • Tuesday, April 22, 2014 - 6:30PM - Women Who Code: Lightning Talks (Women Who Code)
  • Wednesday, April 23, 2014 - 6:45PM - Best Practices For Lean User Acquisition and Engagement (Products That Count)
  • Thursday, April 24, 2014 - Large-Scale Machine Learning with Apache Spark (SF Machine Learning)
  • Wednesday, April 30, 2014 - 6:15PM- Django 1.7 and You (Django Meetup Group)