Skip to content

Instantly share code, notes, and snippets.

View hayesdavis's full-sized avatar

Hayes Davis hayesdavis

View GitHub Profile
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?
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]
#
#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
#!/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.
#