From dd2445e3e2c97f38b28a3f32ea902536b3897adf Mon Sep 17 00:00:00 2001 From: John Nunemaker Date: Thu, 2 Apr 2009 22:47:21 -0400 Subject: [PATCH] Removed all the old stuff. Rewrites are fun!!!!! --- Manifest | 68 -- README | 84 --- Rakefile | 42 -- bin/twitter | 14 - examples/blocks.rb | 15 - examples/direct_messages.rb | 29 - examples/favorites.rb | 20 - examples/friends_followers.rb | 25 - examples/friendships.rb | 13 - examples/identica_timeline.rb | 7 - examples/location.rb | 8 - examples/oauth.rb | 60 -- examples/posting.rb | 9 - examples/replies.rb | 27 - examples/search.rb | 18 - examples/sent_messages.rb | 27 - examples/timeline.rb | 34 - examples/twitter.rb | 27 - examples/verify_credentials.rb | 13 - lib/twitter.rb | 38 - lib/twitter/base.rb | 284 ------- lib/twitter/cli.rb | 334 --------- lib/twitter/cli/config.rb | 9 - lib/twitter/cli/helpers.rb | 109 --- .../20080722194500_create_accounts.rb | 13 - .../20080722194508_create_tweets.rb | 16 - ...20080722214605_add_account_id_to_tweets.rb | 9 - .../20080722214606_create_configurations.rb | 13 - lib/twitter/cli/models/account.rb | 33 - lib/twitter/cli/models/configuration.rb | 13 - lib/twitter/cli/models/tweet.rb | 20 - lib/twitter/direct_message.rb | 22 - lib/twitter/easy_class_maker.rb | 43 -- lib/twitter/oauth.rb | 32 - lib/twitter/rate_limit_status.rb | 19 - lib/twitter/search.rb | 101 --- lib/twitter/search_result.rb | 83 -- lib/twitter/search_result_info.rb | 82 -- lib/twitter/status.rb | 22 - lib/twitter/user.rb | 38 - lib/twitter/version.rb | 3 - spec/base_spec.rb | 139 ---- spec/cli/helper_spec.rb | 49 -- spec/direct_message_spec.rb | 35 - spec/fixtures/follower_ids.xml | 11 - spec/fixtures/followers.xml | 706 ------------------ spec/fixtures/friend_ids.xml | 12 - spec/fixtures/friends.xml | 609 --------------- spec/fixtures/friends_for.xml | 584 --------------- spec/fixtures/friends_lite.xml | 192 ----- spec/fixtures/friends_timeline.xml | 66 -- spec/fixtures/friendship_already_exists.xml | 5 - spec/fixtures/friendship_created.xml | 12 - spec/fixtures/public_timeline.xml | 148 ---- spec/fixtures/rate_limit_status.xml | 7 - spec/fixtures/search_result_info.yml | 147 ---- spec/fixtures/search_results.json | 1 - spec/fixtures/status.xml | 25 - spec/fixtures/user.xml | 38 - spec/fixtures/user_timeline.xml | 465 ------------ spec/search_spec.rb | 100 --- spec/spec.opts | 1 - spec/spec_helper.rb | 23 - spec/status_spec.rb | 40 - spec/user_spec.rb | 42 -- twitter.gemspec | 45 -- 66 files changed, 5378 deletions(-) delete mode 100644 Manifest delete mode 100644 README delete mode 100644 Rakefile delete mode 100755 bin/twitter delete mode 100644 examples/blocks.rb delete mode 100644 examples/direct_messages.rb delete mode 100644 examples/favorites.rb delete mode 100644 examples/friends_followers.rb delete mode 100644 examples/friendships.rb delete mode 100644 examples/identica_timeline.rb delete mode 100644 examples/location.rb delete mode 100644 examples/oauth.rb delete mode 100644 examples/posting.rb delete mode 100644 examples/replies.rb delete mode 100644 examples/search.rb delete mode 100644 examples/sent_messages.rb delete mode 100644 examples/timeline.rb delete mode 100644 examples/twitter.rb delete mode 100644 examples/verify_credentials.rb delete mode 100644 lib/twitter.rb delete mode 100644 lib/twitter/base.rb delete mode 100644 lib/twitter/cli.rb delete mode 100644 lib/twitter/cli/config.rb delete mode 100644 lib/twitter/cli/helpers.rb delete mode 100644 lib/twitter/cli/migrations/20080722194500_create_accounts.rb delete mode 100644 lib/twitter/cli/migrations/20080722194508_create_tweets.rb delete mode 100644 lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb delete mode 100644 lib/twitter/cli/migrations/20080722214606_create_configurations.rb delete mode 100644 lib/twitter/cli/models/account.rb delete mode 100644 lib/twitter/cli/models/configuration.rb delete mode 100644 lib/twitter/cli/models/tweet.rb delete mode 100644 lib/twitter/direct_message.rb delete mode 100644 lib/twitter/easy_class_maker.rb delete mode 100644 lib/twitter/oauth.rb delete mode 100644 lib/twitter/rate_limit_status.rb delete mode 100644 lib/twitter/search.rb delete mode 100644 lib/twitter/search_result.rb delete mode 100644 lib/twitter/search_result_info.rb delete mode 100644 lib/twitter/status.rb delete mode 100644 lib/twitter/user.rb delete mode 100644 lib/twitter/version.rb delete mode 100644 spec/base_spec.rb delete mode 100644 spec/cli/helper_spec.rb delete mode 100644 spec/direct_message_spec.rb delete mode 100644 spec/fixtures/follower_ids.xml delete mode 100644 spec/fixtures/followers.xml delete mode 100644 spec/fixtures/friend_ids.xml delete mode 100644 spec/fixtures/friends.xml delete mode 100644 spec/fixtures/friends_for.xml delete mode 100644 spec/fixtures/friends_lite.xml delete mode 100644 spec/fixtures/friends_timeline.xml delete mode 100644 spec/fixtures/friendship_already_exists.xml delete mode 100644 spec/fixtures/friendship_created.xml delete mode 100644 spec/fixtures/public_timeline.xml delete mode 100644 spec/fixtures/rate_limit_status.xml delete mode 100644 spec/fixtures/search_result_info.yml delete mode 100644 spec/fixtures/search_results.json delete mode 100644 spec/fixtures/status.xml delete mode 100644 spec/fixtures/user.xml delete mode 100644 spec/fixtures/user_timeline.xml delete mode 100644 spec/search_spec.rb delete mode 100644 spec/spec.opts delete mode 100644 spec/spec_helper.rb delete mode 100644 spec/status_spec.rb delete mode 100644 spec/user_spec.rb delete mode 100644 twitter.gemspec diff --git a/Manifest b/Manifest deleted file mode 100644 index c09c5666f..000000000 --- a/Manifest +++ /dev/null @@ -1,68 +0,0 @@ -bin/twitter -examples/blocks.rb -examples/direct_messages.rb -examples/favorites.rb -examples/friends_followers.rb -examples/friendships.rb -examples/identica_timeline.rb -examples/location.rb -examples/posting.rb -examples/replies.rb -examples/search.rb -examples/sent_messages.rb -examples/timeline.rb -examples/twitter.rb -examples/verify_credentials.rb -History -lib/twitter/base.rb -lib/twitter/cli/config.rb -lib/twitter/cli/helpers.rb -lib/twitter/cli/migrations/20080722194500_create_accounts.rb -lib/twitter/cli/migrations/20080722194508_create_tweets.rb -lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb -lib/twitter/cli/migrations/20080722214606_create_configurations.rb -lib/twitter/cli/models/account.rb -lib/twitter/cli/models/configuration.rb -lib/twitter/cli/models/tweet.rb -lib/twitter/cli.rb -lib/twitter/direct_message.rb -lib/twitter/easy_class_maker.rb -lib/twitter/rate_limit_status.rb -lib/twitter/search.rb -lib/twitter/search_result.rb -lib/twitter/search_result_info.rb -lib/twitter/status.rb -lib/twitter/user.rb -lib/twitter/version.rb -lib/twitter.rb -License -Manifest -Rakefile -README -spec/base_spec.rb -spec/cli/helper_spec.rb -spec/direct_message_spec.rb -spec/fixtures/follower_ids.xml -spec/fixtures/followers.xml -spec/fixtures/friend_ids.xml -spec/fixtures/friends.xml -spec/fixtures/friends_for.xml -spec/fixtures/friends_lite.xml -spec/fixtures/friends_timeline.xml -spec/fixtures/friendship_already_exists.xml -spec/fixtures/friendship_created.xml -spec/fixtures/public_timeline.xml -spec/fixtures/rate_limit_status.xml -spec/fixtures/search_result_info.yml -spec/fixtures/search_results.json -spec/fixtures/status.xml -spec/fixtures/user.xml -spec/fixtures/user_timeline.xml -spec/search_spec.rb -spec/spec.opts -spec/spec_helper.rb -spec/status_spec.rb -spec/user_spec.rb -website/css/common.css -website/images/terminal_output.png -website/index.html diff --git a/README b/README deleted file mode 100644 index 571f52f15..000000000 --- a/README +++ /dev/null @@ -1,84 +0,0 @@ -= addicted to twitter - -... a sweet little diddy that helps you twitter your life away - -== Install - -sudo gem install twitter will work just fine. For command line use, you'll need a few other gems: sudo gem install main highline activerecord sqlite3-ruby - -== Examples - - Twitter::Base.new('your email', 'your password').update('watching veronica mars') - - # or you can use post - Twitter::Base.new('your email', 'your password').post('post works too') - - puts "Public Timeline", "=" * 50 - Twitter::Base.new('your email', 'your password').timeline(:public).each do |s| - puts s.text, s.user.name - puts - end - - puts '', "Friends Timeline", "=" * 50 - Twitter::Base.new('your email', 'your password').timeline.each do |s| - puts s.text, s.user.name - puts - end - - puts '', "Friends", "=" * 50 - Twitter::Base.new('your email', 'your password').friends.each do |u| - puts u.name, u.status.text - puts - end - - puts '', "Followers", "=" * 50 - Twitter::Base.new('your email', 'your password').followers.each do |u| - puts u.name, u.status.text - puts - end - -== Search Examples - - Twitter::Search.new('httparty').each { |r| puts r.inspect } - Twitter::Search.new('httparty').from('jnunemaker').each { |r| puts r.inspect } - Twitter::Search.new.from('jnunemaker').to('oaknd1').each { |r| puts r.inspect } - - -== Command Line Use - -Note: If you want to use twitter from the command line be sure that sqlite3 and the sqlite3-ruby gem are installed. I removed the sqlite3-ruby gem as a dependency because you shouldn't need that to just use the API wrapper. Eventually I'll move the CLI interface into another gem. - - $ twitter - -Will give you a list of all the commands. You can get the help for each command by running twitter [command] -h. - -The first thing you'll want to do is install the database so your account(s) can be stored. - - $ twitter install - -You can always uninstall twitter like this: - - $ twitter uninstall - -Once the twitter database is installed and migrated, you can add accounts like this: - - $ twitter add - Add New Account: - Username: jnunemaker - Password (won't be displayed): - Account added. - -You can also list all the accounts you've added. - - $ twitter list - Account List - * jnunemaker - snitch_test - -The * means denotes the account that will be used when posting, befriending, defriending, following, leaving or viewing a timeline. - -To post using the account marked with the *, simply type the following: - - $ twitter post "releasing my new twitter gem" - -That is about it. You can do pretty much anything that you can do with twitter from the command line interface. \ No newline at end of file diff --git a/Rakefile b/Rakefile deleted file mode 100644 index cea28a0e4..000000000 --- a/Rakefile +++ /dev/null @@ -1,42 +0,0 @@ -ProjectName = 'twitter' -WebsitePath = "jnunemaker@rubyforge.org:/var/www/gforge-projects/#{ProjectName}" - -require 'rubygems' -require 'rake' -require 'echoe' -require 'spec/rake/spectask' -require "lib/#{ProjectName}/version" - -Echoe.new(ProjectName, Twitter::Version) do |p| - p.description = "a command line interface for twitter, also a library which wraps the twitter api" - p.url = "http://#{ProjectName}.rubyforge.org" - p.author = "John Nunemaker" - p.email = "nunemaker@gmail.com" - p.extra_deps = [['oauth', '>= 0.3.2'], ['hpricot', '>= 0.6'], ['activesupport', '>= 2.1'], ['httparty', '>= 0.2.4']] - p.need_tar_gz = false - p.docs_host = WebsitePath -end - -desc 'Upload website files to rubyforge' -task :website do - sh %{rsync -av website/ #{WebsitePath}} - Rake::Task['website_docs'].invoke -end - -task :website_docs do - Rake::Task['redocs'].invoke - sh %{rsync -av doc/ #{WebsitePath}/docs} -end - -desc 'Preps the gem for a new release' -task :prepare do - %w[manifest build_gemspec].each do |task| - Rake::Task[task].invoke - end -end - -Rake::Task[:default].prerequisites.clear -task :default => :spec -Spec::Rake::SpecTask.new do |t| - t.spec_files = FileList["spec/**/*_spec.rb"] -end \ No newline at end of file diff --git a/bin/twitter b/bin/twitter deleted file mode 100755 index 3816b2950..000000000 --- a/bin/twitter +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby - -# if we have stdin, let's prepend it to the message for post -if ARGV[0] && ARGV[0] == 'post' && !STDIN.tty? - ARGV[1] = "#{STDIN.read}#{ARGV[1]}" -end - -# if we have stdin, let's prepend it to the message for d -if ARGV[0] && ARGV[0] == 'd' && !STDIN.tty? - ARGV[2] = "#{STDIN.read}#{ARGV[2]}" -end - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'twitter')) -require 'twitter/cli' \ No newline at end of file diff --git a/examples/blocks.rb b/examples/blocks.rb deleted file mode 100644 index 91e3f5afa..000000000 --- a/examples/blocks.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts 'BLOCK CREATE' -puts twitter.block('project_rockne').name -puts -puts - -puts 'BLOCK DESTROY' -puts twitter.block('project_rockne').name -puts -puts diff --git a/examples/direct_messages.rb b/examples/direct_messages.rb deleted file mode 100644 index 5e6cbd97f..000000000 --- a/examples/direct_messages.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'rubygems' -require 'activesupport' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts 'SINCE' -twitter.direct_messages(:since => Time.now - 5.day).each do |s| - puts "- #{s.id} #{s.text}" -end -puts -puts - -# puts 'SINCE_ID' -# twitter.direct_messages(:since_id => 33505386).each do |s| -# puts "- #{s.text}" -# end -# puts -# puts -# -# puts 'PAGE' -# twitter.direct_messages(:page => 1).each do |s| -# puts "- #{s.text}" -# end -# puts -# puts - -# puts twitter.destroy_direct_message(34489057).inspect \ No newline at end of file diff --git a/examples/favorites.rb b/examples/favorites.rb deleted file mode 100644 index 0a093aa5f..000000000 --- a/examples/favorites.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts 'CREATE' -puts twitter.create_favorite(865416114).text -puts -puts - -puts 'FAVORITES' -twitter.favorites.each { |f| puts f.text } -puts -puts - -puts 'DESTROY' -puts twitter.destroy_favorite(865416114).text -puts -puts diff --git a/examples/friends_followers.rb b/examples/friends_followers.rb deleted file mode 100644 index bd7e58690..000000000 --- a/examples/friends_followers.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts "FRIENDS" -twitter.friends.each { |f| puts f.name } -puts -puts - -puts "FRIENDS FOR" -twitter.friends_for('orderedlist', :lite => true).each { |f| puts f.name } -puts -puts - -puts "FOLLOWERS" -twitter.followers(:lite => true).each { |f| puts f.name } -puts -puts - -puts "FOLLOWERS FOR" -twitter.followers_for('orderedlist', :lite => true).each { |f| puts f.name } -puts -puts \ No newline at end of file diff --git a/examples/friendships.rb b/examples/friendships.rb deleted file mode 100644 index 5db1bee9b..000000000 --- a/examples/friendships.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts twitter.create_friendship('orderedlist').name -puts twitter.follow('orderedlist').name -puts twitter.leave('orderedlist').name -puts twitter.destroy_friendship('orderedlist').name - -puts twitter.friendship_exists?('jnunemaker', 'orderedlist').inspect -puts twitter.friendship_exists?('jnunemaker', 'ze').inspect \ No newline at end of file diff --git a/examples/identica_timeline.rb b/examples/identica_timeline.rb deleted file mode 100644 index 681339cf6..000000000 --- a/examples/identica_timeline.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -identica = Twitter::Base.new(config['email'], config['password'], :api_host => 'identi.ca/api') - -identica.timeline(:public).each { |s| puts s.text, s.user.name, '' } diff --git a/examples/location.rb b/examples/location.rb deleted file mode 100644 index c1eea9f6b..000000000 --- a/examples/location.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts twitter.update_location('Hollywood, CA').location -puts twitter.update_delivery_device('none') \ No newline at end of file diff --git a/examples/oauth.rb b/examples/oauth.rb deleted file mode 100644 index 02433d2c4..000000000 --- a/examples/oauth.rb +++ /dev/null @@ -1,60 +0,0 @@ -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -require 'pp' - -class ConfigStore - attr_reader :file - - def initialize(file) - @file = file - end - - def load - @config ||= YAML::load(open(file)) - self - end - - def [](key) - load - @config[key] - end - - def []=(key, value) - @config[key] = value - end - - def update(c={}) - @config.merge!(c) - save - end - - def save - File.open(file, 'w') { |f| f.write(YAML.dump(@config)) } - end -end - -config = ConfigStore.new("#{ENV['HOME']}/.twitter") -oauth = Twitter::OAuth.new(config['token'], config['secret']) - -if config['atoken'] && config['asecret'] - oauth.authorize_from_access(config['atoken'], config['asecret']) - puts oauth.access_token.get("/statuses/friends_timeline.json") - -elsif config['rtoken'] && config['rsecret'] - oauth.authorize_from_request(config['rtoken'], config['rsecret']) - puts oauth.access_token.get("/statuses/friends_timeline.json") - - config.update({ - 'atoken' => oauth.access_token.token, - 'asecret' => oauth.access_token.secret, - 'rtoken' => nil, - 'rsecret' => nil, - }) -else - config.update({ - 'rtoken' => oauth.request_token.token, - 'rsecret' => oauth.request_token.secret, - }) - - # authorize in browser - %x(open #{oauth.request_token.authorize_url}) -end \ No newline at end of file diff --git a/examples/posting.rb b/examples/posting.rb deleted file mode 100644 index cb4fadca1..000000000 --- a/examples/posting.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) -puts twitter.post("This is a test from the example file").inspect - -# sending a direct message -# puts twitter.d('jnunemaker', 'this is a test').inspect \ No newline at end of file diff --git a/examples/replies.rb b/examples/replies.rb deleted file mode 100644 index 223380a39..000000000 --- a/examples/replies.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'rubygems' -require 'activesupport' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts 'SINCE' -twitter.replies(:since => Time.now - 5.day).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'SINCE_ID' -twitter.replies(:since_id => 863081345).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'PAGE' -twitter.replies(:page => 1).each do |s| - puts "- #{s.text}" -end -puts -puts \ No newline at end of file diff --git a/examples/search.rb b/examples/search.rb deleted file mode 100644 index cd24106d7..000000000 --- a/examples/search.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') - -Twitter::Search.new('httparty').each { |r| puts r.inspect,'' } -Twitter::Search.new('httparty').page(2).each { |r| puts r.inspect, '' } - -# search = Twitter::Search.new -# search.from('jnunemaker').to('oaknd1').each { |r| puts r.inspect, '' } -# pp search.result -# search.clear - -# search.from('jnunemaker').to('oaknd1').since(814529437).containing('milk').each { |r| puts r.inspect, '' } -# search.clear -# -# search.geocode('40.757929', '-73.985506', '50mi').containing('holland').each { |r| puts r.inspect, '' } -# search.clear - -# pp search.from('jnunemaker').fetch() \ No newline at end of file diff --git a/examples/sent_messages.rb b/examples/sent_messages.rb deleted file mode 100644 index 23f68ba2e..000000000 --- a/examples/sent_messages.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'rubygems' -require 'activesupport' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts 'SINCE' -twitter.sent_messages(:since => Time.now - 5.day).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'SINCE_ID' -twitter.sent_messages(:since_id => 33505386).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'PAGE' -twitter.sent_messages(:page => 1).each do |s| - puts "- #{s.text}" -end -puts -puts \ No newline at end of file diff --git a/examples/timeline.rb b/examples/timeline.rb deleted file mode 100644 index e0e3abc2b..000000000 --- a/examples/timeline.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'rubygems' -require 'activesupport' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts 'SINCE' -twitter.timeline(:user, :since => Time.now - 1.day).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'SINCE_ID' -twitter.timeline(:user, :since_id => 865547074).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'COUNT' -twitter.timeline(:user, :count => 1).each do |s| - puts "- #{s.text}" -end -puts -puts - -puts 'PAGE' -twitter.timeline(:user, :page => 1).each do |s| - puts "- #{s.text}" -end -puts -puts \ No newline at end of file diff --git a/examples/twitter.rb b/examples/twitter.rb deleted file mode 100644 index 11c080f8e..000000000 --- a/examples/twitter.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -puts "Public Timeline", "=" * 50 -Twitter::Base.new(config['email'], config['password']).timeline(:public).each do |s| - puts s.text, s.user.name - puts -end - -puts '', "Friends Timeline", "=" * 50 -Twitter::Base.new(config['email'], config['password']).timeline.each do |s| - puts s.text, s.user.name - puts -end - -puts '', "Friends", "=" * 50 -Twitter::Base.new(config['email'], config['password']).friends.each do |u| - puts u.name, u.status.text - puts -end - -puts '', "Followers", "=" * 50 -Twitter::Base.new(config['email'], config['password']).followers.each do |u| - puts u.name, u.status.text - puts -end \ No newline at end of file diff --git a/examples/verify_credentials.rb b/examples/verify_credentials.rb deleted file mode 100644 index 3ea56a9d8..000000000 --- a/examples/verify_credentials.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' -require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter') -config = YAML::load(open(ENV['HOME'] + '/.twitter')) - -twitter = Twitter::Base.new(config['email'], config['password']) - -puts twitter.verify_credentials - -begin - Twitter::Base.new('asdf', 'foobar').verify_credentials -rescue => error - puts error.message -end \ No newline at end of file diff --git a/lib/twitter.rb b/lib/twitter.rb deleted file mode 100644 index 90f948a60..000000000 --- a/lib/twitter.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'uri' -require 'cgi' -require 'net/http' -require 'yaml' -require 'time' -require 'rubygems' - -gem 'hpricot' -require 'hpricot' - -gem 'oauth' -require 'oauth' - -$:.unshift(File.dirname(__FILE__)) -require 'twitter/version' -require 'twitter/easy_class_maker' -require 'twitter/oauth' -require 'twitter/base' -require 'twitter/user' -require 'twitter/search' -require 'twitter/status' -require 'twitter/direct_message' -require 'twitter/rate_limit_status' -require 'twitter/search_result_info' -require 'twitter/search_result' - -module Twitter - class Unavailable < StandardError; end - class CantConnect < StandardError; end - class BadResponse < StandardError; end - class UnknownTimeline < ArgumentError; end - class RateExceeded < StandardError; end - class CantFindUsers < ArgumentError; end - class AlreadyFollowing < StandardError; end - class CantFollowUser < StandardError; end - - SourceName = 'twittergem' -end \ No newline at end of file diff --git a/lib/twitter/base.rb b/lib/twitter/base.rb deleted file mode 100644 index 635a5c06f..000000000 --- a/lib/twitter/base.rb +++ /dev/null @@ -1,284 +0,0 @@ -# This is the base class for the twitter library. It makes all the requests -# to twitter, parses the xml (using hpricot) and returns ruby objects to play with. -# -# For complete documentation on the options, check out the twitter api docs. -# http://groups.google.com/group/twitter-development-talk/web/api-documentation -module Twitter - class Base - # Initializes the configuration for making requests to twitter - # Twitter example: - # Twitter.new('email/username', 'password') - # - # Identi.ca example: - # Twitter.new('email/username', 'password', :api_host => 'identi.ca/api') - def initialize(email, password, options={}) - @api_host = options.delete(:api_host) || 'twitter.com' - @config, @config[:email], @config[:password] = options, email, password - @proxy_host = options[:proxy_host] - @proxy_port = options[:proxy_port] - end - - # Returns an array of statuses for a timeline; Defaults to your friends timeline. - def timeline(which=:friends, options={}) - raise UnknownTimeline unless [:friends, :public, :user].include?(which) - auth = which.to_s.include?('public') ? false : true - statuses(call("#{which}_timeline", :auth => auth, :since => options[:since], :args => parse_options(options))) - end - - # Returns an array of users who are in your friends list - def friends(options={}) - users(call(:friends, {:args => parse_options(options)})) - end - - # Returns an array of users who are friends for the id or username passed in - def friends_for(id, options={}) - friends(options.merge({:id => id})) - end - - # Returns an array of user ids who are friends for the account or the option id/username passed in - def friend_ids(id_or_screenname = nil) - path = id_or_screenname ? "friends/ids/#{id_or_screenname}.xml" : "friends/ids.xml" - doc = request(path, :auth => true) - (doc/:id).inject([]) {|ids, id| ids << id.innerHTML; ids} - end - - # Returns an array of users who are following you - def followers(options={}) - users(call(:followers, {:args => parse_options(options)})) - end - - def followers_for(id, options={}) - followers(options.merge({:id => id})) - end - - # Returns an array of user ids who are followers for the account or the option id/username passed in - def follower_ids(id_or_screenname = nil) - path = id_or_screenname ? "followers/ids/#{id_or_screenname}.xml" : "followers/ids.xml" - doc = request(path, :auth => true) - (doc/:id).inject([]) {|ids, id| ids << id.innerHTML; ids} - end - - # Returns a single status for a given id - def status(id) - statuses(call("show/#{id}")).first - end - - # returns all the profile information and the last status for a user - def user(id_or_screenname) - users(request("users/show/#{id_or_screenname}.xml", :auth => true)).first - end - - # Returns an array of statuses that are replies - def replies(options={}) - statuses(call(:replies, :since => options[:since], :args => parse_options(options))) - end - - # Destroys a status by id - def destroy(id) - call("destroy/#{id}") - end - - def rate_limit_status - RateLimitStatus.new_from_xml request("account/rate_limit_status.xml", :auth => true) - end - - # waiting for twitter to correctly implement this in the api as it is documented - def featured - users(call(:featured)) - end - - # Returns an array of all the direct messages for the authenticated user - def direct_messages(options={}) - doc = request(build_path('direct_messages.xml', parse_options(options)), {:auth => true, :since => options[:since]}) - (doc/:direct_message).inject([]) { |dms, dm| dms << DirectMessage.new_from_xml(dm); dms } - end - alias :received_messages :direct_messages - - # Returns direct messages sent by auth user - def sent_messages(options={}) - doc = request(build_path('direct_messages/sent.xml', parse_options(options)), {:auth => true, :since => options[:since]}) - (doc/:direct_message).inject([]) { |dms, dm| dms << DirectMessage.new_from_xml(dm); dms } - end - - # destroys a give direct message by id if the auth user is a recipient - def destroy_direct_message(id) - DirectMessage.new_from_xml(request("direct_messages/destroy/#{id}.xml", :auth => true, :method => :post)) - end - - # Sends a direct message text to user - def d(user, text) - DirectMessage.new_from_xml(request('direct_messages/new.xml', :auth => true, :method => :post, :form_data => {'text' => text, 'user' => user})) - end - - # Befriends id_or_screenname for the auth user - def create_friendship(id_or_screenname) - users(request("friendships/create/#{id_or_screenname}.xml", :auth => true, :method => :post)).first - end - - # Defriends id_or_screenname for the auth user - def destroy_friendship(id_or_screenname) - users(request("friendships/destroy/#{id_or_screenname}.xml", :auth => true, :method => :post)).first - end - - # Returns true if friendship exists, false if it doesn't. - def friendship_exists?(user_a, user_b) - doc = request(build_path("friendships/exists.xml", {:user_a => user_a, :user_b => user_b}), :auth => true) - doc.at('friends').innerHTML == 'true' ? true : false - end - - # Updates your location and returns Twitter::User object - def update_location(location) - users(request(build_path('account/update_location.xml', {'location' => location}), :auth => true, :method => :post)).first - end - - # Updates your deliver device and returns Twitter::User object - def update_delivery_device(device) - users(request(build_path('account/update_delivery_device.xml', {'device' => device}), :auth => true, :method => :post)).first - end - - # Turns notifications by id_or_screenname on for auth user. - def follow(id_or_screenname) - users(request("notifications/follow/#{id_or_screenname}.xml", :auth => true, :method => :post)).first - end - - # Turns notifications by id_or_screenname off for auth user. - def leave(id_or_screenname) - users(request("notifications/leave/#{id_or_screenname}.xml", :auth => true, :method => :post)).first - end - - # Returns the most recent favorite statuses for the autenticating user - def favorites(options={}) - statuses(request(build_path('favorites.xml', parse_options(options)), :auth => true)) - end - - # Favorites the status specified by id for the auth user - def create_favorite(id) - statuses(request("favorites/create/#{id}.xml", :auth => true, :method => :post)).first - end - - # Un-favorites the status specified by id for the auth user - def destroy_favorite(id) - statuses(request("favorites/destroy/#{id}.xml", :auth => true, :method => :post)).first - end - - # Blocks the user specified by id for the auth user - def block(id) - users(request("blocks/create/#{id}.xml", :auth => true, :method => :post)).first - end - - # Unblocks the user specified by id for the auth user - def unblock(id) - users(request("blocks/destroy/#{id}.xml", :auth => true, :method => :post)).first - end - - # Posts a new update to twitter for auth user. - def post(status, options={}) - form_data = {'status' => status} - form_data.merge!({'source' => options[:source]}) if options[:source] - form_data.merge!({'in_reply_to_status_id' => options[:in_reply_to_status_id]}) if options[:in_reply_to_status_id] - Status.new_from_xml(request('statuses/update.xml', :auth => true, :method => :post, :form_data => form_data)) - end - alias :update :post - - # Verifies the credentials for the auth user. - # raises Twitter::CantConnect on failure. - def verify_credentials - users(request('account/verify_credentials.xml', :auth => true)).first - end - - private - # Converts an hpricot doc to an array of statuses - def statuses(doc) - (doc/:status).inject([]) { |statuses, status| statuses << Status.new_from_xml(status); statuses } - end - - # Converts an hpricot doc to an array of users - def users(doc) - (doc/:user).inject([]) { |users, user| users << User.new_from_xml(user); users } - end - - # Calls whatever api method requested that deals with statuses - # - # ie: call(:public_timeline, :auth => false) - def call(method, options={}) - options = { :auth => true, :args => {} }.merge(options) - # Following line needed as lite=false doesn't work in the API: http://tinyurl.com/yo3h5d - options[:args].delete(:lite) unless options[:args][:lite] - args = options.delete(:args) - request(build_path("statuses/#{method.to_s}.xml", args), options) - end - - def response(path, options={}) - uri = URI.parse("http://#{@api_host}") - - begin - response = Net::HTTP::Proxy(@proxy_host, @proxy_port).start(uri.host, uri.port) do |http| - klass = Net::HTTP.const_get options[:method].to_s.downcase.capitalize - req = klass.new("#{uri.path}/#{path}", options[:headers]) - req.basic_auth(@config[:email], @config[:password]) if options[:auth] - if options[:method].to_s == 'post' && options[:form_data] - req.set_form_data(options[:form_data]) - end - http.request(req) - end - rescue => error - raise CantConnect, error.message - end - end - - # Makes a request to twitter. - def request(path, options={}) - options = { - :headers => { "User-Agent" => @config[:email] }, - :method => :get, - }.merge(options) - - unless options[:since].nil? - since = options[:since].kind_of?(Date) ? options[:since].strftime('%a, %d-%b-%y %T GMT') : options[:since].to_s - options[:headers]["If-Modified-Since"] = since - end - - handle_response!(response(path, options)) - end - - def handle_response!(response) - if %w[200 304].include?(response.code) - response = parse(response.body) - raise RateExceeded if (response/:hash/:error).text =~ /Rate limit exceeded/ - response - elsif response.code == '503' - raise Unavailable, response.message - elsif response.code == '401' - raise CantConnect, 'Authentication failed. Check your username and password' - elsif response.code == '403' - error_message = (parse(response.body)/:hash/:error).text - raise CantFindUsers, error_message if error_message =~ /Could not find both specified users/ - raise AlreadyFollowing, error_message if error_message =~ /already on your list/ - raise CantFollowUser, "Response code #{response.code}: #{response.message} #{error_message}" - else - raise CantConnect, "Twitter is returning a #{response.code}: #{response.message}" - end - end - - # Given a path and a hash, build a full path with the hash turned into a query string - def build_path(path, options) - unless options.nil? - query = options.inject('') { |str, h| str += "#{CGI.escape(h[0].to_s)}=#{CGI.escape(h[1].to_s)}&"; str } - path += "?#{query}" - end - - path - end - - # Tries to get all the options in the correct format before making the request - def parse_options(options) - options[:since] = options[:since].kind_of?(Date) ? options[:since].strftime('%a, %d-%b-%y %T GMT') : options[:since].to_s if options[:since] - options - end - - # Converts a string response into an Hpricot xml element. - def parse(response) - Hpricot.XML(response || '') - end - end -end diff --git a/lib/twitter/cli.rb b/lib/twitter/cli.rb deleted file mode 100644 index 726b7747f..000000000 --- a/lib/twitter/cli.rb +++ /dev/null @@ -1,334 +0,0 @@ -require 'rubygems' - -gem 'main' -gem 'highline' -gem 'activerecord' -gem 'sqlite3-ruby' - -require 'main' -require 'highline/import' -require 'activerecord' -require 'sqlite3' - -HighLine.track_eof = false -CLI_ROOT = File.expand_path(File.join(File.dirname(__FILE__), 'cli')) -require CLI_ROOT + '/config' -require CLI_ROOT + '/helpers' -Dir[CLI_ROOT + '/models/*.rb'].each { |m| require m } - -include Twitter::CLI::Helpers - -Main { - def run - puts "twitter [command] --help for usage instructions." - puts "The available commands are: \n install, uninstall, add, remove, list, change, post, befriend, defriend, follow, leave, d and timeline." - end - - mode 'install' do - description 'Creates the sqlite3 database and runs the migrations.' - def run - migrate - attempt_import - say 'Twitter installed.' - end - end - - mode 'uninstall' do - description 'Removes the sqlite3 database. There is no undo for this.' - def run - FileUtils.rm(Twitter::CLI::Config[:database]) if File.exists?(Twitter::CLI::Config[:database]) - say 'Twitter gem uninstalled.' - end - end - - mode 'add' do - description 'Adds a new twitter account to the database. Prompts for username and password.' - argument('username', 'u') { - optional - description 'optional username' - } - argument('password', 'p') { - optional - description 'optional password' - } - - def run - account = Hash.new - say "Add New Account:" - - # allows optional username arg - if params['username'].given? - account[:username] = params['username'].value - else - account[:username] = ask('Username: ') do |q| - q.validate = /\S+/ - end - end - - # allows optional password arg - if params['password'].given? - account[:password] = params['password'].value - else - account[:password] = ask("Password (won't be displayed): ") do |q| - q.echo = false - q.validate = /\S+/ - end - end - - do_work do - base(account[:username], account[:password]).verify_credentials - Account.add(account) - say 'Account added.' - end - end - end - - mode 'remove' do - description 'Removes a twitter account from the database. If username provided it removes that username else it prompts with list and asks for which one you would like to remove.' - argument( 'username' ) { - optional - description 'username of account you would like to remove' - } - - def run - do_work do - if params['username'].given? - account = Account.find_by_username(params['username'].value) - else - Account.find(:all, :order => 'username').each do |a| - say "#{a.id}. #{a}" - end - account_id = ask 'Account to remove (enter number): ' do |q| - q.validate = /\d+/ - end - end - - begin - account = account_id ? Account.find(account_id) : account - account_name = account.username - account.destroy - Account.set_current(Account.first) if Account.new_active_needed? - say "#{account_name} has been removed.\n" - rescue ActiveRecord::RecordNotFound - say "ERROR: Account could not be found. Try again. \n" - end - end - end - end - - mode 'list' do - description 'Lists all the accounts that have been added and puts a * by the current one that is used for posting, etc.' - def run - do_work do - if Account.count == 0 - say 'No accounts have been added.' - else - say 'Account List' - Account.find(:all, :order => 'username').each do |a| - say a - end - end - end - end - end - - mode 'change' do - description 'Changes the current account being used for posting etc. to the username provided. If no username is provided, a list is presented and you can choose the account from there.' - argument( 'username' ) { - optional - description 'username of account you would like to switched to' - } - - def run - do_work do - if params['username'].given? - new_current = Account.find_by_username(params['username'].value) - else - Account.find(:all, :order => 'username').each do |a| - say "#{a.id}. #{a}" - end - new_current = ask 'Change current account to (enter number): ' do |q| - q.validate = /\d+/ - end - end - - begin - current = Account.set_current(new_current) - say "#{current} is now the current account.\n" - rescue ActiveRecord::RecordNotFound - say "ERROR: Account could not be found. Try again. \n" - end - end - end - end - - mode 'post' do - description "Posts a message to twitter using the current account. The following are all valid examples from the command line: - $ twitter post 'my update' - $ twitter post my update with quotes - $ echo 'my update from stdin' | twitter post" - def run - do_work do - post = ARGV.size > 1 ? ARGV.join(" ") : ARGV.shift - say "Sending twitter update" - finished, status = false, nil - progress_thread = Thread.new { until finished; print "."; $stdout.flush; sleep 0.5; end; } - post_thread = Thread.new(binding()) do |b| - status = base.post(post, :source => Twitter::SourceName) - finished = true - end - post_thread.join - progress_thread.join - say "Got it! New tweet created at: #{status.created_at}\n" - end - end - end - - mode 'befriend' do - description "Allows you to add a user as a friend" - argument('username') { - required - description 'username or id of twitterrer to befriend' - } - - def run - do_work do - username = params['username'].value - base.create_friendship(username) - say "#{username} has been added as a friend. follow notifications with 'twitter follow #{username}'" - end - end - end - - mode 'defriend' do - description "Allows you to remove a user from being a friend" - argument('username') { - required - description 'username or id of twitterrer to defriend' - } - - def run - do_work do - username = params['username'].value - base.destroy_friendship(username) - say "#{username} has been removed from your friends" - end - end - end - - mode 'follow' do - description "Allows you to add notifications for a user (aka Follow Them)" - argument('username') { - required - description 'username or id of twitterrer to follow' - } - - def run - do_work do - username = params['username'].value - base.follow(username) - say "You are now following notifications from #{username}" - end - end - end - - mode 'leave' do - description "Allows you to turn off notifications for a user" - argument('username') { - required - description 'username or id of twitterrer to leave' - } - - def run - do_work do - username = params['username'].value - base.leave(username) - say "You are no longer following notifications from #{username}" - end - end - end - - mode 'd' do - description "Allows you to direct message a user. The following are all valid examples from the command line: - $ twitter d jnunemaker 'yo homeboy' - $ twitter d jnunemaker yo homeboy - $ echo 'yo homeboy' | twitter d jnunemaker" - argument('username') { - required - description 'username or id of twitterrer to direct message' - } - - def run - do_work do - username = params['username'].value - post = ARGV.size > 1 ? ARGV.join(" ") : ARGV.shift - base.d(username, post) - say "Direct message sent to #{username}" - end - end - end - - mode 'timeline' do - description "Allows you to view your timeline, your friends or the public one" - argument( 'timeline' ) { - description 'the timeline you wish to see (friends, public, me)' - default 'friends' - } - option('force', 'f') { - description "Ignore since_id and show first page of results even if there aren't new ones" - } - option('reverse', 'r') { - description 'Reverse the output so the oldest tweets are at the top' - } - - def run - do_work do - timeline = params['timeline'].value == 'me' ? 'user' : params['timeline'].value - options, since_id = {}, Configuration["#{timeline}_since_id"] - options[:since_id] = since_id if !since_id.nil? && !params['force'].given? - reverse = params['reverse'].given? ? true : false - cache = [:friends, :user].include?(timeline) - collection = base.timeline(timeline.to_sym, options) - output_tweets(collection, {:cache => cache, :since_prefix => timeline, :reverse => reverse}) - end - end - end - - mode 'replies' do - description 'Allows you to view all @replies sent to you' - option('force', 'f') { - description "Ignore since_id and show first page of replies even if there aren't new ones" - } - - def run - do_work do - options, since_id = {}, Configuration["replies_since_id"] - options[:since_id] = since_id if !since_id.nil? && !params['force'].given? - collection = base.replies(options) - output_tweets(collection, {:since_prefix => 'replies'}) - end - end - end - - mode 'clear_config' do - def run - do_work do - count = Configuration.count - Configuration.destroy_all - say("#{count} configuration entries cleared.") - end - end - end - - mode 'open' do - description 'Opens the given twitter user in a browser window' - argument('username') { - required - description "username or id of twitterrer who's page you would like to see" - } - - def run - `open http://twitter.com/#{params['username'].value}` - end - end -} diff --git a/lib/twitter/cli/config.rb b/lib/twitter/cli/config.rb deleted file mode 100644 index 1a3ea88bd..000000000 --- a/lib/twitter/cli/config.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Twitter - module CLI - Config = { - :adapter => 'sqlite3', - :database => File.join(ENV['HOME'], '.twitter.db'), - :timeout => 5000 - } - end -end \ No newline at end of file diff --git a/lib/twitter/cli/helpers.rb b/lib/twitter/cli/helpers.rb deleted file mode 100644 index 1f4cc4b98..000000000 --- a/lib/twitter/cli/helpers.rb +++ /dev/null @@ -1,109 +0,0 @@ -module Twitter - module CLI - module Helpers - class NoActiveAccount < StandardError; end - class NoAccounts < StandardError; end - - def output_tweets(collection, options={}) - options = { - :cache => false, - :since_prefix => '', - :empty_msg => 'Nothing new since your last check.', - :reverse => false - }.merge(options) - - if collection.size > 0 - justify = collection.collect { |s| s.user.screen_name }.max { |a,b| a.length <=> b.length }.length rescue 0 - indention = ' ' * (justify + 3) - say("\n#{indention}#{collection.size} new tweet(s) found.\n\n") - collection.reverse! if options[:reverse] - collection.each do |s| - Tweet.create_from_tweet(current_account, s) if options[:cache] - - occurred_at = Time.parse(s.created_at).strftime('On %b %d at %l:%M%P') - formatted_time = '-' * occurred_at.length + "\n#{indention}#{occurred_at}" - formatted_name = s.user.screen_name.rjust(justify + 1) - formatted_msg = '' - - s.text.split(' ').each_with_index do |word, idx| - formatted_msg += "#{word} " - - sixth_word = idx != 0 && idx % 6 == 0 - formatted_msg += "\n#{indention}" if sixth_word - end - - say "#{CGI::unescapeHTML(formatted_name)}: #{CGI::unescapeHTML(formatted_msg)}\n#{indention}#{formatted_time}\n\n" - end - - Configuration["#{options[:since_prefix]}_since_id"] = options[:reverse] ? collection.last.id : collection.first.id - else - say(options[:empty_msg]) - end - end - - def base(username=current_account.username, password=current_account.password) - @base ||= Twitter::Base.new(username, password) - end - - def current_account - @current_account ||= Account.active - raise Account.count == 0 ? NoAccounts : NoActiveAccount if @current_account.nil? - @current_account - end - - def attempt_import(&block) - tweet_file = File.join(ENV['HOME'], '.twitter') - if File.exists?(tweet_file) - say '.twitter file found, attempting import...' - config = YAML::load(File.read(tweet_file)) - if !config['email'].nil? && !config['password'].nil? - Account.add(:username => config['email'], :password => config['password']) - say 'Account imported' - block.call if block_given? - true - else - say "Either your username or password were blank in your .twitter file so I could not import. Use 'twitter add' to add an account." - false - end - end - end - - def do_work(&block) - connect - begin - block.call - rescue Twitter::RateExceeded - say("Twitter says you've been making too many requests. Wait for a bit and try again.") - rescue Twitter::Unavailable - say("Twitter is unavailable right now. Try again later.") - rescue Twitter::CantConnect => msg - say("Can't connect to twitter because: #{msg}") - rescue Twitter::CLI::Helpers::NoActiveAccount - say("You have not set an active account. Use 'twitter change' to set one now.") - rescue Twitter::CLI::Helpers::NoAccounts - unless attempt_import { block.call } - say("You have not created any accounts. Use 'twitter add' to create one now.") - end - end - end - - def connect - ActiveRecord::Base.logger = Logger.new('/tmp/twitter_ar_logger.log') - ActiveRecord::Base.establish_connection(Twitter::CLI::Config) - ActiveRecord::Base.connection - end - - def migrate - connect - ActiveRecord::Migrator.migrate("#{CLI_ROOT}/migrations/") - end - - def connect_and_migrate - say('Attempting to establish connection...') - connect - say('Connection established...migrating database...') - migrate - end - end - end -end \ No newline at end of file diff --git a/lib/twitter/cli/migrations/20080722194500_create_accounts.rb b/lib/twitter/cli/migrations/20080722194500_create_accounts.rb deleted file mode 100644 index 216263445..000000000 --- a/lib/twitter/cli/migrations/20080722194500_create_accounts.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateAccounts < ActiveRecord::Migration - def self.up - create_table :accounts do |t| - t.string :username, :password - t.boolean :current - t.timestamps - end - end - - def self.down - drop_table :accounts - end -end diff --git a/lib/twitter/cli/migrations/20080722194508_create_tweets.rb b/lib/twitter/cli/migrations/20080722194508_create_tweets.rb deleted file mode 100644 index aef35abca..000000000 --- a/lib/twitter/cli/migrations/20080722194508_create_tweets.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateTweets < ActiveRecord::Migration - def self.up - create_table :tweets do |t| - t.datetime :occurred_at - t.boolean :truncated, :favorited, :user_protected, :default => false - t.integer :twitter_id, :user_id, :in_reply_to_status_id, :in_reply_to_user_id, :user_followers_count - t.text :body - t.string :source, :user_name, :user_screen_name, :user_location, :user_description, :user_profile_image_url, :user_url - t.timestamps - end - end - - def self.down - drop_table :tweets - end -end diff --git a/lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb b/lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb deleted file mode 100644 index 074c502af..000000000 --- a/lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddAccountIdToTweets < ActiveRecord::Migration - def self.up - add_column :tweets, :account_id, :integer - end - - def self.down - remove_column :tweets, :account_id - end -end diff --git a/lib/twitter/cli/migrations/20080722214606_create_configurations.rb b/lib/twitter/cli/migrations/20080722214606_create_configurations.rb deleted file mode 100644 index 6a8e33d9a..000000000 --- a/lib/twitter/cli/migrations/20080722214606_create_configurations.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateConfigurations < ActiveRecord::Migration - def self.up - create_table :configurations do |t| - t.string :key - t.text :data - t.timestamps - end - end - - def self.down - drop_table :accounts - end -end diff --git a/lib/twitter/cli/models/account.rb b/lib/twitter/cli/models/account.rb deleted file mode 100644 index 2628126de..000000000 --- a/lib/twitter/cli/models/account.rb +++ /dev/null @@ -1,33 +0,0 @@ -class Account < ActiveRecord::Base - named_scope :current, :conditions => {:current => true} - - has_many :tweets, :dependent => :destroy - - def self.add(hash) - username = hash.delete(:username) - account = find_or_initialize_by_username(username) - account.attributes = hash - account.save - set_current(account) if new_active_needed? - end - - def self.active - current.first - end - - def self.set_current(account_or_id) - account = account_or_id.is_a?(Account) ? account_or_id : find(account_or_id) - account.update_attribute :current, true - Account.update_all "current = 0", "id != #{account.id}" - account - end - - def self.new_active_needed? - self.current.count == 0 && self.count > 0 - end - - def to_s - "#{current? ? '*' : ' '} #{username}" - end - alias to_str to_s -end diff --git a/lib/twitter/cli/models/configuration.rb b/lib/twitter/cli/models/configuration.rb deleted file mode 100644 index 780dcb420..000000000 --- a/lib/twitter/cli/models/configuration.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Configuration < ActiveRecord::Base - serialize :data - - def self.[](key) - key = find_by_key(key.to_s) - key.nil? ? nil : key.data - end - - def self.[]=(key, data) - c = find_or_create_by_key(key.to_s) - c.update_attribute :data, data - end -end diff --git a/lib/twitter/cli/models/tweet.rb b/lib/twitter/cli/models/tweet.rb deleted file mode 100644 index 4f808a433..000000000 --- a/lib/twitter/cli/models/tweet.rb +++ /dev/null @@ -1,20 +0,0 @@ -class Tweet < ActiveRecord::Base - belongs_to :account - - def self.create_from_tweet(account, s) - tweet = account.tweets.find_or_initialize_by_twitter_id(s.id) - tweet.body = s.text - tweet.occurred_at = s.created_at - - %w[truncated favorited in_reply_to_status_id in_reply_to_user_id source].each do |m| - tweet.send("#{m}=", s.send(m)) - end - - %w[id followers_count name screen_name location description - profile_image_url url protected].each do |m| - tweet.send("user_#{m}=", s.user.send(m)) - end - tweet.save! - tweet - end -end diff --git a/lib/twitter/direct_message.rb b/lib/twitter/direct_message.rb deleted file mode 100644 index fb9fc0501..000000000 --- a/lib/twitter/direct_message.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Twitter - class DirectMessage - include EasyClassMaker - - attributes :id, :text, :sender_id, :recipient_id, :created_at, :sender_screen_name, :recipient_screen_name - - class << self - # Creates a new status from a piece of xml - def new_from_xml(xml) - DirectMessage.new do |d| - d.id = (xml).at('id').innerHTML - d.text = (xml).get_elements_by_tag_name('text').innerHTML - d.sender_id = (xml).at('sender_id').innerHTML - d.recipient_id = (xml).at('recipient_id').innerHTML - d.created_at = (xml).at('created_at').innerHTML - d.sender_screen_name = (xml).at('sender_screen_name').innerHTML - d.recipient_screen_name = (xml).at('recipient_screen_name').innerHTML - end - end - end - end -end \ No newline at end of file diff --git a/lib/twitter/easy_class_maker.rb b/lib/twitter/easy_class_maker.rb deleted file mode 100644 index 1537e3849..000000000 --- a/lib/twitter/easy_class_maker.rb +++ /dev/null @@ -1,43 +0,0 @@ -# This is pretty much just a macro for creating a class that allows -# using a block to initialize stuff and to define getters and setters -# really quickly. -module Twitter - module EasyClassMaker - - def self.included(base) - base.extend(ClassMethods) - end - - module ClassMethods - # creates the attributes class variable and creates each attribute's accessor methods - def attributes(*attrs) - @@attributes = attrs - @@attributes.each { |a| attr_accessor a } - end - - # read method for attributes class variable - def self.attributes; @@attributes end - end - - # allows for any class that includes this to use a block to initialize - # variables instead of assigning each one seperately - # - # Example: - # - # instead of... - # - # s = Status.new - # s.foo = 'thing' - # s.bar = 'another thing' - # - # you can ... - # - # Status.new do |s| - # s.foo = 'thing' - # s.bar = 'another thing' - # end - def initialize - yield self if block_given? - end - end -end \ No newline at end of file diff --git a/lib/twitter/oauth.rb b/lib/twitter/oauth.rb deleted file mode 100644 index 82af0255e..000000000 --- a/lib/twitter/oauth.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Twitter - class OAuth - attr_reader :token, :secret - - def initialize(ctoken, csecret) - @ctoken, @csecret = ctoken, csecret - end - - def request_token - @request_token ||= consumer.get_request_token - end - - def authorize_from_request(rtoken, rsecret) - request_token = ::OAuth::RequestToken.new(consumer, rtoken, rsecret) - access_token = request_token.get_access_token - @atoken, @asecret = access_token.token, access_token.secret - end - - def access_token - @access_token ||= ::OAuth::AccessToken.new(consumer, @atoken, @asecret) - end - - def authorize_from_access(atoken, asecret) - @atoken, @asecret = atoken, asecret - end - - private - def consumer - @consumer ||= ::OAuth::Consumer.new(@ctoken, @csecret, {:site => 'http://twitter.com'}) - end - end -end \ No newline at end of file diff --git a/lib/twitter/rate_limit_status.rb b/lib/twitter/rate_limit_status.rb deleted file mode 100644 index d9e74e067..000000000 --- a/lib/twitter/rate_limit_status.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Twitter - class RateLimitStatus - include EasyClassMaker - - attributes :reset_time_in_seconds, :reset_time, :remaining_hits, :hourly_limit - - class << self - # Creates a new rate limi status from a piece of xml - def new_from_xml(xml) - RateLimitStatus.new do |s| - s.reset_time_in_seconds = xml.at('reset-time-in-seconds').inner_html.to_i - s.reset_time = Time.parse xml.at('reset-time').inner_html - s.remaining_hits = xml.at('remaining-hits').inner_html.to_i - s.hourly_limit = xml.at('hourly-limit').inner_html.to_i - end - end - end - end -end \ No newline at end of file diff --git a/lib/twitter/search.rb b/lib/twitter/search.rb deleted file mode 100644 index a7516dd35..000000000 --- a/lib/twitter/search.rb +++ /dev/null @@ -1,101 +0,0 @@ -gem 'httparty' -require 'httparty' - -module Twitter - class Search - include HTTParty - include Enumerable - base_uri 'search.twitter.com' - - attr_reader :result, :query - - def initialize(q=nil) - clear - containing(q) if q && q.strip != '' - end - - def from(user) - @query[:q] << "from:#{user}" - self - end - - def to(user) - @query[:q] << "to:#{user}" - self - end - - def referencing(user) - @query[:q] << "@#{user}" - self - end - alias :references :referencing - alias :ref :referencing - - def containing(word) - @query[:q] << "#{word}" - self - end - alias :contains :containing - - # adds filtering based on hash tag ie: #twitter - def hashed(tag) - @query[:q] << "##{tag}" - self - end - - # lang must be ISO 639-1 code ie: en, fr, de, ja, etc. - # - # when I tried en it limited my results a lot and took - # out several tweets that were english so i'd avoid - # this unless you really want it - def lang(lang) - @query[:lang] = lang - self - end - - # Limits the number of results per page - def per_page(num) - @query[:rpp] = num - self - end - - # Which page of results to fetch - def page(num) - @query[:page] = num - self - end - - # Only searches tweets since a given id. - # Recommended to use this when possible. - def since(since_id) - @query[:since_id] = since_id - self - end - - # Search tweets by longitude, latitude and a given range. - # Ranges like 25km and 50mi work. - def geocode(long, lat, range) - @query[:geocode] = [long, lat, range].join(',') - self - end - - # Clears all the query filters to make a new search - def clear - @query = {} - @query[:q] = [] - self - end - - # If you want to get results do something other than iterate over them. - def fetch - @query[:q] = @query[:q].join(' ') - SearchResultInfo.new_from_hash(self.class.get('/search.json', {:query => @query})) - end - - def each - @result = fetch() - @result['results'].each { |r| yield r } - end - end -end - diff --git a/lib/twitter/search_result.rb b/lib/twitter/search_result.rb deleted file mode 100644 index f89ec3b2c..000000000 --- a/lib/twitter/search_result.rb +++ /dev/null @@ -1,83 +0,0 @@ -module Twitter - class SearchResult < Hash - - # Creates an easier to work with hash from - # one with string-based keys - def self.new_from_hash(hash) - new.merge!(hash) - end - - def created_at - self['created_at'] - end - - def created_at=(val) - self['created_at'] = val - end - - def from_user - self['from_user'] - end - - def from_user=(val) - self['from_user'] = val - end - - def from_user_id - self['from_user_id'] - end - - def from_user_id=(val) - self['from_user_id'] = val - end - - def id - self['id'] - end - - def id=(val) - self['id'] = val - end - - def iso_language_code - self['iso_language_code'] - end - - def iso_language_code=(val) - self['iso_language_code'] = val - end - - def profile_image_url - self['profile_image_url'] - end - - def profile_image_url=(val) - self['profile_image_url'] = val - end - - def text - self['text'] - end - - def text=(val) - self['text'] = val - end - - def to_user - self['to_user'] - end - - def to_user=(val) - self['to_user'] = val - end - - def to_user_id - self['to_user_id'] - end - - def to_user_id=(val) - self['to_user_id'] = val - end - - end -end \ No newline at end of file diff --git a/lib/twitter/search_result_info.rb b/lib/twitter/search_result_info.rb deleted file mode 100644 index 53ec5c5ce..000000000 --- a/lib/twitter/search_result_info.rb +++ /dev/null @@ -1,82 +0,0 @@ -module Twitter - class SearchResultInfo < Hash - - # Creates an easier to work with hash from - # one with string-based keys - def self.new_from_hash(hash) - i = new - i.merge!(hash) - search_results = [] - i.results.each do |r| - search_results << SearchResult.new_from_hash(r) - end - i.results = search_results - i - end - - def completed_in - self['completed_in'] - end - - def completed_in=(val) - self['completed_in'] = val - end - - def max_id - self['max_id'] - end - - def max_id=(val) - self['max_id'] = val - end - - def next_page - self['next_page'] - end - - def next_page=(val) - self['next_page'] = val - end - - def page - self['page'] - end - - def page=(val) - self['page'] = val - end - - def refresh_url - self['refresh_url'] - end - - def refresh_url=(val) - self['refresh_url'] = val - end - - def results_per_page - self['results_per_page'] - end - - def results_per_page=(val) - self['results_per_page'] = val - end - - def since_id - self['since_id'] - end - - def since_id=(val) - self['since_id'] = val - end - - def results - self['results'] - end - - def results=(val) - self['results'] = val - end - - end -end \ No newline at end of file diff --git a/lib/twitter/status.rb b/lib/twitter/status.rb deleted file mode 100644 index 7509f5a45..000000000 --- a/lib/twitter/status.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Twitter - class Status - include EasyClassMaker - - attributes :created_at, :id, :text, :user, :source, :truncated, :in_reply_to_status_id, :in_reply_to_user_id, :favorited - - # Creates a new status from a piece of xml - def self.new_from_xml(xml) - s = new - s.id = (xml).at('id').innerHTML - s.created_at = (xml).at('created_at').innerHTML - s.text = (xml).get_elements_by_tag_name('text').innerHTML - s.source = (xml).at('source').innerHTML - s.truncated = (xml).at('truncated').innerHTML == 'false' ? false : true - s.favorited = (xml).at('favorited').innerHTML == 'false' ? false : true - s.in_reply_to_status_id = (xml).at('in_reply_to_status_id').innerHTML - s.in_reply_to_user_id = (xml).at('in_reply_to_user_id').innerHTML - s.user = User.new_from_xml(xml.at('user')) if (xml).at('user') - s - end - end -end \ No newline at end of file diff --git a/lib/twitter/user.rb b/lib/twitter/user.rb deleted file mode 100644 index 81545f9da..000000000 --- a/lib/twitter/user.rb +++ /dev/null @@ -1,38 +0,0 @@ -module Twitter - class User - include EasyClassMaker - - attributes :id, :name, :screen_name, :status, :location, :description, :url, - :profile_image_url, :profile_background_color, :profile_text_color, :profile_link_color, - :profile_sidebar_fill_color, :profile_sidebar_border_color, :friends_count, :followers_count, - :favourites_count, :statuses_count, :utc_offset , :protected, :created_at - - # Creates a new user from a piece of xml - def self.new_from_xml(xml) - u = new - u.id = (xml).at('id').innerHTML - u.name = (xml).at('name').innerHTML - u.screen_name = (xml).at('screen_name').innerHTML - u.location = (xml).at('location').innerHTML - u.description = (xml).at('description').innerHTML - u.url = (xml).at('url').innerHTML - u.profile_image_url = (xml).at('profile_image_url').innerHTML - - # optional, not always present - u.created_at = (xml).at('created_at').innerHTML if (xml).at('created_at') - u.profile_background_color = (xml).at('profile_background_color').innerHTML if (xml).at('profile_background_color') - u.profile_text_color = (xml).at('profile_text_color').innerHTML if (xml).at('profile_text_color') - u.profile_link_color = (xml).at('profile_link_color').innerHTML if (xml).at('profile_link_color') - u.profile_sidebar_fill_color = (xml).at('profile_sidebar_fill_color').innerHTML if (xml).at('profile_sidebar_fill_color') - u.profile_sidebar_border_color = (xml).at('profile_sidebar_border_color').innerHTML if (xml).at('profile_sidebar_border_color') - u.friends_count = (xml).at('friends_count').innerHTML if (xml).at('friends_count') - u.followers_count = (xml).at('followers_count').innerHTML if (xml).at('followers_count') - u.favourites_count = (xml).at('favourites_count').innerHTML if (xml).at('favourites_count') - u.statuses_count = (xml).at('statuses_count').innerHTML if (xml).at('statuses_count') - u.utc_offset = (xml).at('utc_offset').innerHTML if (xml).at('utc_offset') - u.protected = (xml).at('protected').innerHTML == 'false' ? false : true if (xml).at('protected') - u.status = Status.new_from_xml(xml.at('status')) if (xml).at('status') - u - end - end -end \ No newline at end of file diff --git a/lib/twitter/version.rb b/lib/twitter/version.rb deleted file mode 100644 index 55910a1c2..000000000 --- a/lib/twitter/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Twitter #:nodoc: - Version = '0.4.4' -end \ No newline at end of file diff --git a/spec/base_spec.rb b/spec/base_spec.rb deleted file mode 100644 index 92ef9282d..000000000 --- a/spec/base_spec.rb +++ /dev/null @@ -1,139 +0,0 @@ -require File.dirname(__FILE__) + '/spec_helper.rb' - -describe "Twitter::Base" do - before do - @base = Twitter::Base.new('foo', 'bar') - end - - describe "being initialized" do - it "should require email and password" do - lambda { Twitter::Base.new }.should raise_error(ArgumentError) - end - end - - describe "timelines" do - it "should bomb if given invalid timeline" do - lambda { @base.timeline(:fakeyoutey) }.should raise_error(Twitter::UnknownTimeline) - end - - it "should default to friends timeline" do - @base.should_receive(:call).with("friends_timeline", {:auth=>true, :args=>{}, :since=>nil}) - @base.should_receive(:statuses) - @base.timeline - end - - it "should be able to retrieve friends timeline" do - data = open(File.dirname(__FILE__) + '/fixtures/friends_timeline.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.timeline(:friends).size.should == 3 - end - - it "should be able to retrieve public timeline" do - data = open(File.dirname(__FILE__) + '/fixtures/public_timeline.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.timeline(:public).size.should == 6 - end - - it "should be able to retrieve user timeline" do - data = open(File.dirname(__FILE__) + '/fixtures/user_timeline.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.timeline(:user).size.should == 19 - end - end - - describe "friends and followers" do - it "should be able to get friends" do - data = open(File.dirname(__FILE__) + '/fixtures/friends.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.friends.size.should == 25 - end - - it "should be able to get friends without latest status" do - data = open(File.dirname(__FILE__) + '/fixtures/friends_lite.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.friends(:lite => true).size.should == 15 - end - - it "should be able to get friend ids" do - data = open(File.dirname(__FILE__) + '/fixtures/friend_ids.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.friend_ids.size.should == 8 - end - - it "should be able to get friends for another user" do - data = open(File.dirname(__FILE__) + '/fixtures/friends_for.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - timeline = @base.friends_for(20) - timeline.size.should == 24 - timeline.first.name.should == 'Jack Dorsey' - end - - it "should be able to get followers" do - data = open(File.dirname(__FILE__) + '/fixtures/followers.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - timeline = @base.followers - timeline.size.should == 29 - timeline.first.name.should == 'Blaine Cook' - end - - it "should be able to get follower ids" do - data = open(File.dirname(__FILE__) + '/fixtures/follower_ids.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.follower_ids.size.should == 8 - end - - it "should be able to create a friendship" do - data = open(File.dirname(__FILE__) + '/fixtures/friendship_created.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - user = @base.create_friendship('jnunemaker') - end - - it "should bomb if friendship already exists" do - data = open(File.dirname(__FILE__) + '/fixtures/friendship_already_exists.xml').read - response = Net::HTTPForbidden.new("1.1", '403', '') - response.stub!(:body).and_return(data) - @base.should_receive(:response).and_return(response) - lambda { @base.create_friendship('billymeltdown') }.should raise_error(Twitter::AlreadyFollowing) - end - end - - it "should be able to get single status" do - data = open(File.dirname(__FILE__) + '/fixtures/status.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.status(803478581).created_at.should == 'Sun May 04 23:36:14 +0000 2008' - end - - it "should be able to get single user" do - data = open(File.dirname(__FILE__) + '/fixtures/user.xml').read - @base.should_receive(:request).and_return(Hpricot::XML(data)) - @base.user('4243').name.should == 'John Nunemaker' - end - - describe "rate limit status" do - before do - @data = open(File.dirname(__FILE__) + '/fixtures/rate_limit_status.xml').read - @base.stub!(:request).and_return(Hpricot::XML(@data)) - end - - it "should request the status" do - @base.should_receive(:request).and_return(Hpricot::XML(@data)) - @base.rate_limit_status - end - - it "should have an hourly limit" do - @base.rate_limit_status.hourly_limit.should == 20 - end - - it "should have a reset time in seconds" do - @base.rate_limit_status.reset_time_in_seconds.should == 1214757610 - end - - it "should have a reset time" do - @base.rate_limit_status.reset_time.should == Time.parse('2008-06-29T16:40:10+00:00') - end - - it "should have remaining hits" do - @base.rate_limit_status.remaining_hits.should == 5 - end - end -end diff --git a/spec/cli/helper_spec.rb b/spec/cli/helper_spec.rb deleted file mode 100644 index d272742f6..000000000 --- a/spec/cli/helper_spec.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'ostruct' -require File.dirname(__FILE__) + '/../spec_helper.rb' -require File.dirname(__FILE__) + '/../../lib/twitter/cli/helpers' - -class Configuration; end - -def say(str) - puts str -end - -class Tweet < OpenStruct - attr_accessor :id -end - -describe Twitter::CLI::Helpers do - include Twitter::CLI::Helpers - - describe "outputting tweets" do - before do - Configuration.stub!(:[]=).and_return(true) - @collection = [ - Tweet.new( - :id => 1, - :text => 'This is my long message that I want to see formatted ooooh so pretty with a few words on each line so it is easy to scan.', - :created_at => Time.mktime(2008, 5, 1, 10, 15, 00).strftime('%Y-%m-%d %H:%M:%S'), - :user => OpenStruct.new(:screen_name => 'jnunemaker') - ), - Tweet.new( - :id => 2, - :text => 'This is my long message that I want to see formatted ooooh so pretty with a.', - :created_at => Time.mktime(2008, 4, 1, 10, 15, 00).strftime('%Y-%m-%d %H:%M:%S'), - :user => OpenStruct.new(:screen_name => 'danielmorrison') - ) - ] - end - - specify "should properly format" do - stdout_for { - output_tweets(@collection) - }.should match(/with a few words[\w\W]*with a\./) - end - - specify 'should format in reverse' do - stdout_for { - output_tweets(@collection, :reverse => true) - }.should match(/with a\.[\w\W]*with a few words/) - end - end -end \ No newline at end of file diff --git a/spec/direct_message_spec.rb b/spec/direct_message_spec.rb deleted file mode 100644 index b436ab382..000000000 --- a/spec/direct_message_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require File.dirname(__FILE__) + '/spec_helper.rb' - -describe "Twitter::DirectMessage" do - it "should create new direct message from xml doc" do - xml = < - 331681 - thanks for revving the twitter gem! had notice that it was broken but didn't have time to patch. - 18713 - 4243 - Sat Mar 10 22:10:37 +0000 2007 - al3x - jnunemaker - -EOF - d = Twitter::DirectMessage.new do |d| - d.id = '331681' - d.text = "thanks for revving the twitter gem! had notice that it was broken but didn't have time to patch." - d.sender_id = '18713' - d.recipient_id = '4243' - d.created_at = 'Sat Mar 10 22:10:37 +0000 2007' - d.sender_screen_name = 'al3x' - d.recipient_screen_name = 'jnunemaker' - end - d2 = Twitter::DirectMessage.new_from_xml(Hpricot.XML(xml)) - - d.id.should == d2.id - d.text.should == d2.text - d.sender_id.should == d2.sender_id - d.recipient_id.should == d2.recipient_id - d.created_at.should == d2.created_at - d.sender_screen_name.should == d2.sender_screen_name - d.recipient_screen_name.should == d2.recipient_screen_name - end -end \ No newline at end of file diff --git a/spec/fixtures/follower_ids.xml b/spec/fixtures/follower_ids.xml deleted file mode 100644 index 468f57c2a..000000000 --- a/spec/fixtures/follower_ids.xml +++ /dev/null @@ -1,11 +0,0 @@ - - -1192 -750823 -813198 -10718 -13046 -79543 -813775 -681473 - diff --git a/spec/fixtures/followers.xml b/spec/fixtures/followers.xml deleted file mode 100644 index 9482240cb..000000000 --- a/spec/fixtures/followers.xml +++ /dev/null @@ -1,706 +0,0 @@ - - - - 246 - Blaine Cook - blaine - San Francisco - TwitterInterpreter. - - http://s3.amazonaws.com/twitter_production/profile_images/14022002/171593560_00e00bc7c9_normal.jpg - http://romeda.org/ - false - 2765 - - Sun May 04 23:36:14 +0000 2008 - - 803478581 - Listening to Umberto Eco trashing the lack of intellectual discrimination on the web. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 613 - Jerry Richardson - - jerry - Warsaw, Indiana - Rails-jockey by day and a Dad by Night. - http://s3.amazonaws.com/twitter_production/profile_images/51893022/jerry135x135_normal.jpg - http://tumblelog.jerryr.com - false - - 903 - - Sun May 04 02:47:26 +0000 2008 - 802958964 - Our Black Sheep concert experience came after my bro saw @mchammer and Vanilla Ice in Indy but before we went to see EPMD in Merrillville. - web - - false - - - false - - - - 874 - - Wayne Sutton - waynesutton - 101 S Greensboro St, Carrboro, - New/Social Media Technology Evangelist, IT & Mobile Consultant - http://s3.amazonaws.com/twitter_production/profile_images/51627720/twitter-icon4_normal.jpg - - http://wayne-sutton.com - false - 3279 - - Mon May 05 00:10:05 +0000 2008 - 803493346 - - About to interview @gwenbell from http://www.techstars.org/ - web - false - - - false - - - - - 1186 - Mr Messina - factoryjoe - Cafe 976 - As if concentrating wasn't hard enough already. - - http://s3.amazonaws.com/twitter_production/profile_images/52015547/bus_512_normal.jpg - http://factoryjoe.com/ - false - 5472 - - Sun May 04 22:44:16 +0000 2008 - - 803455663 - Points for effort, but Rummble.com is a dataportability trainwreck that collided with a 30-car pileup that started by running over a kitten. - web - false - - - false - - - - - 1418 - Paul Terry Walhus - springnet - 182 Clover Rd, TX 78612, USA - - web host and developer, videographer, blogger, vlogger - http://s3.amazonaws.com/twitter_production/profile_images/14044102/paulterrywalhus_normal.jpg - http://austincast.com/blog/ - false - 4328 - - - Sun May 04 18:47:02 +0000 2008 - 803344225 - optimal experience: John Erik Metcalf is a 24 year old entrepreneur living in Austin. What is he interes.. http://blog.think27.com/ - <a href="http://twitterfeed.com">twitterfeed</a> - false - - - - false - - - - 3148 - Chris Prakoso - - mahadewa - London, UK - Self-Proclaimed Geek, Mac Convert, C# by Day, Rails by Night, Cofee Drinker - http://s3.amazonaws.com/twitter_production/profile_images/52041617/avatar-greenteam_normal.jpg - http://blog.prakoso.net - false - - 535 - - Fri May 02 14:21:21 +0000 2008 - 801897248 - @rahadianagung :D - <a href="http://www.twhirl.org/">twhirl</a> - - false - 801895884 - 9882862 - false - - - - - 5567 - Robert Brook - robertbrook - London - - http://static.twitter.com/images/default_profile_normal.png - - http://robertbrook.com/ - false - 674 - - Sun May 04 20:00:09 +0000 2008 - 803379099 - - yeesh - I'm a polluter! http://skitch.com/yikes/k3kj/twitterrific - web - false - - - false - - - - - 5765 - Lisa McMillan - lisamac - Barrie, ON, Canada - Want me to follow you back? @ me. I'm not checking my requests due to spam :( - - http://s3.amazonaws.com/twitter_production/profile_images/50809942/Archives_normal.jpg - http://claimid.com/lisamac - false - 1968 - - Sun May 04 18:39:51 +0000 2008 - - 803340671 - I'm going to play ball hockey with the girls next year. Mar 09 I'm gonna kick ass. - web - false - - - false - - - - - 5977 - raja - raja - Toronto, ON - - computer scientist with a dislike for encapsulation in a single sentence. - http://s3.amazonaws.com/twitter_production/profile_images/14195882/IMG_1236_normal.jpg - http://socalledchange.com - false - 93 - - - Sun May 04 01:22:00 +0000 2008 - 802921230 - Out for dinner at #houseofchan in the village - web - false - - - - false - - - - 8906 - Daniel Morrison - - danielmorrison - Holland, MI - I write code between hanging out at conferences. - http://s3.amazonaws.com/twitter_production/profile_images/51898464/verygreenteam_template_normal.png - http://daniel.collectiveidea.com - false - - 322 - - Sun May 04 01:01:04 +0000 2008 - 802911879 - won $6.40 on the Derby, betting on Eight Belles to show. Now she's been euthanized. Kinda depressing. - web - - false - - - false - - - - 10560 - - David Bax - davidbax - - - http://s3.amazonaws.com/twitter_production/profile_images/14383112/db_logo80x80_normal.png - - true - - 2 - - Sun May 04 14:51:04 +0000 2008 - 803223094 - Is hoping this week goes a hell of a lot better then last week. - web - - false - - - false - - - - 10718 - - Geoffrey Grosenbach - topfunky - Seattle - Independent publisher, senior visionary - http://s3.amazonaws.com/twitter_production/profile_images/14408202/im_normal.gif - http://topfunky.com - - false - 1326 - - Sat May 03 21:08:55 +0000 2008 - 802811701 - The organic vegetable delivery service I subscribe to can also deliver doughnuts on request. This is dangerous. http://pioneerorganics.com - - web - false - - - false - - - - - 12543 - Scott Raymond - sco - Kansas City - I am sco, plain sco, in the morning, standing five foot ten in one sock. - - http://s3.amazonaws.com/twitter_production/profile_images/52622133/scott-face-128_normal.jpg - http://scottraymond.net/ - false - 481 - - Mon May 05 00:07:24 +0000 2008 - - 803492235 - mmm... flaming cheese. - web - false - - - false - - - - - 12551 - Brian Corrigan - bcorrigan78 - Ballston Spa, NY - - - http://s3.amazonaws.com/twitter_production/profile_images/52504423/41411337_d70e4d90eb_o_normal.jpg - http://www.generalexception.com - false - 9 - - Fri Apr 11 04:46:06 +0000 2008 - - 786952307 - going to bed - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 12587 - Luke Dorny - luxuryluke - - Long Beach, Calif - Look, sir. Droids! - http://s3.amazonaws.com/twitter_production/profile_images/53621570/RedMeatYourself-stubbo_normal.png - http://lukedorny.com - false - 810 - - - Sun May 04 23:37:04 +0000 2008 - 803478963 - @keasone & @aetherworld thanks! Enjoying my GET OLD DAY! - web - false - - 803424420 - 5630102 - false - - - - 12606 - - Bill - billturner - Pittsburgh, PA - - http://s3.amazonaws.com/twitter_production/profile_images/14743882/_yearbook__bturner_normal.jpg - http://brilliantcorners.org/ - - false - 128 - - Mon Apr 14 20:56:50 +0000 2008 - 789127310 - @artwells: sorry to hear! hope she pulls through fine! - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - 789119412 - 1552371 - false - - - - - 12661 - Adam Keys - therealadam - Dallas, TX - - Telling a joke, trying to or making a joke of myself. - http://s3.amazonaws.com/twitter_production/profile_images/52539922/shadesorange_normal.jpg - http://therealadam.com - false - 515 - - - Sun May 04 15:39:40 +0000 2008 - 803247750 - Seriously writing JavaScript for the first time in a long time. Prototypes abound! - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 12707 - Garrett Dimon - - garrettdimon - Dallas, TX - Building a bug and issue tracker to make life more pleasant for developers. - http://s3.amazonaws.com/twitter_production/profile_images/53317937/SmallAvatar_normal.jpg - http://www.garrettdimon.com - false - - 723 - - Fri May 02 15:30:41 +0000 2008 - 801949097 - It looks like a banana peel to me. Bananas are yellow too. http://tinyurl.com/64gjx3 - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - - - false - - - - 12741 - - Dan Rubin - danrubin - Ft Lauderdale Int'L Airport - designer, singer, human. note to clients: follow me at your own risk... - http://s3.amazonaws.com/twitter_production/profile_images/53213051/happy-webbies-headshot_normal.png - http://superfluousbanter.org - - false - 1490 - - Mon May 05 00:05:49 +0000 2008 - 803491554 - @stefsull I usually try to, but I couldn't coordinate these flights without a) packing for two trips (tough w/quartet stuff) and b) waiting. - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - 803471563 - 82433 - false - - - - - 12796 - William H Harle Jr. - wharle - South Bend, IN - - - http://s3.amazonaws.com/twitter_production/profile_images/14786702/smirking-bill_normal.jpg - http://90percentgravity.com - false - 42 - - Sat May 03 02:18:52 +0000 2008 - - 802341537 - Ironman was everything transformers wasnt. The most important thing being awesome. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 12938 - Steve Smith - - orderedlist - - - http://s3.amazonaws.com/twitter_production/profile_images/52246800/avatar_normal.jpg - http://orderedlist.com - false - 697 - - - Fri May 02 21:05:37 +0000 2008 - 802178798 - Am in need of beer and Mario Kart style relaxation. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - - - 13229 - - Sandy - s - Portland, OR - I'm Sandy, your personal email assistant. I'll remember the details so you can focus on what's important. Twitter me directly with: d s hi - http://s3.amazonaws.com/twitter_production/profile_images/32694302/sandy_circle_normal.png - http://iwantsandy.com/ - - false - 5152 - - Wed Dec 19 23:50:43 +0000 2007 - 515972382 - I'm fully twitterized! (iwantsandy.com/help/twitter) d s reminder leave in 5 mins * d s lookup today * d s update #1 4-5pm * d s forget #1 - - web - false - - - false - - - - - 13346 - Seth - mojodna - Davis, CA - - http://s3.amazonaws.com/twitter_production/profile_images/14880742/avatar_normal.jpg - - - true - 73 - - Sun May 04 22:55:17 +0000 2008 - 803460336 - @rabble is telling me about his 13-month old (Camilo) who plays Wii Tennis. - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - 803411438 - 22 - false - - - - - 13518 - Jesse Newland - jnewland - Atlanta, GA - - Ruby/Rails hacker, IT Director at LexBlog - http://s3.amazonaws.com/twitter_production/profile_images/14914212/PageImage-79509-344229_normal.jpg - http://jnewland.com - false - 370 - - - Sat May 03 19:09:37 +0000 2008 - 802757807 - so, does lighthouse really not have RSS/Atom feeds of ticket bins? Or am I just not looking hard enough? - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 13647 - Matt Klawitter - - mattklawitter - - - http://s3.amazonaws.com/twitter_production/profile_images/14944452/17883645_N00_normal.jpg - http://www.mattklawitter.com - true - 15 - - - Sun May 04 21:02:57 +0000 2008 - 803409155 - Took 65 home from Indy instead of 31. Was faster. No Kokomo madness. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - - - 15323 - - Carrie Smith - Carrie - Mishawaka, Indiana - - http://static.twitter.com/images/default_profile_normal.png - - false - - 12 - - Wed Aug 15 01:34:30 +0000 2007 - 206466992 - mourning the lost of most of the music on my ipod :( - web - - false - - - false - - - - 18713 - - Alex Payne - al3x - San Francisco, CA - Oh, hi. No, I just work here. - http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg - http://www.al3x.net - - false - 2891 - - Sun May 04 23:08:51 +0000 2008 - 803466127 - Automating everything. Ev-er-y-thing. Even that. - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - - - - 19413 - Hendy Irawan - ceefour - Kediri, Jawa Timur, Indonesia - Handsome web developer :-) - - http://s3.amazonaws.com/twitter_production/profile_images/15077872/Hendy_01-09-2006_10-57-04_normal.jpg - http://www.hendyirawan.web.id/ - false - 143 - - Sat Apr 26 13:29:32 +0000 2008 - - 797437821 - @ariekeren is there git submodule? is there piston for git? - im - false - 797417169 - 7462822 - - false - - - - 24013 - Matt Herzberger - mherzber - - College Station, TX - Social Media in Higher Ed Evangelist, Do'er, Organizer - http://s3.amazonaws.com/twitter_production/profile_images/46971312/Matt_sm_normal.jpg - http://mattherzberger.com - false - 502 - - - Fri May 02 20:48:55 +0000 2008 - 802168478 - @bradjward i think its funny that everyone thinks u write all the post, i mean u do 90% of them, u need a &lt;h1&gt; with brad didnt wri ... - web - true - - 802167787 - 6928362 - false - - - diff --git a/spec/fixtures/friend_ids.xml b/spec/fixtures/friend_ids.xml deleted file mode 100644 index 4d9c62ca3..000000000 --- a/spec/fixtures/friend_ids.xml +++ /dev/null @@ -1,12 +0,0 @@ - - -1192 -780561 -10718 -750823 -643443 -813198 -13046 -147093 - - diff --git a/spec/fixtures/friends.xml b/spec/fixtures/friends.xml deleted file mode 100644 index 607d19b2a..000000000 --- a/spec/fixtures/friends.xml +++ /dev/null @@ -1,609 +0,0 @@ - - - - 20 - Evan Williams - ev - San Francisco, CA, US - Founder of Obvious - - http://s3.amazonaws.com/twitter_production/profile_images/14019652/ev-sky_normal.jpg - http://evhead.com - false - 11462 - - Sun May 04 19:46:01 +0000 2008 - - 803372400 - Experiencing Philz Coffee for the first time. It's 2 blocks from my house. Don't know what took me so long. - web - false - - - false - - - - - 246 - Blaine Cook - blaine - San Francisco - - TwitterInterpreter. - http://s3.amazonaws.com/twitter_production/profile_images/14022002/171593560_00e00bc7c9_normal.jpg - http://romeda.org/ - false - 2766 - - - Sat May 03 01:36:56 +0000 2008 - 802321308 - Agreement in the house: Sarah Polley kissing Scarlet Johannsen on the back of the neck is pretty much as hot as humans get. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 8906 - Daniel Morrison - - danielmorrison - Holland, MI - I write code between hanging out at conferences. - http://s3.amazonaws.com/twitter_production/profile_images/51898464/verygreenteam_template_normal.png - http://daniel.collectiveidea.com - false - - 321 - - Sun May 04 01:01:04 +0000 2008 - 802911879 - won $6.40 on the Derby, betting on Eight Belles to show. Now she's been euthanized. Kinda depressing. - web - - false - - - false - - - - 10718 - - Geoffrey Grosenbach - topfunky - Seattle - Independent publisher, senior visionary - http://s3.amazonaws.com/twitter_production/profile_images/14408202/im_normal.gif - http://topfunky.com - - false - 1326 - - Sat May 03 21:08:55 +0000 2008 - 802811701 - The organic vegetable delivery service I subscribe to can also deliver doughnuts on request. This is dangerous. http://pioneerorganics.com - - web - false - - - false - - - - - 12196 - Wilson Miner - wilsonminer - San Francisco, CA - The windy man, the long mover. - - http://s3.amazonaws.com/twitter_production/profile_images/47103512/wilson-sharp-bright_normal.jpg - http://www.wilsonminer.com/ - false - 462 - - Sun May 04 17:31:24 +0000 2008 - - 803305925 - Apparently the downloadable content for GTA4 is going to be entirely new cities. Ridiculous. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 12543 - Scott Raymond - sco - - Kansas City - I am sco, plain sco, in the morning, standing five foot ten in one sock. - http://s3.amazonaws.com/twitter_production/profile_images/52622133/scott-face-128_normal.jpg - http://scottraymond.net/ - false - 480 - - - Sun May 04 19:09:14 +0000 2008 - 803354922 - enjoying a long walk through midtown. - web - false - - - - false - - - - 12606 - Bill - - billturner - Pittsburgh, PA - - http://s3.amazonaws.com/twitter_production/profile_images/14743882/_yearbook__bturner_normal.jpg - http://brilliantcorners.org/ - false - - 128 - - Mon Apr 14 20:56:50 +0000 2008 - 789127310 - @artwells: sorry to hear! hope she pulls through fine! - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - 789119412 - 1552371 - false - - - - - 12661 - Adam Keys - therealadam - Dallas, TX - Telling a joke, trying to or making a joke of myself. - http://s3.amazonaws.com/twitter_production/profile_images/52539922/shadesorange_normal.jpg - - http://therealadam.com - false - 515 - - Sun May 04 15:39:40 +0000 2008 - 803247750 - - Seriously writing JavaScript for the first time in a long time. Prototypes abound! - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - - - - 12707 - Garrett Dimon - garrettdimon - Dallas, TX - - Building a bug and issue tracker to make life more pleasant for developers. - http://s3.amazonaws.com/twitter_production/profile_images/53317937/SmallAvatar_normal.jpg - http://www.garrettdimon.com - false - 722 - - - Fri May 02 15:30:41 +0000 2008 - 801949097 - It looks like a banana peel to me. Bananas are yellow too. http://tinyurl.com/64gjx3 - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 12741 - Dan Rubin - - danrubin - Jacksonville Intl Airport - designer, singer, human. note to clients: follow me at your own risk... - http://s3.amazonaws.com/twitter_production/profile_images/53213051/happy-webbies-headshot_normal.png - http://superfluousbanter.org - false - - 1490 - - Sun May 04 17:42:20 +0000 2008 - 803311489 - landed back in Fort Lauderdale, now a few hours until I fly to Chicago. Maybe this wasn't such a good idea... - <a href="http://www.hahlo.com/">Hahlo</a> - - false - - - false - - - - 12796 - - William H Harle Jr. - wharle - South Bend, IN - - http://s3.amazonaws.com/twitter_production/profile_images/14786702/smirking-bill_normal.jpg - http://90percentgravity.com - - false - 42 - - Sat May 03 02:18:52 +0000 2008 - 802341537 - Ironman was everything transformers wasnt. The most important thing being awesome. - - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - false - - - - - 12938 - Steve Smith - orderedlist - - - - http://s3.amazonaws.com/twitter_production/profile_images/52246800/avatar_normal.jpg - http://orderedlist.com - false - 697 - - Fri May 02 21:05:37 +0000 2008 - - 802178798 - Am in need of beer and Mario Kart style relaxation. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 13229 - Sandy - - s - Portland, OR - I'm Sandy, your personal email assistant. I'll remember the details so you can focus on what's important. Twitter me directly with: d s hi - http://s3.amazonaws.com/twitter_production/profile_images/32694302/sandy_circle_normal.png - http://iwantsandy.com/ - false - - 5150 - - Wed Dec 19 23:50:43 +0000 2007 - 515972382 - I'm fully twitterized! (iwantsandy.com/help/twitter) d s reminder leave in 5 mins * d s lookup today * d s update #1 4-5pm * d s forget #1 - web - - false - - - false - - - - 13518 - - Jesse Newland - jnewland - Atlanta, GA - Ruby/Rails hacker, IT Director at LexBlog - http://s3.amazonaws.com/twitter_production/profile_images/14914212/PageImage-79509-344229_normal.jpg - http://jnewland.com - - false - 369 - - Sat May 03 19:09:37 +0000 2008 - 802757807 - so, does lighthouse really not have RSS/Atom feeds of ticket bins? Or am I just not looking hard enough? - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - - - - 13647 - Matt Klawitter - mattklawitter - - - - http://s3.amazonaws.com/twitter_production/profile_images/14944452/17883645_N00_normal.jpg - http://www.mattklawitter.com - true - 15 - - Sun May 04 21:02:57 +0000 2008 - - 803409155 - Took 65 home from Indy instead of 31. Was faster. No Kokomo madness. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 14763 - Ryan Carson - - ryancarson - Bath, UK - I'm an American in Britain, running a small web company with my amazing wife. - http://s3.amazonaws.com/twitter_production/profile_images/14988892/ryan-head_normal.jpg - http://www.carsonified.com - false - - 2448 - - Sun May 04 12:48:11 +0000 2008 - 803168392 - Might go test drive a Prius today. Any tips? Prius vs. Civic (hybrid)? - web - - false - - - false - - - - 15323 - - Carrie Smith - Carrie - Mishawaka, Indiana - - http://static.twitter.com/images/default_profile_normal.png - - false - - 12 - - Wed Aug 15 01:34:30 +0000 2007 - 206466992 - mourning the lost of most of the music on my ipod :( - web - - false - - - false - - - - 18713 - - Alex Payne - al3x - San Francisco, CA - Oh, hi. No, I just work here. - http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg - http://www.al3x.net - - false - 2889 - - Sun May 04 22:38:39 +0000 2008 - 803453211 - @5dots Yes. Give me about 8 hours. *sigh* - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - 803450314 - 618923 - false - - - - - 33493 - Peter Cooper - peterc - Louth, UK - - Media Scientist - http://s3.amazonaws.com/twitter_production/profile_images/53691597/Picture_2_normal.png - http://www.petercooper.co.uk/ - false - 689 - - - Sun May 04 10:15:39 +0000 2008 - 803117266 - The new E4 comedy "The Inbetweeners" is really, really good! - web - false - - - - false - - - - 38353 - Bruce Williams - - wbruce - Austin, TX - Syntax Herder, Bezier Curve Wrangler. - http://s3.amazonaws.com/twitter_production/profile_images/52941014/headshot-2008-04-16-01_normal.jpg - http://codefluency.com - false - - 335 - - Sat May 03 16:04:23 +0000 2008 - 802662902 - just caught up on 30 Rock, resolving @therealadam's ghostbusters reference. It wasn't random after all. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - - - false - - - - 46413 - - Status Updates - twitter_status - Inside the Twitter - 140 characters or less on the health of Twitter! - http://s3.amazonaws.com/twitter_production/profile_images/36881322/twttr_eng_normal.gif - - - false - 8489 - - Fri May 02 07:43:07 +0000 2008 - 801705083 - The database is up, but still having problems. We're working on that right now. - - web - false - - - false - - - - - 52163 - William Lindmeier - wdlindmeier - san francisco - Web Developer - - http://s3.amazonaws.com/twitter_production/profile_images/16018682/me_normal.jpg - http://www.wdlindmeier.com - false - 76 - - Thu Jan 18 03:28:47 +0000 2007 - - 3208173 - Install required dependency hoe? [Yn] - web - false - - - false - - - - - 75413 - Marcus Crafter - crafterm - Melbourne, Australia - - - http://s3.amazonaws.com/twitter_production/profile_images/34672812/IMG_3750_normal.jpg - http://crafterm.net/blog - false - 130 - - Sun May 04 01:25:13 +0000 2008 - - 802922601 - looking forward to a relaxing sunday - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 389153 - Dan Webb - danwrong - - London - Shaolin Monk Reservist - http://s3.amazonaws.com/twitter_production/profile_images/17729242/avatar_normal.jpg - http://www.danwebb.net - false - 268 - - - Fri May 02 11:34:08 +0000 2008 - 801796124 - having an xbox on oyur desk is bad for productivity - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - - - 482253 - Joe Lyphout - - jlyphout - Mishawaka, IN - - http://s3.amazonaws.com/twitter_production/profile_images/17925302/monkey_with_glasses_normal.jpg - - true - 13 - - - Thu Apr 24 02:58:12 +0000 2008 - 795630487 - @oaknd1 - I would blame Citibank's website issues on Ron Powlus - web - false - - 795440282 - 3038211 - false - - - diff --git a/spec/fixtures/friends_for.xml b/spec/fixtures/friends_for.xml deleted file mode 100644 index ee5eaf7cf..000000000 --- a/spec/fixtures/friends_for.xml +++ /dev/null @@ -1,584 +0,0 @@ - - - - 12 - Jack Dorsey - jack - San Francisco - A sailor, a tailor. - - http://s3.amazonaws.com/twitter_production/profile_images/53177776/BEBLP4LQp84znz5jKJYwaXLv_400_normal.jpg - http://gu.st/ - false - 4963 - - Sat May 03 18:33:02 +0000 2008 - - 802740112 - happy birthday 2 my dad1 - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 13 - Biz Stone - - biz - Berkeley, CA - Co-founder of Twitter - http://s3.amazonaws.com/twitter_production/profile_images/51940538/blue_team_biz_normal.png - http://www.bizstone.com - false - - 9822 - - Sun May 04 17:06:40 +0000 2008 - 803292952 - micro-loaning on kiva.org - web - - false - - - false - - - - 15 - - crystal - crystal - San Francisco - loves music, loves to dance. - http://s3.amazonaws.com/twitter_production/profile_images/53513404/photo_normal.jpg - - - false - 2534 - - Sun May 04 19:13:40 +0000 2008 - 803357051 - Waiting for Jason to finish his beauty shower at the gym. The scrap-like forgot-my-hundies alternative for sale: Commando "it's better t ... - - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - true - - - false - - - - - 17 - Tony Stubblebine - tonystubblebine - Mill Valley, CA - - - http://s3.amazonaws.com/twitter_production/profile_images/14019552/profile_normal.jpg - http://www.stubbleblog.com/ - false - 1399 - - Sun May 04 18:58:31 +0000 2008 - - 803349865 - At maker faire. Recommend parking on city streets and walking in - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 18 - Adam Rugel - - Adam - - Founder of 71Miles.com - http://s3.amazonaws.com/twitter_production/profile_images/14019602/mea_normal.jpg - http://71miles.com - false - - 1343 - - Mon May 05 00:09:04 +0000 2008 - 803492940 - montecito country club, swakny. groom doing fake runaway-brides sprints in parking lot - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - - - 21 - - Dom Sagolla - dom - San Francisco, CA - Ye Olde Twttr user #21 - http://s3.amazonaws.com/twitter_production/profile_images/51760572/318766470_d9340c5b83_normal.jpg - http://Dom.net - - false - 1400 - - Sun May 04 17:26:44 +0000 2008 - 803303599 - Baby Leo just failed his Save vs. Lullaby. - - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - false - - - - - 23 - Tim Roberts - timroberts - San Francisco - Thinking crazy thoughts - - http://s3.amazonaws.com/twitter_production/profile_images/14019802/evel_normal.jpg - - false - 568 - - Tue Sep 04 23:19:38 +0000 2007 - 247466642 - - digging out from being away for a week. how stuff piles up. - web - false - - - false - - - - - 47 - kellan - kellan - - - - http://s3.amazonaws.com/twitter_production/profile_images/14020052/20070522-517918392-love_this_shot_s_normal.jpg - http://laughingmeme.org - false - 742 - - Sun May 04 06:19:11 +0000 2008 - - 803043467 - OAuth is really boring. The fact that we *designed* it to be boring doesn't make it any easier to talk about. - web - false - - - false - - - - - 52 - Hook - hook - Huntington Beach - - Mover and shaker - I like Irish Pubs and Brew Pubs. I work in Financial Services and ride Harley's. Snowboarding is fun (but I need to get better). - http://s3.amazonaws.com/twitter_production/profile_images/14020102/Scott_Twitter_normal.jpg - - false - 438 - - Sat May 03 14:59:24 +0000 2008 - - 802627573 - looking for furniture restoration in huntington Beach area - anyone know a place? Need to restore old rocking chair. - web - false - - - false - - - - - 53 - sara - sara - san francisco, ca - - - http://s3.amazonaws.com/twitter_production/profile_images/14020152/yo_normal.jpg - http://saramorishige.com - false - 1715 - - Sun May 04 19:00:44 +0000 2008 - - 803350958 - I won a mermaid! - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 57 - SarahM - - SarahM - - into dogs and shoes. and really good food. - http://s3.amazonaws.com/twitter_production/profile_images/14020252/profilepic_normal.jpg - http://www.bicoastalist.com - false - - 954 - - Sun May 04 00:19:58 +0000 2008 - 802894272 - Who's spending mid-June to mid-July in NYC this summer? We are! - web - - false - - - false - - - - 61 - - Dan - dan - San Francisco, CA - I've got an opinion for every occasion. - http://s3.amazonaws.com/twitter_production/profile_images/14020502/464202_normal.jpg - http://archfear.com/ - - false - 703 - - Mon May 05 00:09:44 +0000 2008 - 803493221 - Trying to get some work done at Maxfield's. If you're in the hood, stop by. - - im - false - - - false - - - - - 64 - Livia - livia - Berkeley - wildlife rehabber - - http://s3.amazonaws.com/twitter_production/profile_images/52032237/LIVVYPIC_normal.jpg - - false - 698 - - Sun May 04 16:37:41 +0000 2008 - 803277970 - - Watching previews on imdb which are, sadly, better than the actual movies most of the time - web - false - - - false - - - - - 66 - Dunstan - dunstan - San Francisco, California - - - http://s3.amazonaws.com/twitter_production/profile_images/36710592/68756453_N00_normal.jpg - http://1976design.com/ - false - 1842 - - Sun May 04 17:21:07 +0000 2008 - - 803300832 - Finished slow-motion test on Flickr http://flickr.com/photos/dunstan/2464827854/ and Vimeo http://www.vimeo.com/973455 - web - false - - - false - - - - - 87 - Krissy - krissy - San Francisco - - it takes all kinds - http://s3.amazonaws.com/twitter_production/profile_images/53669368/Photo_1_normal.jpg - http://www.flickr.com/photos/kreesy25 - false - 1460 - - - Sat May 03 06:07:27 +0000 2008 - 802438488 - Oh how I have failed - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 94 - Alissa - - alissa - San Francisco, CA - bipedal humanoid - http://s3.amazonaws.com/twitter_production/profile_images/31274612/icon2_normal.png - - false - - 903 - - Sun May 04 02:43:09 +0000 2008 - 802957051 - Enjoying an evening of nyrdom at maker faire. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - - - 107 - - Philip Kaplan - pud - San Francisco, CA - - http://s3.amazonaws.com/twitter_production/profile_images/14021052/pk_orange_shirt_normal.jpg - http://www.pud.com - - false - 1029 - - Sun May 04 23:51:58 +0000 2008 - 803485452 - Sick, recovering, need soup and a blanket. - - web - false - - - false - - - - - 108 - ilona - ilona - - - http://static.twitter.com/images/default_profile_normal.png - - - false - 277 - - Sat Apr 26 22:40:03 +0000 2008 - 797704604 - of all the classy magazines to choose from, i go for the ryan seacrest cover story. - - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - false - - - - - 150 - Steve Jenson - stevej - San Francisco, CA - Programming ascetic, former Googler, and all-around fun dude tricked into working on Twitter. - - http://s3.amazonaws.com/twitter_production/profile_images/52441150/patch_bunny_slippers_normal.jpg - http://saladwithsteve.com/ - false - 699 - - Sat May 03 21:51:57 +0000 2008 - - 802830170 - The monorail was out of service for the return trip from the SciFi museum so we had to walk back. The future is not here yet. - web - false - - - false - - - - - 224 - Dave - davepell - - - - http://s3.amazonaws.com/twitter_production/profile_images/14021702/herschpass_normal.jpg - - false - 162 - - Fri Apr 18 07:24:25 +0000 2008 - - 791670185 - So the project is fun, eh? Muwahahaha. - web - false - - - false - - - - - 246 - Blaine Cook - blaine - San Francisco - - TwitterInterpreter. - http://s3.amazonaws.com/twitter_production/profile_images/14022002/171593560_00e00bc7c9_normal.jpg - http://romeda.org/ - false - 2765 - - - Sun May 04 23:36:14 +0000 2008 - 803478581 - Listening to Umberto Eco trashing the lack of intellectual discrimination on the web. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - - - 257 - rael - - rael - Portland, OR - http://www.valuesofn.com/peeps.html - http://s3.amazonaws.com/twitter_production/profile_images/14022052/raeldornfest_normal.jpg - http://www.valuesofn.com/blog - false - - 1446 - - Sat May 03 02:19:26 +0000 2008 - 802341813 - bar camp, portland - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - - - 291 - - Jason Goldman - goldman - San Francisco, CA - Flipped my wig at age 22 and it never grew back. - http://s3.amazonaws.com/twitter_production/profile_images/52289959/image_5_94_2_2_normal.jpg - http://goldtoe.net - - false - 2114 - - Sun May 04 02:38:06 +0000 2008 - 802954917 - MSFT; no soup. YHOO; sort of a cold soup but at least it's theirs. GOOG; chunky fat stew. - - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - false - - - - - 292 - Chris Wetherell - cw - - - - http://s3.amazonaws.com/twitter_production/profile_images/14022652/me-small_normal.jpg - http://massless.org/ - false - 2040 - - Sun May 04 21:45:16 +0000 2008 - - 803428787 - The awesome, crunchy, bullet-ridden, sleazy, scene-munching, tongue-in-cheek gun ride that's Shoot 'Em Up is NOT a play-in-background flick. - web - false - - - false - - - - diff --git a/spec/fixtures/friends_lite.xml b/spec/fixtures/friends_lite.xml deleted file mode 100644 index 4451f1c53..000000000 --- a/spec/fixtures/friends_lite.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - 20 - Evan Williams - ev - San Francisco, CA, US - Founder of Obvious - - http://s3.amazonaws.com/twitter_production/profile_images/14019652/ev-sky_normal.jpg - http://evhead.com - false - 11462 - - - 246 - - Blaine Cook - blaine - San Francisco - TwitterInterpreter. - http://s3.amazonaws.com/twitter_production/profile_images/14022002/171593560_00e00bc7c9_normal.jpg - http://romeda.org/ - - false - 2766 - - - 8906 - Daniel Morrison - danielmorrison - - Holland, MI - I write code between hanging out at conferences. - http://s3.amazonaws.com/twitter_production/profile_images/51898464/verygreenteam_template_normal.png - http://daniel.collectiveidea.com - false - 321 - - - - 10718 - Geoffrey Grosenbach - topfunky - Seattle - Independent publisher, senior visionary - - http://s3.amazonaws.com/twitter_production/profile_images/14408202/im_normal.gif - http://topfunky.com - false - 1326 - - - 12196 - - Wilson Miner - wilsonminer - San Francisco, CA - The windy man, the long mover. - http://s3.amazonaws.com/twitter_production/profile_images/47103512/wilson-sharp-bright_normal.jpg - http://www.wilsonminer.com/ - - false - 462 - - - 12543 - Scott Raymond - sco - - Kansas City - I am sco, plain sco, in the morning, standing five foot ten in one sock. - http://s3.amazonaws.com/twitter_production/profile_images/52622133/scott-face-128_normal.jpg - http://scottraymond.net/ - false - 480 - - - - 12606 - Bill - billturner - Pittsburgh, PA - - - http://s3.amazonaws.com/twitter_production/profile_images/14743882/_yearbook__bturner_normal.jpg - http://brilliantcorners.org/ - false - 128 - - - 12661 - - Adam Keys - therealadam - Dallas, TX - Telling a joke, trying to or making a joke of myself. - http://s3.amazonaws.com/twitter_production/profile_images/52539922/shadesorange_normal.jpg - http://therealadam.com - - false - 515 - - - 12707 - Garrett Dimon - garrettdimon - - Dallas, TX - Building a bug and issue tracker to make life more pleasant for developers. - http://s3.amazonaws.com/twitter_production/profile_images/53317937/SmallAvatar_normal.jpg - http://www.garrettdimon.com - false - 722 - - - - 12741 - Dan Rubin - danrubin - Jacksonville Intl Airport - designer, singer, human. note to clients: follow me at your own risk... - - http://s3.amazonaws.com/twitter_production/profile_images/53213051/happy-webbies-headshot_normal.png - http://superfluousbanter.org - false - 1490 - - - 12796 - - William H Harle Jr. - wharle - South Bend, IN - - http://s3.amazonaws.com/twitter_production/profile_images/14786702/smirking-bill_normal.jpg - http://90percentgravity.com - - false - 42 - - - 12938 - Steve Smith - orderedlist - - - - http://s3.amazonaws.com/twitter_production/profile_images/52246800/avatar_normal.jpg - http://orderedlist.com - false - 697 - - - - 13229 - Sandy - s - Portland, OR - I'm Sandy, your personal email assistant. I'll remember the details so you can focus on what's important. Twitter me directly with: d s hi - - http://s3.amazonaws.com/twitter_production/profile_images/32694302/sandy_circle_normal.png - http://iwantsandy.com/ - false - 5151 - - - 13518 - - Jesse Newland - jnewland - Atlanta, GA - Ruby/Rails hacker, IT Director at LexBlog - http://s3.amazonaws.com/twitter_production/profile_images/14914212/PageImage-79509-344229_normal.jpg - http://jnewland.com - - false - 369 - - - 13647 - Matt Klawitter - mattklawitter - - - - http://s3.amazonaws.com/twitter_production/profile_images/14944452/17883645_N00_normal.jpg - http://www.mattklawitter.com - true - 15 - - diff --git a/spec/fixtures/friends_timeline.xml b/spec/fixtures/friends_timeline.xml deleted file mode 100644 index 4eef19212..000000000 --- a/spec/fixtures/friends_timeline.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - Sun May 04 21:59:52 +0000 2008 - 803435310 - Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - Sun May 04 20:38:39 +0000 2008 - 803397135 - This weekend's open-window apartment cleaning serenade to the corner of 4th & Harrison: My Morning Jacket. - web - false - - - false - - 18713 - Alex Payne - al3x - San Francisco, CA - Oh, hi. No, I just work here. - http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg - http://www.al3x.net - false - 2891 - - - - Sun May 04 19:46:01 +0000 2008 - 803372400 - Experiencing Philz Coffee for the first time. It's 2 blocks from my house. Don't know what took me so long. - web - false - - - false - - 20 - Evan Williams - ev - San Francisco, CA, US - Founder of Obvious - http://s3.amazonaws.com/twitter_production/profile_images/14019652/ev-sky_normal.jpg - http://evhead.com - false - 11463 - - - diff --git a/spec/fixtures/friendship_already_exists.xml b/spec/fixtures/friendship_already_exists.xml deleted file mode 100644 index 5ece13f7a..000000000 --- a/spec/fixtures/friendship_already_exists.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - /friendships/create/billymeltdown.xml - Could not follow user: billymeltdown is already on your list. - \ No newline at end of file diff --git a/spec/fixtures/friendship_created.xml b/spec/fixtures/friendship_created.xml deleted file mode 100644 index 97aa7879e..000000000 --- a/spec/fixtures/friendship_created.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - \ No newline at end of file diff --git a/spec/fixtures/public_timeline.xml b/spec/fixtures/public_timeline.xml deleted file mode 100644 index 743947c3b..000000000 --- a/spec/fixtures/public_timeline.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - Sun May 04 22:47:58 +0000 2008 - 803457203 - Assistindo o jogão pelo Google Earth... - <a href="http://www.twittermail.com/">TwitterMail</a> - - false - - - false - - 11155272 - Fabio Muniz - - FabioMuniz - Rio de Janeiro - Tudo começou numa tarde morna, há varios anos atrás… Ih, acabou o espaço. - http://s3.amazonaws.com/twitter_production/profile_images/52059492/penrose_normal.png - - - false - 52 - - - - Sun May 04 22:47:58 +0000 2008 - - 803457202 - @shaunsmithson congrats!!!!!!!!!!!!! - web - false - 803317303 - 14414467 - - false - - 808845 - Stephen Shields - sshields - - - - http://s3.amazonaws.com/twitter_production/profile_images/52364892/DSCF6198_normal.JPG - - false - 72 - - - - - Sun May 04 22:47:58 +0000 2008 - 803457201 - @hammerikaner Good deal. I'll think about where. Might try to see if MPR would let me have a little space for it... - web - false - 803454579 - - 789943 - false - - 2874241 - Jon Gordon - jongordon - - Alameda, CA - Public radio tech reporter - http://s3.amazonaws.com/twitter_production/profile_images/53746455/perrin_normal.jpeg - http://futuretense.publicradio.org - false - 267 - - - - - Sun May 04 22:47:58 +0000 2008 - 803457200 - Catholicism Beliefs - http://tinyurl.com/6hw7wz - Free to Join. 1000 - web - - false - - - false - - 14640028 - Warren Buffet - - linkomatic - - - http://s3.amazonaws.com/twitter_production/profile_images/53706162/Warren-Buffet_normal.jpg - - false - 31 - - - - - Sun May 04 22:47:57 +0000 2008 - 803457199 - @PacketRat: I hope you can find what your looking for without paying through the nose. - <a href="http://arsecandle.org/twadget/">Twadget</a> - - false - 803456509 - 7471282 - false - - 6300522 - - Daniel Osborne - ultima90 - Latrobe, PA - I am a medieval role playing gamer who is a daydream believer and a computer geek who supports Nintendo over all others. - http://s3.amazonaws.com/twitter_production/profile_images/23037872/CIMG0962__revised__normal.jpg - http://www.gamespot.com/users/Ultima90/ - - false - 91 - - - - Sun May 04 22:47:58 +0000 2008 - 803457198 - - basic social skills http://tinyurl.com/4rcrmk - <a href="http://twitterfeed.com">twitterfeed</a> - false - - - false - - - 14115858 - wrongplanet - wrongplanet - - I'm the http://wrongplanet.net twitterbot. Wrong Planet is the site for Autism and Asperger's. - http://s3.amazonaws.com/twitter_production/profile_images/51694349/wptip2_normal.gif - - http://wrongplanet.net - false - 77 - - - diff --git a/spec/fixtures/rate_limit_status.xml b/spec/fixtures/rate_limit_status.xml deleted file mode 100644 index 6464127fd..000000000 --- a/spec/fixtures/rate_limit_status.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 20 - 1214757610 - 2008-06-29T16:40:10+00:00 - 5 - diff --git a/spec/fixtures/search_result_info.yml b/spec/fixtures/search_result_info.yml deleted file mode 100644 index 687697ce1..000000000 --- a/spec/fixtures/search_result_info.yml +++ /dev/null @@ -1,147 +0,0 @@ ---- !map:Twitter::SearchResultInfo -results: -- !map:Twitter::SearchResult - text: "@jqr - wow. just really looked at httparty for first time - sweet! - have you been using that a lot?" - to_user_id: 176589 - to_user: jqr - from_user: baldwindavid - id: 1073680192 - from_user_id: 804487 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/67146299/before_400_normal.jpg - created_at: Tue, 23 Dec 2008 04:20:12 +0000 -- !map:Twitter::SearchResult - text: the httparty gem rocks my socks. no better way to consume web services in ruby. - to_user_id: - from_user: mildmojo - id: 1073135700 - from_user_id: 2090305 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/65215459/appicon_normal.png - created_at: Mon, 22 Dec 2008 22:20:43 +0000 -- !map:Twitter::SearchResult - text: It's an HTTParty and everyone is invited! - to_user_id: - from_user: mypheme - id: 1067975762 - from_user_id: 3067473 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/67872558/Picture_3_normal.png - created_at: Fri, 19 Dec 2008 22:09:23 +0000 -- !map:Twitter::SearchResult - text: dans la famille des clients http,vous connaissiez curb, httparty, mais connaissiez-vous httpclient ? http://dev.ctor.org/httpclient/ - to_user_id: - from_user: rubyfrance - id: 1064812719 - from_user_id: 70780 - iso_language_code: fr - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/51884877/twitter_normal.png - created_at: Thu, 18 Dec 2008 12:46:27 +0000 -- !map:Twitter::SearchResult - text: "@jnunemaker have you ever seen httparty get a Net::HTTPServerException: 411 "Length Required" back?" - to_user_id: 19106 - to_user: jnunemaker - from_user: techpickles - id: 1064375973 - from_user_id: 22902 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/64410494/Photo_9_normal.jpg - created_at: Thu, 18 Dec 2008 05:24:23 +0000 -- !map:Twitter::SearchResult - text: playing with the tumblr api, httparty style - to_user_id: - from_user: techpickles - id: 1064355666 - from_user_id: 22902 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/64410494/Photo_9_normal.jpg - created_at: Thu, 18 Dec 2008 05:07:59 +0000 -- !map:Twitter::SearchResult - text: Testing from HTTParty, awesome ruby gem that allows for easy access to APIs over http. - to_user_id: - from_user: simonreed - id: 1063822669 - from_user_id: 63911 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/53963586/fu_normal.jpg - created_at: Wed, 17 Dec 2008 23:21:34 +0000 -- !map:Twitter::SearchResult - text: It's an HTTParty and everyone is invited! - to_user_id: - from_user: bernsno - id: 1063277742 - from_user_id: 1495935 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/63820805/me_normal.gif - created_at: Wed, 17 Dec 2008 18:25:31 +0000 -- !map:Twitter::SearchResult - text: "[ruby] Using Context and Stump to HTTParty like a Wufoo" - to_user_id: - from_user: rubymentary - id: 1062068801 - from_user_id: 474717 - iso_language_code: en - profile_image_url: http://static.twitter.com/images/default_profile_normal.png - created_at: Wed, 17 Dec 2008 03:37:00 +0000 -- !map:Twitter::SearchResult - text: "net/http\xE3\x81\xAEwrapper\xE3\x81\xA0\xE3\x81\xA3\xE3\x81\x9F\xE3\x80\x82\xE3\x80\x82\xE3\x80\x82 > HTTParty re: http://ff.im/h1Dg" - to_user_id: - from_user: nahi - id: 1061821371 - from_user_id: 36221 - iso_language_code: "no" - profile_image_url: http://static.twitter.com/images/default_profile_normal.png - created_at: Wed, 17 Dec 2008 00:58:19 +0000 -- !map:Twitter::SearchResult - text: Using HTTParty to wrap the Wufoo form submit API, as we are switching the Ordered List contact form to Wufoo. - to_user_id: - from_user: jnunemaker - id: 1061117717 - from_user_id: 19106 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/61024905/black250_normal.jpg - created_at: Tue, 16 Dec 2008 18:25:28 +0000 -- !map:Twitter::SearchResult - text: Playing with HTTParty. Like it already. :) - to_user_id: - from_user: atog - id: 1058725999 - from_user_id: 21795 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/61430136/ikke_vierkant_normal.jpg - created_at: Mon, 15 Dec 2008 16:06:26 +0000 -- !map:Twitter::SearchResult - text: HTTParty is like sweet candy... - to_user_id: - from_user: levicole - id: 1055553905 - from_user_id: 111971 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/24274692/Photo_2_normal.jpg - created_at: Sat, 13 Dec 2008 17:52:01 +0000 -- !map:Twitter::SearchResult - text: "thinking httparty needs a bit of morph class generation magic: http://tinyurl.com/6774gz" - to_user_id: - from_user: delineator - id: 1054352107 - from_user_id: 102024 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/63867007/rob_64_64_normal.png - created_at: Fri, 12 Dec 2008 22:53:41 +0000 -- !map:Twitter::SearchResult - text: To use HTTParty, or just net/http? I'm going to have to change some headers, which means digging around. Hrm. - to_user_id: - from_user: HibiscuS4 - id: 1050622779 - from_user_id: 8780 - iso_language_code: en - profile_image_url: http://s3.amazonaws.com/twitter_production/profile_images/60311231/Photo_9_normal.jpg - created_at: Thu, 11 Dec 2008 04:13:06 +0000 -since_id: 0 -max_id: 1078578631 -refresh_url: ?since_id=1078578631&q=httparty -results_per_page: 15 -next_page: ?page=2&max_id=1078578631&q=httparty -completed_in: 0.018799 -page: 1 -query: httparty diff --git a/spec/fixtures/search_results.json b/spec/fixtures/search_results.json deleted file mode 100644 index 3415b2846..000000000 --- a/spec/fixtures/search_results.json +++ /dev/null @@ -1 +0,0 @@ -{"max_id"=>876733347, "since_id"=>0, "results"=>[{"text"=>"post using httparty.", "from_user"=>"yuweijun", "to_user_id"=>nil, "id"=>876203197, "iso_language_code"=>"en", "from_user_id"=>1170048, "created_at"=>"Sun, 03 Aug 2008 06:40:42 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"HTTParty: Quick Web Service Consumption From Any Ruby Class: HTTParty is a new Ruby library by Joh.. http://tinyurl.com/5cb8e8", "from_user"=>"delicious_prog", "to_user_id"=>nil, "id"=>875881978, "iso_language_code"=>"en", "from_user_id"=>468104, "created_at"=>"Sat, 02 Aug 2008 20:47:02 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/54388004/delicious.42px_normal.gif"}, {"text"=>"[4Rails] HTTParty: Quick Web Service Consumption From Any Ruby Class: HTTParty: Quick Web Serv.. http://tinyurl.com/5uemxj", "from_user"=>"bumperbody", "to_user_id"=>nil, "id"=>875828918, "iso_language_code"=>"en", "from_user_id"=>476491, "created_at"=>"Sat, 02 Aug 2008 19:16:19 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"[ruby] HTTParty: Quick Web Service Consumption From Any Ruby Class", "from_user"=>"rubymentary", "to_user_id"=>nil, "id"=>875761343, "iso_language_code"=>"en", "from_user_id"=>474717, "created_at"=>"Sat, 02 Aug 2008 17:26:19 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"[ruby: RubyInside] HTTParty: Quick Web Service Consumption From Any Ruby Class http://tinyurl.com/5gryre", "from_user"=>"devfunnel", "to_user_id"=>nil, "id"=>875732752, "iso_language_code"=>"en", "from_user_id"=>465190, "created_at"=>"Sat, 02 Aug 2008 16:44:21 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/53748400/dev-funnel-logo-shiny-50x50_normal.png"}, {"text"=>"using the excellent OpenLibrary API, via HTTParty - i do like it that people have thought i'd want to do this in advance!", "from_user"=>"degsy", "to_user_id"=>nil, "id"=>875690354, "iso_language_code"=>"en", "from_user_id"=>164367, "created_at"=>"Sat, 02 Aug 2008 15:43:58 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/56185617/degsy_normal.jpg"}, {"text"=>"httparty gem rocks", "from_user"=>"shenie", "to_user_id"=>nil, "id"=>874139770, "iso_language_code"=>"en", "from_user_id"=>271831, "created_at"=>"Thu, 31 Jul 2008 22:58:19 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/42362902/Photo_28_normal.jpg"}, {"text"=>"httparty  yup.  that is what i was missing", "from_user"=>"bryanl", "to_user_id"=>nil, "id"=>873839285, "iso_language_code"=>"en", "from_user_id"=>5167, "created_at"=>"Thu, 31 Jul 2008 17:15:51 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/57603306/Photo_26_normal.jpg"}, {"text"=>"@timhaines thanks for the link to HTTParty, Xero api consumer for contacts (at least the get part) now only takes 18 lines of code.", "from_user"=>"buildmaster", "to_user"=>"timhaines", "to_user_id"=>159881, "id"=>873222820, "iso_language_code"=>"en", "from_user_id"=>26548, "created_at"=>"Thu, 31 Jul 2008 02:29:02 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/51894576/gold_o_normal.jpg"}, {"text"=>"refactoring code from yesterdays example to use HTTParty", "from_user"=>"buildmaster", "to_user_id"=>nil, "id"=>873020059, "iso_language_code"=>"en", "from_user_id"=>26548, "created_at"=>"Wed, 30 Jul 2008 21:55:19 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/51894576/gold_o_normal.jpg"}, {"text"=>"delicious: It's an HTTParty and Everyone Is Invited! // RailsTips.org by John Nunemaker http://tinyurl.com/6774gz", "from_user"=>"top_web", "to_user_id"=>nil, "id"=>872810034, "iso_language_code"=>"en", "from_user_id"=>780201, "created_at"=>"Wed, 30 Jul 2008 17:48:25 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/55853305/web_normal.jpg"}, {"text"=>"d: It's an HTTParty and Everyone Is Invited! // RailsTips.org by John Nunemaker http://tinyurl.com/6774gz", "from_user"=>"top_dedist", "to_user_id"=>nil, "id"=>872809988, "iso_language_code"=>"en", "from_user_id"=>760334, "created_at"=>"Wed, 30 Jul 2008 17:48:20 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/55845227/dedist_normal.jpg"}, {"text"=>"[4Rails] It's an HTTParty and Everyone Is Invited! // RailsTips.org by John Nunemaker: It's an.. http://tinyurl.com/57wjn4", "from_user"=>"bumperbody", "to_user_id"=>nil, "id"=>872549387, "iso_language_code"=>"en", "from_user_id"=>476491, "created_at"=>"Wed, 30 Jul 2008 13:16:57 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"New blog post: Sinatra, Passenger, HTTParty: Small, Fast, Now http://ruby.tie-rack.org/?p=70", "from_user"=>"tierack", "to_user_id"=>nil, "id"=>872275405, "iso_language_code"=>"no", "from_user_id"=>98800, "created_at"=>"Wed, 30 Jul 2008 04:55:40 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/52166714/mvb200_normal.jpg"}, {"text"=>"Tonight we're gonna HTTParty like it's 1999! - Time to boogie on down and consume some webservices! http://httparty.rubyforge.org/", "from_user"=>"hunternield", "to_user_id"=>nil, "id"=>872086627, "iso_language_code"=>"en", "from_user_id"=>47386, "created_at"=>"Wed, 30 Jul 2008 00:12:47 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/52133648/Photo_59_normal.jpg"}], "results_per_page"=>15, "next_page"=>"?page=2&max_id=876733347&q=httparty+", "query"=>"httparty ", "page"=>1} \ No newline at end of file diff --git a/spec/fixtures/status.xml b/spec/fixtures/status.xml deleted file mode 100644 index b8023ce3d..000000000 --- a/spec/fixtures/status.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - Sun May 04 23:36:14 +0000 2008 - 803478581 - Listening to Umberto Eco trashing the lack of intellectual discrimination on the web. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - 246 - Blaine Cook - - blaine - San Francisco - TwitterInterpreter. - http://s3.amazonaws.com/twitter_production/profile_images/14022002/171593560_00e00bc7c9_normal.jpg - http://romeda.org/ - false - - 2765 - - diff --git a/spec/fixtures/user.xml b/spec/fixtures/user.xml deleted file mode 100644 index 22157989b..000000000 --- a/spec/fixtures/user.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - FFFFFF - 000000 - - 000000 - FD8C19 - F82500 - 109 - Sun Aug 13 22:56:06 +0000 2006 - 18 - -18000 - Indiana (East) - http://s3.amazonaws.com/twitter_production/profile_background_images/2349547/logo.jpg - false - false - false - 1981 - - Sun May 04 21:59:52 +0000 2008 - 803435310 - Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - diff --git a/spec/fixtures/user_timeline.xml b/spec/fixtures/user_timeline.xml deleted file mode 100644 index 1911084e7..000000000 --- a/spec/fixtures/user_timeline.xml +++ /dev/null @@ -1,465 +0,0 @@ - - - - Sun May 04 21:59:52 +0000 2008 - 803435310 - Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - - - false - - 4243 - John Nunemaker - - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - - 363 - - - - Sun May 04 17:46:45 +0000 2008 - 803313859 - recracking iphone cause i love me some mobilescrobbler, among other things. - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - - http://addictedtonew.com - false - 363 - - - - Sun May 04 17:16:47 +0000 2008 - - 803298454 - Nervously restoring my iphone. First time. Need to try out @jnewland's fireeagle auto updates. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - - false - - 4243 - John Nunemaker - jnunemaker - Indiana - - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Sun May 04 04:48:47 +0000 2008 - 803010119 - memcache is sweet. i'm amazed i haven't played with it for this long. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - - - false - - 4243 - John Nunemaker - - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - - 363 - - - - Sat May 03 21:45:41 +0000 2008 - 802827613 - Headed to steak and ale with steph to meet college roommate and his wife for dinner. - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - - http://addictedtonew.com - false - 363 - - - - Sat May 03 19:54:59 +0000 2008 - - 802778602 - Ruthlessly cleaning my desk. Zero clutter goal from here on out. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - 4243 - John Nunemaker - jnunemaker - Indiana - - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Sat May 03 18:20:17 +0000 2008 - 802734033 - @mattklawitter i'm jealous. hit a 3 for me. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - 802733703 - 13647 - false - - 4243 - - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - - false - 363 - - - - Sat May 03 17:28:09 +0000 2008 - 802707224 - - Home. Doing a bit of freelance catch up. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Sat May 03 17:08:24 +0000 2008 - 802696808 - Target with steph. No luck. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - 4243 - John Nunemaker - jnunemaker - - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Sat May 03 01:26:00 +0000 2008 - 802316223 - @lizsmc1 we have a tornado warning right now? where was sighting? - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - - false - 802314575 - 11485452 - false - - 4243 - - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - - false - 363 - - - - Fri May 02 22:48:52 +0000 2008 - 802237608 - - Mishawaka brewing company. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Fri May 02 18:06:57 +0000 2008 - 802062302 - Trim time. It's like hammer time but with trim. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - 4243 - John Nunemaker - - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - - 363 - - - - Fri May 02 15:34:27 +0000 2008 - 801951791 - Window shimming. - - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - - http://addictedtonew.com - false - 363 - - - - Fri May 02 15:14:33 +0000 2008 - - 801937014 - Lowes for more supplies. Wish it wasn't raining. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - 4243 - John Nunemaker - jnunemaker - Indiana - - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Fri May 02 14:22:52 +0000 2008 - 801898311 - Holding a new window in place while Brady gets nails. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - 4243 - John Nunemaker - - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - - 363 - - - - Fri May 02 13:24:41 +0000 2008 - 801857351 - @mwklawit yes. yes. yes. - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - 801846483 - 3672651 - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Fri May 02 09:11:58 +0000 2008 - 801737962 - Ironman == AWESOME!!! - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - false - - - - false - - 4243 - John Nunemaker - jnunemaker - - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - - - - Fri May 02 04:44:19 +0000 2008 - 801654740 - Never been at a movie with more clapping by the audience. - <a href="http://help.twitter.com/index.php?pg=kb.page&id=75">txt</a> - - false - - - false - - 4243 - John Nunemaker - - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - - 363 - - - - Fri May 02 04:25:55 +0000 2008 - 801648988 - @hreview Iron Man; totally AWESOME, never seen/heard so much clapping in a movie. ***** - - web - false - 787398088 - 14073831 - false - - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - - http://addictedtonew.com - false - 363 - - - diff --git a/spec/search_spec.rb b/spec/search_spec.rb deleted file mode 100644 index 594902913..000000000 --- a/spec/search_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -require File.dirname(__FILE__) + '/spec_helper.rb' - -describe Twitter::Search do - before do - @search = Twitter::Search.new - end - - it "should be able to initialize with a search term" do - Twitter::Search.new('httparty').query[:q].should include('httparty') - end - - it "should be able to specify from" do - @search.from('jnunemaker').query[:q].should include('from:jnunemaker') - end - - it "should be able to specify to" do - @search.to('jnunemaker').query[:q].should include('to:jnunemaker') - end - - it "should be able to specify referencing" do - @search.referencing('jnunemaker').query[:q].should include('@jnunemaker') - end - - it "should alias references to referencing" do - @search.references('jnunemaker').query[:q].should include('@jnunemaker') - end - - it "should alias ref to referencing" do - @search.ref('jnunemaker').query[:q].should include('@jnunemaker') - end - - it "should be able to specify containing" do - @search.containing('milk').query[:q].should include('milk') - end - - it "should alias contains to containing" do - @search.contains('milk').query[:q].should include('milk') - end - - it "should be able to specify hashed" do - @search.hashed('twitter').query[:q].should include('#twitter') - end - - it "should be able to specify the language" do - @search.lang('en').query[:lang].should == 'en' - end - - it "should be able to specify the number of results per page" do - @search.per_page(25).query[:rpp].should == 25 - end - - it "should be able to specify the page number" do - @search.page(20).query[:page].should == 20 - end - - it "should be able to specify only returning results greater than an id" do - @search.since(1234).query[:since_id].should == 1234 - end - - it "should be able to specify geo coordinates" do - @search.geocode('40.757929', '-73.985506', '25mi').query[:geocode].should == '40.757929,-73.985506,25mi' - end - - it "should be able to clear the filters set" do - @search.from('jnunemaker').to('oaknd1') - @search.clear.query.should == {:q => []} - end - - it "should be able to chain methods together" do - @search.from('jnunemaker').to('oaknd1').referencing('orderedlist').containing('milk').hashed('twitter').lang('en').per_page(20).since(1234).geocode('40.757929', '-73.985506', '25mi') - @search.query[:q].should == ['from:jnunemaker', 'to:oaknd1', '@orderedlist', 'milk', '#twitter'] - @search.query[:lang].should == 'en' - @search.query[:rpp].should == 20 - @search.query[:since_id].should == 1234 - @search.query[:geocode].should == '40.757929,-73.985506,25mi' - end - - describe "fetching" do - before do - @response = YAML.load_file(File.dirname(__FILE__) + '/fixtures/search_result_info.yml') - @search.class.stub!(:get).and_return(@response) - end - - it "should return results" do - @search.class.should_receive(:get).and_return(@response) - @search.from('jnunemaker').fetch().should == @response - end - - it "should support dot notation" do - @search.class.should_receive(:get).and_return(@response) - info = @search.from('httparty').fetch() - info["max_id"].should == info.max_id - info["results"].first["text"].should == info.results.first.text - end - end - - it "should be able to iterate over results" do - @search.respond_to?(:each).should == true - end -end \ No newline at end of file diff --git a/spec/spec.opts b/spec/spec.opts deleted file mode 100644 index cf6add7ea..000000000 --- a/spec/spec.opts +++ /dev/null @@ -1 +0,0 @@ ---colour \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index c8fa84460..000000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,23 +0,0 @@ -begin - require 'spec' -rescue LoadError - require 'rubygems' - gem 'rspec' - require 'spec' -end - -dir = File.dirname(__FILE__) - -$:.unshift(File.join(dir, '/../lib/')) -require dir + '/../lib/twitter' - - -def stdout_for(&block) - # Inspired by http://www.ruby-forum.com/topic/58647 - old_stdout = $stdout - $stdout = StringIO.new - yield - output = $stdout.string - $stdout = old_stdout - output -end \ No newline at end of file diff --git a/spec/status_spec.rb b/spec/status_spec.rb deleted file mode 100644 index 52805834a..000000000 --- a/spec/status_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require File.dirname(__FILE__) + '/spec_helper.rb' - -describe Twitter::Status do - it "should create new status from xml doc" do - xml = < - Sun May 04 21:59:52 +0000 2008 - 803435310 - Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back. - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - - - false - - 4243 - John Nunemaker - jnunemaker - Indiana - Loves his wife, ruby, notre dame football and iu basketball - http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg - http://addictedtonew.com - false - 363 - - -EOF - s = Twitter::Status.new_from_xml(Hpricot.XML(xml)) - s.id.should == '803435310' - s.created_at.should == 'Sun May 04 21:59:52 +0000 2008' - s.text.should == 'Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back.' - s.source.should == '<a href="http://iconfactory.com/software/twitterrific">twitterrific</a>' - s.truncated.should == false - s.in_reply_to_status_id.should == '' - s.in_reply_to_user_id.should == '' - s.favorited.should == false - s.user.id.should == '4243' - s.user.name.should == 'John Nunemaker' - end -end \ No newline at end of file diff --git a/spec/user_spec.rb b/spec/user_spec.rb deleted file mode 100644 index 3e1509ec3..000000000 --- a/spec/user_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require File.dirname(__FILE__) + '/spec_helper.rb' - -describe Twitter::User do - it "should create new user from xml doc" do - xml = < - 18713 - Alex Payne - al3x - San Francisco, CA - Oh, hi. No, I just work here. - http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg - http://www.al3x.net - false - 2889 - - Sun May 04 22:38:39 +0000 2008 - 803453211 - @5dots Yes. Give me about 8 hours. *sigh* - - <a href="http://iconfactory.com/software/twitterrific">twitterrific</a> - false - 803450314 - 618923 - false - - - -EOF - u = Twitter::User.new_from_xml(Hpricot.XML(xml)) - u.id.should == '18713' - u.name.should =='Alex Payne' - u.screen_name.should == 'al3x' - u.location.should == 'San Francisco, CA' - u.description.should == 'Oh, hi. No, I just work here.' - u.profile_image_url.should == 'http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg' - u.url.should == 'http://www.al3x.net' - u.protected.should == false - u.followers_count.should == '2889' - u.status.text.should == '@5dots Yes. Give me about 8 hours. *sigh*' - end -end \ No newline at end of file diff --git a/twitter.gemspec b/twitter.gemspec deleted file mode 100644 index 30a02b5ca..000000000 --- a/twitter.gemspec +++ /dev/null @@ -1,45 +0,0 @@ -# -*- encoding: utf-8 -*- - -Gem::Specification.new do |s| - s.name = %q{twitter} - s.version = "0.4.4" - - s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version= - s.authors = ["John Nunemaker"] - s.date = %q{2009-03-28} - s.default_executable = %q{twitter} - s.description = %q{a command line interface for twitter, also a library which wraps the twitter api} - s.email = %q{nunemaker@gmail.com} - s.executables = ["twitter"] - s.extra_rdoc_files = ["bin/twitter", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/search_result.rb", "lib/twitter/search_result_info.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "README"] - s.files = ["bin/twitter", "examples/blocks.rb", "examples/direct_messages.rb", "examples/favorites.rb", "examples/friends_followers.rb", "examples/friendships.rb", "examples/identica_timeline.rb", "examples/location.rb", "examples/posting.rb", "examples/replies.rb", "examples/search.rb", "examples/sent_messages.rb", "examples/timeline.rb", "examples/twitter.rb", "examples/verify_credentials.rb", "History", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/search_result.rb", "lib/twitter/search_result_info.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "License", "Manifest", "Rakefile", "README", "spec/base_spec.rb", "spec/cli/helper_spec.rb", "spec/direct_message_spec.rb", "spec/fixtures/follower_ids.xml", "spec/fixtures/followers.xml", "spec/fixtures/friend_ids.xml", "spec/fixtures/friends.xml", "spec/fixtures/friends_for.xml", "spec/fixtures/friends_lite.xml", "spec/fixtures/friends_timeline.xml", "spec/fixtures/friendship_already_exists.xml", "spec/fixtures/friendship_created.xml", "spec/fixtures/public_timeline.xml", "spec/fixtures/rate_limit_status.xml", "spec/fixtures/search_result_info.yml", "spec/fixtures/search_results.json", "spec/fixtures/status.xml", "spec/fixtures/user.xml", "spec/fixtures/user_timeline.xml", "spec/search_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/status_spec.rb", "spec/user_spec.rb", "twitter.gemspec", "website/css/common.css", "website/images/terminal_output.png", "website/index.html"] - s.has_rdoc = true - s.homepage = %q{http://twitter.rubyforge.org} - s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Twitter", "--main", "README"] - s.require_paths = ["lib"] - s.rubyforge_project = %q{twitter} - s.rubygems_version = %q{1.3.1} - s.summary = %q{a command line interface for twitter, also a library which wraps the twitter api} - - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 2 - - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0.6"]) - s.add_runtime_dependency(%q, [">= 2.1"]) - s.add_runtime_dependency(%q, [">= 0.2.4"]) - s.add_development_dependency(%q, [">= 0"]) - else - s.add_dependency(%q, [">= 0.6"]) - s.add_dependency(%q, [">= 2.1"]) - s.add_dependency(%q, [">= 0.2.4"]) - s.add_dependency(%q, [">= 0"]) - end - else - s.add_dependency(%q, [">= 0.6"]) - s.add_dependency(%q, [">= 2.1"]) - s.add_dependency(%q, [">= 0.2.4"]) - s.add_dependency(%q, [">= 0"]) - end -end