benschwarz / smoke

It isn't ready yet

This URL has Read+Write access

Ben Schwarz (author)
Thu Aug 13 06:34:53 -0700 2009
commit  e6067bd329be4d74c86ffac0a356af722bfc72d5
tree    11ab4eac588273a5c33c6643986e31561c8e0177
parent  78e3121dafe7e49023875e8b6a6697dcc7edde6f
smoke /
name age message
file .gitignore Sat Apr 25 03:12:18 -0700 2009 Updated .gitignore and added documentation to t... [Ben Schwarz]
file LICENSE Mon Mar 23 01:35:10 -0700 2009 Initial commit to smoke. [Ben Schwarz]
file README.markdown Loading commit data...
file Rakefile
file VERSION.yml
file dependencies
directory examples/ Thu Aug 13 06:31:59 -0700 2009 Added cache to examples [Ben Schwarz]
directory lib/
directory rdoc/ Sun Jun 14 07:03:33 -0700 2009 Update rip dependencies, corrected missing json... [Ben Schwarz]
file smoke.gemspec
directory spec/
directory vendor/
README.markdown

smoke

smoke is a Ruby based DSL that allows you to take data from YQL, RSS / Atom (and more, if you think of a useful source). This "data" can then be re-represented, sorted and filtered. You can collect data from a multiude of sources, sort them on a common property and return a plain old ruby object or json (You could add in something to output XML too)

Examples of use

I powered my entire site using smoke, until further documentation exists, this is probably a good place to start.

Media

The concept

The concept comes from using Yahoo Pipes to make little mash ups, get a list of tv shows for my torrent client, compile a recipe book or make tools to give me a list of albums that artists in my music library are about to be release.

How or what to contribute

  • Test everything you do
  • Add a way to output (XML, anyone?)
  • Examples of queries you'd like to be able to do (email / github message them to me)

API Examples

YQL

# This will use yahoo search to get an array of search results about Ruby
Smoke.yql(:ruby) do
  select  :all
  from    "search.web"
  where   :query, "ruby"

  discard :title, /tuesday/i
end

Smoke.yql(:python) do
  select  :all
  from    "search.web"
  where   :query, "python"
end

Join sources and use them together

Smoke.join(:ruby, :python)

or even

Smoke.join(:python, :ruby) do
  emit do
    sort :title
    rename :shit_name => :title
  end
end

Define a source allowing for variables to be injected later

Source definition:

Smoke.feed :delicious do
  prepare do
    url "http://feeds.delicious.com/v2/rss/#{username}?count=15"
  end
end

Execution:

Smoke[:delicious].username("bschwarz").output

CI

Integrity is running for smoke

TODO (working on, just mental notes)

Later / maybe

  • YQL w/oAuth
  • YQL Subqueries?
  • Implement basic auth for sources

For wiki pages (docs, later)

  • How to use path
  • YQL Definitions
  • Tranformations
  • Insert
  • Joining
  • Variable injection
  • Sort, Reverse
  • Keep, Discard
  • Truncate
  • Manually setting the content type for a url

Copyright

Copyright (c) 2009 Ben Schwarz. See LICENSE for details.