Powering Actions with Elasticsearch Percolate

November 10, 2013 by Ben Ubois

Actions are built on a great feature of elasticsearch called percolate.

Percolate allows you to register queries ahead of time, then whenever you send a new document to be indexed, elasticsearch can tell you if this document matches any saved queries.

Here’s how it works.

Feedbin is a Rails app and uses the tire gem for working with elasticsearch.

Whenever an action is added or updated, it is also sent to elasticsearch as a percolator query.

Entry.index.register_percolator_query(3) do
  string "kittens"
end

The 3 is the id of this action. This is used later on to find what user this action belongs to and which actions should be performed.

A model called Entry is used for storing RSS articles. Whenever a new entry is added it also gets sent to elasticsearch for indexing.

class Entry < ActiveRecord::Base
  include Tire::Model::Search
  after_commit :search_index_store, on: :create

  private

  def search_index_store
    result = self.index.store(self, {percolate: true})
    ActionsPerform.perform_async(self.id, result['matches'])
  end

end

An array of matched actions ids is returned in result['matches']. So if this entry mentions “kittens” an array like ["3"] would be returned.

Feedbin uses Sidekiq to process background jobs. The ActionsPerform.perform_async part is creating a new background job that performs the actions. A simplified version of this looks like:

class ActionsPerform
  include Sidekiq::Worker

  def perform(entry_id, action_ids)
    actions = Action.where(id: action_ids)
    actions.each do |action|
      if action.actions.include?("send_push_notification")
        PushNotificationSend.perform_async(entry_id, user_ids)
      end
    end
  end

end

Get in touch if you have any questions about this or sign up to see it in action.

Discuss this on Hacker News.

Actions - Workflows for Your RSS Feeds

November 6, 2013 by Ben Ubois

Actions are a great way to filter out articles you’re not interested in or surface articles you want to be sure to read.

Because this is based on search you can use some powerful operations. For example if you’re not much of a baseball fan, but still want to see news about your favorite team you could set up an action to mark anything as read that matches baseball NOT yankees, which would mark anything as read that matches baseball but keep baseball AND yankees unread.

If you’re using Safari on OS X Mavericks there is a push notification action. This is the new home for configuring push notifications because it makes the old location redundant. All push notifications that were previously set up have been migrated into actions.

If you have not tried Feedbin before, now is a great time to check it out. There’s a free 14 day free trial so it’s easier than ever to give it a try.

Discuss this on Hacker News.

Mavericks Push Notifications

October 24, 2013 by Ben Ubois

OS X Mavericks was released on Tuesday and it has a cool feature that allows websites to send push notifications to your Mac.

Feedbin can now take advantage of this by offering push notifications for new articles.

To set it up you will need to be using Safari 7 on Mavericks. Then visit the Feeds page under Settings and there will be an option to enable push notifications. Click that and choose to allow Feedbin to send push notification in the resulting pop-up.

Next you will need to select which feeds you want to enable push for in the Feed Settings list. It’s a per-feed setting because enabling this for all feeds would be overwhelming.

Clicking on a notification will open up the original article and mark the article as read in Feedbin.

Saved Searches

October 14, 2013 by Ben Ubois

Any search can now be saved for quick access later. To create a saved search, start by searching for something, hit save and give your search a title.

There’s a saved searches API, if you want to do something with the data other than view it in Feedbin.

Search Beta

October 10, 2013 by Ben Ubois

I’m very happy to announce the availability of search for Feedbin.

I’m calling it a beta because there are still improvements to be made and bugs that have not been found, so I’d appreciate your feedback.

Search supports some great advanced options like AND, OR and NOT.

Have a lot of starred items? Try adding is:starred to your query to just search starred items. is:read/unread are also supported.

To search a specific feed, you can add AND feed_id:XX.

Results are is sorted by relavance by default, but you can optionally sort by date with sort:asc/desc.

Under the hood Feedbin is using elasticsearch to power all of this.

Due to the new field, subscribe has been moved and can be accessed by clicking on the dropdown next to search.

Pair With Me

September 26, 2013 by Ben Ubois

I read Frank Chimero’s “The Inferno of Independence” yesterday. It’s a great article, and while I generally have poor reading comprehension, something resonated with me which is that “independence is lonely.”

I’ve been thinking that one thing I miss when working on Feedbin is the opportunity to work with others. Open sourcing Feedbin has helped make the work a bit more social, but I’m still left wanting more.

So I have an experiment I’d like to try.

Do you have an idea for a feature or a bug you would like to fix, but aren’t sure how to approach it or you would like to work on it with someone else? If so, why don’t we work on it together?

To set something up, just send me an email with what you’d like to work on and when you’re available.

The only thing I would ask is that you already have Feedbin running locally and have Screenhero and Skype installed.

Format Toolbar

September 3, 2013 by Ben Ubois

The format toolbar has some options for styling the look of articles. There’s a couple of nice font choices including Whitney and Sentinel both from Hoefler & Frere-Jones. You can also change the font size and make the text full width.

Todd is starting to Dribbble some Feedbin design stuff so go check out his page to see what’s in the works.

Feedbin is Open Source

August 27, 2013 by Ben Ubois

I spend a lot of time thinking about how to compete with free. I believe the answer is to change the meaning of the word, so starting today Feedbin is free as in freedom.

I think there are many great reasons to make Feedbin open source, but my main reasons are:

  • I want your help.
  • I like transparency and there’s nothing more transparent than being able to view source.
  • It makes it so Feedbin cannot pull a Google Reader.

Tom Preston-Werner of GitHub wrote a great article outlining some of the pros of open sourcing software and I’m hoping to reap those benefits as well.

Mostly I’m just excited to see what happens. It should be a cool experiment.

I wanted to thank Karl Fogel for his help making this happen. He literally wrote a book on producing open source software and is in the process of revising it so it was great to have him as an advisor. Also thanks to Alex Kessinger and Samuel Clay for their encouragement and help.

Discuss this on Hacker News.

Graphing Feedbin

August 14, 2013 by Ben Ubois

Feedbin uses Librato Metrics for graphing. It even works well for monitoring systems. For example this shell script generates a set of graphs for one of the web servers like:

For monitoring various other services, Feedbin uses a ruby script that gets run once per minute using Sidekiq.

This produces some great metrics about Redis, Postgres and Memcached: