Skip to content

Instantly share code, notes, and snippets.

@mizoR
Created July 27, 2013 01:10
Show Gist options
  • Save mizoR/6093238 to your computer and use it in GitHub Desktop.
Save mizoR/6093238 to your computer and use it in GitHub Desktop.
mizoR/macaroni と sferik/twitter を組み合わせて、Twitter の検索結果を取得する
# -*- coding: utf-8-*-
# exec: macaroni --recipe path/to/macaroni_with_twitter.rb --target tweet_search
# gem dependency: `mizoR/macaroni`, `sferik/twitter`
require 'twitter'
include Macaroni::Plugin
pipe :tweet_search, :data => Twitter do
plug Filter::Configure do |config|
config.consumer_key = 'XXXXXXXXXX'
config.consumer_secret = 'YYYYYYYYYY'
end
plug Filter::Search, 'to:justinbieber marry me', :count => 3, :result_type => 'recent'
plug Filter::Collection
plug Filter::Map do |tweet|
tweet.text
end
plug Output::Stdout
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment