-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added several new methods such as #friendship_exists?, #update_locati…
…on, #update_delivery_device, #favorites, #create_favorite, #destroy_favorite, #block, #unblock. Broke backwords compatibility with all the methods that used lite or since as parameters. See note in History.txt for more info on that.
- Loading branch information
1 parent
7bb265c
commit eeca67c
Showing
17 changed files
with
337 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
require 'config/requirements' | ||
require 'config/hoe' # setup Hoe + all gem configuration | ||
|
||
Dir['tasks/**/*.rake'].each { |rake| load rake } | ||
Dir['tasks/**/*.rake'].each { |rake| load rake } | ||
|
||
task :build_gemspec_filelist do | ||
files = File.read(File.join(File.dirname(__FILE__), 'Manifest.txt')).split("\n") | ||
puts | ||
puts files.inspect | ||
puts | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 'SINCE' | ||
twitter.direct_messages(:since => Time.now - 5.day).each do |s| | ||
puts "- #{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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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 'FAVORITES' | ||
twitter.favorites.each { |f| puts f.text } | ||
puts | ||
puts | ||
|
||
puts 'CREATE' | ||
puts twitter.create_favorite(865416114).text | ||
puts | ||
puts | ||
|
||
puts 'DESTROY' | ||
puts twitter.destroy_favorite(865416114).text | ||
puts | ||
puts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 '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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 '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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 '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 => 865368201).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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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 |
Oops, something went wrong.