This file contains hidden or 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
client = Grackle::Client.new(:api=>:v1) | |
term = 'foo' | |
page = with_retry{client.search?(:q=>term,:rpp=>100)} | |
has_results = !page.results.empty? | |
while(has_results) | |
# page.results has tweets in it | |
unless page.next_page.nil? | |
page = with_retry{client.search?(:q=>term, :rpp=>100, :page=>page.page+1, :max_id=>page.max_id)} | |
has_results = !page.results.empty? |
This file contains hidden or 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
require 'rubygems' | |
require 'grackle' | |
require 'redis' | |
# Shows the list of mutual followers between two Twitter users using Redis | |
# sets and set intersections. | |
# | |
# Usage: | |
# ruby mutual_followers screen_name1 screen_name2 [reset] | |
# |
This file contains hidden or 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
#These instructions are for <= 0.1.3. Newer versions of Grackle will have a more | |
#fully-baked way of handling the Twitter API versions. | |
require 'grackle' | |
#Option 1: Just setup the hosts on your Grackle instance | |
#This will only change the hosts for this instance | |
client = Grackle::Client.new | |
client.api_hosts[:v1] = 'api.twitter.com/1' | |
client.api = :v1 |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# This script performs an OAuth authorized POST with multipart encoding to | |
# http://twitter.com/account/update_profile_image.json | |
# | |
# This code is primarily taken from my Grackle library's implementation at | |
# http://github.com/hayesdavis/grackle | |
# | |
# RUNNING THIS WILL CHANGE AN ACCOUNT'S PROFILE IMAGE. BE CAREFUL. | |
# |
NewerOlder