github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

benschwarz / smoke

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 47
    • 4
  • Source
  • Commits
  • Network (4)
  • Issues (0)
  • Downloads (33)
  • Wiki (3)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (33)
    • v0.5.19
    • v0.5.17
    • v0.5.16
    • v0.5.15
    • v0.5.13
    • v0.5.12
    • v0.5.11
    • v0.5.10
    • v0.5.9
    • v0.5.8
    • v0.5.7
    • v0.5.6
    • v0.5.5
    • v0.5.4
    • v0.5.3
    • v0.5.2
    • v0.5.0
    • v0.4.2
    • v0.4.1
    • v0.4.0
    • v0.3.11
    • v0.3.10
    • v0.3.9
    • v0.3.7
    • v0.3.6
    • v0.3.5
    • v0.3.4
    • v0.2.4
    • v0.2.3
    • v0.2.2
    • v0.2.1
    • v0.1.1
    • v0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

It isn't ready yet — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added CHANGES and updated gemspec 
benschwarz (author)
Tue Feb 09 13:45:22 -0800 2010
commit  29e89978efa29b266a2bbd57703b3b84c5edd2af
tree    64c9f4badb15440ddc5c6107517103ec31c66ade
parent  b1f6b02a4c28fd7c5d6936389360fe7798e9c9f9
smoke /
name age
history
message
file .gitignore Fri Dec 11 23:36:19 -0800 2009 Ignoring any gem files [benschwarz]
file CHANGES Tue Feb 09 13:45:22 -0800 2010 Added CHANGES and updated gemspec [benschwarz]
file LICENSE Mon Mar 23 01:35:10 -0700 2009 Initial commit to smoke. [benschwarz]
file README.markdown Tue Feb 09 13:45:22 -0800 2010 Added CHANGES and updated gemspec [benschwarz]
file Rakefile Sun Feb 07 21:06:44 -0800 2010 added source for csv files and simple rspec tes... [Luke Cunningham]
file VERSION.yml Tue Feb 09 13:37:16 -0800 2010 Version bump to 0.5.20 [benschwarz]
directory examples/ Thu Aug 13 06:31:59 -0700 2009 Added cache to examples [benschwarz]
directory lib/ Tue Feb 09 13:37:41 -0800 2010 Moved faster csv require to be autoloaded by Sm... [benschwarz]
file smoke.gemspec Tue Feb 09 13:45:22 -0800 2010 Added CHANGES and updated gemspec [benschwarz]
directory spec/ Tue Feb 09 13:35:06 -0800 2010 Merge branch 'master' of github.com:benschwarz/... [benschwarz]
README.markdown

smoke

smoke is a Ruby based DSL that allows you to query web services such as YQL, RSS / Atom and JSON or XML in an elegant manner.

These "services" can then be re-represented, sorted and filtered. Data can be collected from multiple sources, sorted via a common property, chopped up and refried.

Then you can output as a plain ruby object or one of your other favourites (JSON, YAML, XML)

Examples of use

  • The examples directory has something to get you running straight away
  • I powered my entire site using smoke, until further documentation exists, this is probably a good place to start.
  • Read further details in the rdoc documentation or the wiki

Media

  • Presentation from Webjam11 in Perth
  • Presentation from Melbourne #roro
  • Early screencast to get developer / peer feedback

Install

gem install smoke

The concept

The concept comes from using Yahoo Pipes to make web based 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 released.

Using with web services

Smoke has its own special rack based library to expose your sources web services. Checkout rack-smoke for more details

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

TODO (working on, just mental notes)

  • Items returned from smoke to be Hashie "rich" objects
  • Output as a web feed (atom, rss)
    • How to push through values like "author"?
    • Passing modified time headers through to the atom formatter

For wiki pages (docs, later)

  • Document all sources with their irrespective differential methods
  • 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) 2010 Ben Schwarz. See LICENSE for details.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server