dschn-twitter 0.3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +106 -0
- data/License.txt +19 -0
- data/Manifest.txt +71 -0
- data/README.txt +84 -0
- data/Rakefile +4 -0
- data/bin/twitter +15 -0
- data/config/hoe.rb +74 -0
- data/config/requirements.rb +17 -0
- data/examples/blocks.rb +15 -0
- data/examples/direct_messages.rb +28 -0
- data/examples/favorites.rb +20 -0
- data/examples/friends_followers.rb +25 -0
- data/examples/friendships.rb +13 -0
- data/examples/identica_timeline.rb +7 -0
- data/examples/location.rb +8 -0
- data/examples/posting.rb +9 -0
- data/examples/replies.rb +26 -0
- data/examples/search.rb +17 -0
- data/examples/sent_messages.rb +26 -0
- data/examples/timeline.rb +33 -0
- data/examples/twitter.rb +27 -0
- data/examples/verify_credentials.rb +13 -0
- data/lib/twitter.rb +21 -0
- data/lib/twitter/base.rb +260 -0
- data/lib/twitter/cli.rb +328 -0
- data/lib/twitter/cli/config.rb +9 -0
- data/lib/twitter/cli/helpers.rb +97 -0
- data/lib/twitter/cli/migrations/20080722194500_create_accounts.rb +13 -0
- data/lib/twitter/cli/migrations/20080722194508_create_tweets.rb +16 -0
- data/lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb +9 -0
- data/lib/twitter/cli/migrations/20080722214606_create_configurations.rb +13 -0
- data/lib/twitter/cli/models/account.rb +33 -0
- data/lib/twitter/cli/models/configuration.rb +13 -0
- data/lib/twitter/cli/models/tweet.rb +20 -0
- data/lib/twitter/direct_message.rb +22 -0
- data/lib/twitter/easy_class_maker.rb +43 -0
- data/lib/twitter/rate_limit_status.rb +19 -0
- data/lib/twitter/search.rb +94 -0
- data/lib/twitter/status.rb +22 -0
- data/lib/twitter/user.rb +37 -0
- data/lib/twitter/version.rb +9 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/spec/base_spec.rb +109 -0
- data/spec/cli/helper_spec.rb +35 -0
- data/spec/direct_message_spec.rb +35 -0
- data/spec/fixtures/followers.xml +706 -0
- data/spec/fixtures/friends.xml +609 -0
- data/spec/fixtures/friends_for.xml +584 -0
- data/spec/fixtures/friends_lite.xml +192 -0
- data/spec/fixtures/friends_timeline.xml +66 -0
- data/spec/fixtures/public_timeline.xml +148 -0
- data/spec/fixtures/rate_limit_status.xml +7 -0
- data/spec/fixtures/search_results.json +1 -0
- data/spec/fixtures/status.xml +25 -0
- data/spec/fixtures/user.xml +38 -0
- data/spec/fixtures/user_timeline.xml +465 -0
- data/spec/search_spec.rb +89 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/status_spec.rb +40 -0
- data/spec/user_spec.rb +42 -0
- data/tasks/deployment.rake +50 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/twitter.gemspec +49 -0
- data/website/css/common.css +47 -0
- data/website/images/terminal_output.png +0 -0
- data/website/index.html +156 -0
- metadata +180 -0
data/History.txt
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
0.3.7 - August 26, 2008
|
2
|
+
* Fixed source param not getting through
|
3
|
+
|
4
|
+
0.3.6 - August 11, 2008
|
5
|
+
* Fixed a few more methods that required post.
|
6
|
+
* Refactored the remaining methods that were not using #request to use it.
|
7
|
+
|
8
|
+
0.3.5 - August 4, 2008
|
9
|
+
* Removed sqlite-ruby 1.2.2 as a dependency due to install issues on linux
|
10
|
+
|
11
|
+
0.3.4 - August 3, 2008
|
12
|
+
* Added search support
|
13
|
+
|
14
|
+
0.3.3 - August 3, 2008
|
15
|
+
* Now has option for host when initializing to support identi.ca (Dustin Sallings)
|
16
|
+
* Twitter changed a bunch of methods to POST only so I updated those to now work
|
17
|
+
|
18
|
+
0.3.2 - July 26, 2008
|
19
|
+
* added the CLI gems as dependencies for now until I separate out the CLI from the API wrapper
|
20
|
+
* cleaner CLI errors for no active account or no accounts at all
|
21
|
+
* remove sets a new active account if there are none
|
22
|
+
* added username and password optional arguments to add
|
23
|
+
* added import attempt on install and on anything that uses #current_account helper
|
24
|
+
|
25
|
+
0.3.1 - July 23, 2008
|
26
|
+
* added open to CLI twitter open jnunemaker would open default browser to http://twitter.com/jnunemaker
|
27
|
+
* added -f to timeline and replies which ignores the since_id and shows all results
|
28
|
+
* added clear_config to remove all cached since id's and such
|
29
|
+
* Majorly pimped the output of timelines and replies.
|
30
|
+
|
31
|
+
0.3.0 - July 22, 2008
|
32
|
+
* complete rewrite of CLI. Now supports multiple accounts and changing between them.
|
33
|
+
* added source, truncated, in_reply_to_status_id, in_reply_to_user_id, and favorited to Twitter::Status
|
34
|
+
* added protected to Twitter::User
|
35
|
+
* d CLI method now takes standard input like post
|
36
|
+
* Rewrote several methods that had since parameter to now use a hash instead. This makes it more flexible as API updates.
|
37
|
+
* Rewrote the methods that took lite or since as an argument to instead take a hash.
|
38
|
+
* added Twitter::Base#friendship_exists?
|
39
|
+
* added Twitter::Base#update_location
|
40
|
+
* added Twitter::Base#update_delivery_device
|
41
|
+
* added Twitter::Base#favorites
|
42
|
+
* added Twitter::Base#create_favorite
|
43
|
+
* added Twitter::Base#destroy_favorite
|
44
|
+
* added Twitter::Base#block
|
45
|
+
* added Twitter::Base#unblock
|
46
|
+
|
47
|
+
BACKWORDS COMPATIBILITY BREAK:
|
48
|
+
Any method that you have using lite or since as an argument
|
49
|
+
will no longer work with this version. Simply change to a
|
50
|
+
hash and you'll be fine. For example:
|
51
|
+
|
52
|
+
friends(true) would now be friends(:lite => true)
|
53
|
+
|
54
|
+
0.2.7 - June 29, 2008
|
55
|
+
* added #rate_limit_status (Daniel Morrison)
|
56
|
+
* added source parameter option to Base#post
|
57
|
+
* added twittergem as source when posting from command line
|
58
|
+
* Twitter::RateExceeded raised when you hit your limit (Jim O'Leary)
|
59
|
+
* Twitter::Unavailable raised when twitter returns 503
|
60
|
+
* Twitter::CantConnect is now more descriptive as to what is the problem when it is raised during a request
|
61
|
+
* quoting your message when using twitter post on the command line is now optional (Benoit Caccinolo)
|
62
|
+
* aliased post to p on command line so it's shorter (Benoit Caccinolo)
|
63
|
+
* unescaped html and added some color in command line view (Miles Z. Sterrett)
|
64
|
+
* added gemspec (technoweenie, Miles Z. Sterrett)
|
65
|
+
* Fixed stack trace error on first command line operation (Matt Rose)
|
66
|
+
0.2.6 - April 2, 2008
|
67
|
+
* found a more simple way of doing stdin without any extra gem dependencies
|
68
|
+
0.2.5 - April 2, 2008
|
69
|
+
* Command line interface can now use stdin for posting (ideas and example code from Jeremy Friesen)
|
70
|
+
$ twitter post 'test without stdin' # => twitters: test without stdin
|
71
|
+
$ echo 'test with stdin' | twitter post 'and an argv[1]' # => twitters: test with stdin and an argv[1]
|
72
|
+
$ echo 'test with stdin without any argv[1]' | twitter post # => twitters: test with stdin without any argv[1]
|
73
|
+
0.2.4 - Mar 31, 2008
|
74
|
+
* Added lite option to friends and followers, which doesn't include the user's current status (Daniel Morrison)
|
75
|
+
* Updated since option to use HTTP header, and added the option on timeline() and replies(). (Daniel Morrison)
|
76
|
+
0.2.3 - Jan 16, 2008
|
77
|
+
* added d to command line interface twitter d jnunemaker 'hola' (Humbucker)
|
78
|
+
* added progress dots when posting for confirmation when twitter is running slow (Hendy Irawan)
|
79
|
+
0.2.2 - added leave and follow which are new twitter api methods for turning notifications on and off
|
80
|
+
0.2.0 - Aug 4, 2007
|
81
|
+
* added sent_messages
|
82
|
+
* alias direct_messages to received_messages
|
83
|
+
* added create_friendship
|
84
|
+
* added destroy_friendship
|
85
|
+
* added featured to retrieve the featured twitter users
|
86
|
+
* added replies
|
87
|
+
* added destroy to destroy a status by id
|
88
|
+
* added status to find a status by id
|
89
|
+
* added active support as an extra dependency
|
90
|
+
* implemented d method to send direct messages (jnewland)
|
91
|
+
* fixed since argument in direct_messages method (jnewland)
|
92
|
+
0.1.1 - May 20, 2007
|
93
|
+
* hpricot 0.5+ now supported; just a bug fix (Ryan Waldron is the man!)
|
94
|
+
0.1.0 - March 31, 2007
|
95
|
+
* added d method for creating direct messages (waiting for it to work as documented)
|
96
|
+
* added featured method for getting featured users statuses (waiting for it to work as documented)
|
97
|
+
* added direct_messages method
|
98
|
+
* added friends_for method
|
99
|
+
* added a few tests
|
100
|
+
* removed relative_created_at as it is deprecated
|
101
|
+
* separated out the call method into call, request and parse methods
|
102
|
+
0.0.5 - just a bit of code cleanup
|
103
|
+
0.0.4 - added :location, :description, :url, :profile_image_url to user class (Alex Payne)
|
104
|
+
0.0.3 - added a bit more informative message when things go wrong
|
105
|
+
0.0.2 - added the command line options i forgot to add (friend and follower); improved some docs
|
106
|
+
0.0.1 - initial release
|
data/License.txt
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2007 John Nunemaker
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
History.txt
|
2
|
+
License.txt
|
3
|
+
Manifest.txt
|
4
|
+
README.txt
|
5
|
+
Rakefile
|
6
|
+
bin/twitter
|
7
|
+
config/hoe.rb
|
8
|
+
config/requirements.rb
|
9
|
+
examples/blocks.rb
|
10
|
+
examples/direct_messages.rb
|
11
|
+
examples/favorites.rb
|
12
|
+
examples/friends_followers.rb
|
13
|
+
examples/friendships.rb
|
14
|
+
examples/identica_timeline.rb
|
15
|
+
examples/location.rb
|
16
|
+
examples/posting.rb
|
17
|
+
examples/replies.rb
|
18
|
+
examples/search.rb
|
19
|
+
examples/sent_messages.rb
|
20
|
+
examples/timeline.rb
|
21
|
+
examples/twitter.rb
|
22
|
+
examples/verify_credentials.rb
|
23
|
+
lib/twitter.rb
|
24
|
+
lib/twitter/base.rb
|
25
|
+
lib/twitter/cli.rb
|
26
|
+
lib/twitter/cli/config.rb
|
27
|
+
lib/twitter/cli/helpers.rb
|
28
|
+
lib/twitter/cli/migrations/20080722194500_create_accounts.rb
|
29
|
+
lib/twitter/cli/migrations/20080722194508_create_tweets.rb
|
30
|
+
lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb
|
31
|
+
lib/twitter/cli/migrations/20080722214606_create_configurations.rb
|
32
|
+
lib/twitter/cli/models/account.rb
|
33
|
+
lib/twitter/cli/models/configuration.rb
|
34
|
+
lib/twitter/cli/models/tweet.rb
|
35
|
+
lib/twitter/direct_message.rb
|
36
|
+
lib/twitter/easy_class_maker.rb
|
37
|
+
lib/twitter/rate_limit_status.rb
|
38
|
+
lib/twitter/search.rb
|
39
|
+
lib/twitter/status.rb
|
40
|
+
lib/twitter/user.rb
|
41
|
+
lib/twitter/version.rb
|
42
|
+
script/destroy
|
43
|
+
script/generate
|
44
|
+
script/txt2html
|
45
|
+
setup.rb
|
46
|
+
spec/base_spec.rb
|
47
|
+
spec/cli/helper_spec.rb
|
48
|
+
spec/direct_message_spec.rb
|
49
|
+
spec/fixtures/followers.xml
|
50
|
+
spec/fixtures/friends.xml
|
51
|
+
spec/fixtures/friends_for.xml
|
52
|
+
spec/fixtures/friends_lite.xml
|
53
|
+
spec/fixtures/friends_timeline.xml
|
54
|
+
spec/fixtures/public_timeline.xml
|
55
|
+
spec/fixtures/rate_limit_status.xml
|
56
|
+
spec/fixtures/search_results.json
|
57
|
+
spec/fixtures/status.xml
|
58
|
+
spec/fixtures/user.xml
|
59
|
+
spec/fixtures/user_timeline.xml
|
60
|
+
spec/search_spec.rb
|
61
|
+
spec/spec.opts
|
62
|
+
spec/spec_helper.rb
|
63
|
+
spec/status_spec.rb
|
64
|
+
spec/user_spec.rb
|
65
|
+
tasks/deployment.rake
|
66
|
+
tasks/environment.rake
|
67
|
+
tasks/website.rake
|
68
|
+
twitter.gemspec
|
69
|
+
website/css/common.css
|
70
|
+
website/images/terminal_output.png
|
71
|
+
website/index.html
|
data/README.txt
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
= addicted to twitter
|
2
|
+
|
3
|
+
... a sweet little diddy that helps you twitter your life away
|
4
|
+
|
5
|
+
== Install
|
6
|
+
|
7
|
+
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
|
8
|
+
|
9
|
+
== Examples
|
10
|
+
|
11
|
+
Twitter::Base.new('your email', 'your password').update('watching veronica mars')
|
12
|
+
|
13
|
+
# or you can use post
|
14
|
+
Twitter::Base.new('your email', 'your password').post('post works too')
|
15
|
+
|
16
|
+
puts "Public Timeline", "=" * 50
|
17
|
+
Twitter::Base.new('your email', 'your password').timeline(:public).each do |s|
|
18
|
+
puts s.text, s.user.name
|
19
|
+
puts
|
20
|
+
end
|
21
|
+
|
22
|
+
puts '', "Friends Timeline", "=" * 50
|
23
|
+
Twitter::Base.new('your email', 'your password').timeline.each do |s|
|
24
|
+
puts s.text, s.user.name
|
25
|
+
puts
|
26
|
+
end
|
27
|
+
|
28
|
+
puts '', "Friends", "=" * 50
|
29
|
+
Twitter::Base.new('your email', 'your password').friends.each do |u|
|
30
|
+
puts u.name, u.status.text
|
31
|
+
puts
|
32
|
+
end
|
33
|
+
|
34
|
+
puts '', "Followers", "=" * 50
|
35
|
+
Twitter::Base.new('your email', 'your password').followers.each do |u|
|
36
|
+
puts u.name, u.status.text
|
37
|
+
puts
|
38
|
+
end
|
39
|
+
|
40
|
+
== Search Examples
|
41
|
+
|
42
|
+
Twitter::Search.new('httparty').each { |r| puts r.inspect }
|
43
|
+
Twitter::Search.new('httparty').from('jnunemaker').each { |r| puts r.inspect }
|
44
|
+
Twitter::Search.new.from('jnunemaker').to('oaknd1').each { |r| puts r.inspect }
|
45
|
+
|
46
|
+
|
47
|
+
== Command Line Use
|
48
|
+
|
49
|
+
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.
|
50
|
+
|
51
|
+
$ twitter
|
52
|
+
|
53
|
+
Will give you a list of all the commands. You can get the help for each command by running twitter [command] -h.
|
54
|
+
|
55
|
+
The first thing you'll want to do is install the database so your account(s) can be stored.
|
56
|
+
|
57
|
+
$ twitter install
|
58
|
+
|
59
|
+
You can always uninstall twitter like this:
|
60
|
+
|
61
|
+
$ twitter uninstall
|
62
|
+
|
63
|
+
Once the twitter database is installed and migrated, you can add accounts like this:
|
64
|
+
|
65
|
+
$ twitter add
|
66
|
+
Add New Account:
|
67
|
+
Username: jnunemaker
|
68
|
+
Password (won't be displayed):
|
69
|
+
Account added.
|
70
|
+
|
71
|
+
You can also list all the accounts you've added.
|
72
|
+
|
73
|
+
$ twitter list
|
74
|
+
Account List
|
75
|
+
* jnunemaker
|
76
|
+
snitch_test
|
77
|
+
|
78
|
+
The * means denotes the account that will be used when posting, befriending, defriending, following, leaving or viewing a timeline.
|
79
|
+
|
80
|
+
To post using the account marked with the *, simply type the following:
|
81
|
+
|
82
|
+
$ twitter post "releasing my new twitter gem"
|
83
|
+
|
84
|
+
That is about it. You can do pretty much anything that you can do with twitter from the command line interface.
|
data/Rakefile
ADDED
data/bin/twitter
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# if we have stdin, let's prepend it to the message for post
|
4
|
+
if ARGV[0] && ARGV[0] == 'post' && !STDIN.tty?
|
5
|
+
ARGV[1] = "#{STDIN.read}#{ARGV[1]}"
|
6
|
+
end
|
7
|
+
|
8
|
+
# if we have stdin, let's prepend it to the message for d
|
9
|
+
if ARGV[0] && ARGV[0] == 'd' && !STDIN.tty?
|
10
|
+
ARGV[2] = "#{STDIN.read}#{ARGV[2]}"
|
11
|
+
end
|
12
|
+
|
13
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
14
|
+
require 'twitter'
|
15
|
+
require 'twitter/cli'
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'twitter/version'
|
2
|
+
|
3
|
+
AUTHOR = "John Nunemaker" # can also be an array of Authors
|
4
|
+
EMAIL = "nunemaker@gmail.com"
|
5
|
+
DESCRIPTION = "a command line interface for twitter, also a library which wraps the twitter api"
|
6
|
+
GEM_NAME = "twitter" # what ppl will type to install your gem
|
7
|
+
RUBYFORGE_PROJECT = "twitter" # The unix name for your project
|
8
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
+
RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
|
10
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
11
|
+
|
12
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
13
|
+
@config = nil
|
14
|
+
RUBYFORGE_USERNAME = "unknown"
|
15
|
+
def rubyforge_username
|
16
|
+
unless @config
|
17
|
+
begin
|
18
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
19
|
+
rescue
|
20
|
+
puts <<-EOS
|
21
|
+
ERROR: No rubyforge config file found: #{@config_file}
|
22
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
23
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
24
|
+
EOS
|
25
|
+
exit
|
26
|
+
end
|
27
|
+
end
|
28
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
REV = nil
|
33
|
+
# UNCOMMENT IF REQUIRED:
|
34
|
+
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
|
35
|
+
VERS = Twitter::VERSION::STRING + (REV ? ".#{REV}" : "")
|
36
|
+
RDOC_OPTS = ['--quiet', '--title', 'twitter documentation',
|
37
|
+
"--opname", "index.html",
|
38
|
+
"--line-numbers",
|
39
|
+
"--main", "README",
|
40
|
+
"--inline-source"]
|
41
|
+
|
42
|
+
class Hoe
|
43
|
+
def extra_deps
|
44
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
45
|
+
@extra_deps
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Generate all the Rake tasks
|
50
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
51
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
52
|
+
p.author = AUTHOR
|
53
|
+
p.description = DESCRIPTION
|
54
|
+
p.email = EMAIL
|
55
|
+
p.summary = DESCRIPTION
|
56
|
+
p.url = HOMEPATH
|
57
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
58
|
+
p.test_globs = ["test/**/test_*.rb"]
|
59
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
60
|
+
|
61
|
+
# == Optional
|
62
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
63
|
+
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
64
|
+
p.extra_deps = [['hpricot', '>= 0.6'], ['activesupport', '>= 2.1'],
|
65
|
+
['main', '>= 2.8.2'], ['highline', '>= 1.4.0'],
|
66
|
+
['activerecord', '>= 2.1'], ['httparty', '>= 0.1.0']]
|
67
|
+
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
72
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
73
|
+
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
74
|
+
hoe.rsync_args = '-av --delete --ignore-errors'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
+
begin
|
7
|
+
require req_gem
|
8
|
+
rescue LoadError
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
16
|
+
|
17
|
+
require 'twitter'
|
data/examples/blocks.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter')
|
3
|
+
config = YAML::load(open(ENV['HOME'] + '/.twitter'))
|
4
|
+
|
5
|
+
twitter = Twitter::Base.new(config['email'], config['password'])
|
6
|
+
|
7
|
+
puts 'BLOCK CREATE'
|
8
|
+
puts twitter.block('project_rockne').name
|
9
|
+
puts
|
10
|
+
puts
|
11
|
+
|
12
|
+
puts 'BLOCK DESTROY'
|
13
|
+
puts twitter.block('project_rockne').name
|
14
|
+
puts
|
15
|
+
puts
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter')
|
3
|
+
config = YAML::load(open(ENV['HOME'] + '/.twitter'))
|
4
|
+
|
5
|
+
twitter = Twitter::Base.new(config['email'], config['password'])
|
6
|
+
|
7
|
+
puts 'SINCE'
|
8
|
+
twitter.direct_messages(:since => Time.now - 5.day).each do |s|
|
9
|
+
puts "- #{s.id} #{s.text}"
|
10
|
+
end
|
11
|
+
puts
|
12
|
+
puts
|
13
|
+
|
14
|
+
# puts 'SINCE_ID'
|
15
|
+
# twitter.direct_messages(:since_id => 33505386).each do |s|
|
16
|
+
# puts "- #{s.text}"
|
17
|
+
# end
|
18
|
+
# puts
|
19
|
+
# puts
|
20
|
+
#
|
21
|
+
# puts 'PAGE'
|
22
|
+
# twitter.direct_messages(:page => 1).each do |s|
|
23
|
+
# puts "- #{s.text}"
|
24
|
+
# end
|
25
|
+
# puts
|
26
|
+
# puts
|
27
|
+
|
28
|
+
# puts twitter.destroy_direct_message(34489057).inspect
|