Created
November 24, 2013 09:25
-
-
Save HaiTo/7625154 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Run | |
## ローカルrequire | |
require 'yaml' | |
require 'twitter' | |
require '../OnLine/universal_search' | |
def initialize | |
@configure = YAML.load_file('configure.yaml') | |
@twitter_client = Twitter::REST::Client.new do |config| | |
config.consumer_key = @configure["iphone"]["consumer_key"] | |
config.consumer_secret = @configure["iphone"]["consumer_secret"] | |
config.access_token = @configure["iphone"]["access_key"] | |
config.access_token_secret = @configure["iphone"]["access_secret"] | |
end | |
class << @twitter_client | |
include Twitter::REST::API::Utils | |
def universal_search(q,options={}) | |
object_from_response(twitter::SearchResults, :get, "/1.1/search/universal.json", options.merge(:q => q)) | |
end | |
end | |
end | |
def universal_search | |
@twitter_client.universal_search("セックス -rf",:lang => "ja",:count=>100,:result_type=>"recent").results.map do |result| | |
p result | |
end | |
end | |
end | |
t = Run.new() | |
t.universal_search |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
うーん、動かない……