jnunemaker-twitter 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. data/History.txt +76 -0
  2. data/License.txt +19 -0
  3. data/Manifest.txt +63 -0
  4. data/README.txt +75 -0
  5. data/Rakefile +11 -0
  6. data/bin/twitter +15 -0
  7. data/config/hoe.rb +73 -0
  8. data/config/requirements.rb +17 -0
  9. data/examples/blocks.rb +15 -0
  10. data/examples/direct_messages.rb +26 -0
  11. data/examples/favorites.rb +20 -0
  12. data/examples/friends_followers.rb +25 -0
  13. data/examples/friendships.rb +13 -0
  14. data/examples/location.rb +8 -0
  15. data/examples/replies.rb +26 -0
  16. data/examples/sent_messages.rb +26 -0
  17. data/examples/timeline.rb +33 -0
  18. data/examples/twitter.rb +27 -0
  19. data/examples/verify_credentials.rb +13 -0
  20. data/lib/twitter/base.rb +249 -0
  21. data/lib/twitter/cli/config.rb +9 -0
  22. data/lib/twitter/cli/helpers.rb +46 -0
  23. data/lib/twitter/cli/migrations/20080722194500_create_accounts.rb +13 -0
  24. data/lib/twitter/cli/migrations/20080722194508_create_tweets.rb +16 -0
  25. data/lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb +9 -0
  26. data/lib/twitter/cli/migrations/20080722214606_create_configurations.rb +13 -0
  27. data/lib/twitter/cli/models/account.rb +21 -0
  28. data/lib/twitter/cli/models/configuration.rb +13 -0
  29. data/lib/twitter/cli/models/tweet.rb +20 -0
  30. data/lib/twitter/cli.rb +297 -0
  31. data/lib/twitter/direct_message.rb +22 -0
  32. data/lib/twitter/easy_class_maker.rb +43 -0
  33. data/lib/twitter/rate_limit_status.rb +19 -0
  34. data/lib/twitter/status.rb +22 -0
  35. data/lib/twitter/user.rb +37 -0
  36. data/lib/twitter/version.rb +9 -0
  37. data/lib/twitter.rb +20 -0
  38. data/script/destroy +14 -0
  39. data/script/generate +14 -0
  40. data/script/txt2html +74 -0
  41. data/setup.rb +1585 -0
  42. data/spec/base_spec.rb +109 -0
  43. data/spec/direct_message_spec.rb +35 -0
  44. data/spec/fixtures/followers.xml +706 -0
  45. data/spec/fixtures/friends.xml +609 -0
  46. data/spec/fixtures/friends_for.xml +584 -0
  47. data/spec/fixtures/friends_lite.xml +192 -0
  48. data/spec/fixtures/friends_timeline.xml +66 -0
  49. data/spec/fixtures/public_timeline.xml +148 -0
  50. data/spec/fixtures/rate_limit_status.xml +7 -0
  51. data/spec/fixtures/status.xml +25 -0
  52. data/spec/fixtures/user.xml +38 -0
  53. data/spec/fixtures/user_timeline.xml +465 -0
  54. data/spec/spec.opts +1 -0
  55. data/spec/spec_helper.rb +8 -0
  56. data/spec/status_spec.rb +40 -0
  57. data/spec/user_spec.rb +42 -0
  58. data/tasks/deployment.rake +34 -0
  59. data/tasks/environment.rake +7 -0
  60. data/tasks/website.rake +17 -0
  61. data/twitter.gemspec +23 -0
  62. data/website/css/common.css +47 -0
  63. data/website/index.html +135 -0
  64. metadata +136 -0
@@ -0,0 +1,47 @@
1
+ @media screen, projection {
2
+ /*
3
+ Copyright (c) 2007, Yahoo! Inc. All rights reserved.
4
+ Code licensed under the BSD License:
5
+ http://developer.yahoo.net/yui/license.txt
6
+ version: 2.2.0
7
+ */
8
+ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
9
+ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}/*ol,ul {list-style:none;}*/caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
10
+ /* end of yahoo reset and fonts */
11
+
12
+ body {color:#333; background:#4b1a1a; line-height:1.3;}
13
+ p {margin:0 0 20px;}
14
+ a {color:#4b1a1a;}
15
+ a:hover {text-decoration:none;}
16
+ strong {font-weight:bold;}
17
+ em {font-style:italics;}
18
+ h1,h2,h3,h4,h5,h6 {font-weight:bold;}
19
+ h1 {font-size:197%; margin:30px 0; color:#4b1a1a;}
20
+ h2 {font-size:174%; margin:20px 0; color:#b8111a;}
21
+ h3 {font-size:152%; margin:10px 0;}
22
+ h4 {font-size:129%; margin:10px 0;}
23
+ pre {background:#eee; margin:0 0 20px; padding:20px; border:1px solid #ccc; font-size:100%; overflow:auto;}
24
+ code {font-size:100%; margin:0; padding:0;}
25
+ ul, ol {margin:10px 0 10px 25px;}
26
+ ol li {margin:0 0 10px;}
27
+
28
+
29
+
30
+
31
+
32
+ div#wrapper {background:#fff; width:560px; margin:0 auto; padding:20px; border:10px solid #bc8c46; border-width:0 10px;}
33
+ div#header {position:relative; border-bottom:1px dotted; margin:0 0 10px; padding:0 0 10px;}
34
+ div#header p {margin:0; padding:0;}
35
+ div#header h1 {margin:0; padding:0;}
36
+ ul#nav {position:absolute; top:0; right:0; list-style:none; margin:0; padding:0;}
37
+ ul#nav li {display:inline; padding:0 0 0 5px;}
38
+ ul#nav li a {}
39
+ div#content {}
40
+ div#footer {margin:40px 0 0; border-top:1px dotted; padding:10px 0 0;}
41
+
42
+
43
+
44
+
45
+
46
+
47
+ }
@@ -0,0 +1,135 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+ <title>Ruby Twitter Gem by John Nunemaker</title>
6
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
7
+ </head>
8
+ <body>
9
+
10
+ <div id="wrapper">
11
+ <div id="header">
12
+ <h1>Twitter</h1>
13
+ <p>command line twits and an api wrapper</p>
14
+
15
+ <ul id="nav">
16
+ <li><a href="rdoc/">Docs</a></li>
17
+ <li><a href="http://github.com/jnunemaker/twitter">Github</a></li>
18
+ <li><a href="http://rubyforge.org/projects/twitter/">Rubyforge</a></li>
19
+ </ul>
20
+ </div>
21
+
22
+ <div id="content">
23
+ <h2>Install</h2>
24
+ <pre><code>$ sudo gem install twitter</code></pre>
25
+ <p><small>note: the twitter gem now works with hpricot 0.5+</small></p>
26
+
27
+ <h2>API Wrapping</h2>
28
+ <p>I do my best to keep it easy to use. Below are some code samples showing a few of the methods.</p>
29
+
30
+ <pre><code>twit = twit
31
+ twit.update('watching veronica mars')
32
+
33
+ puts "Public Timeline", "=" * 50
34
+ twit.timeline(:public).each do |s|
35
+ puts s.text, s.user.name
36
+ puts
37
+ end
38
+
39
+ puts '', "Friends Timeline", "=" * 50
40
+ twit.timeline(:friends).each do |s|
41
+ puts s.text, s.user.name
42
+ puts
43
+ end
44
+
45
+ puts '', "You and Your Friends Timeline", "=" * 50
46
+ twit.timeline(:user).each do |s|
47
+ puts s.text, s.user.name
48
+ puts
49
+ end
50
+
51
+ puts '', "Your Friends", "=" * 50
52
+ twit.friends.each do |u|
53
+ puts u.name, u.status.text
54
+ puts
55
+ end
56
+
57
+ puts '', "jnunemaker's Friends", "=" * 50
58
+ twit.friends_for('jnunemaker').each do |u|
59
+ puts u.name
60
+ puts
61
+ end
62
+
63
+ puts '', "Your Followers", "=" * 50
64
+ twit.followers.each do |u|
65
+ puts u.name
66
+ puts
67
+ end
68
+ </code></pre>
69
+
70
+ <h2>Command Line</h2>
71
+ <p>The first thing you'll want to do is install the database so your account(s) can be stored.</p>
72
+
73
+ <pre><code>$ twitter install</code></pre>
74
+
75
+ <p>You can always uninstall twitter like this:</p>
76
+
77
+ <pre><code>$ twitter uninstall</code></pre>
78
+
79
+ <p>Once the twitter database is installed and migrated, you can add accounts like this:</p>
80
+
81
+ <pre><code>$ twitter add
82
+ Add New Account:
83
+ Username: jnunemaker
84
+ Password (won't be displayed):
85
+ Account added.</code></pre>
86
+
87
+ <p>You can also list all the accounts you've added.</p>
88
+
89
+ <pre><code>$ twitter list
90
+ Account List
91
+ * jnunemaker
92
+ snitch_test</code></pre>
93
+
94
+ <p>The * means denotes the account that will be used when posting, befriending, defriending, following, leaving or viewing a timeline.</p>
95
+
96
+ <p>To post using the account marked with the *, simply type the following:</p>
97
+
98
+ <pre><code>$ twitter post "releasing my new twitter gem"</code></pre>
99
+
100
+ <p>That is about it. You can do pretty much anything that you can do with twitter from the command line interface.</p>
101
+
102
+ <pre><code>$ twitter</code></pre>
103
+
104
+ <p>Will give you a list of all the commands. You can get the help for each command by running twitter [command] -h. </p>
105
+
106
+
107
+ <h2>Support</h2>
108
+ <p>Please leave all support requests and suggestions at the <a href="http://groups.google.com/group/ruby-twitter-gem">google group</a>.</p>
109
+
110
+ <h2>Uses</h2>
111
+ <ul>
112
+ <li><a href="http://snitch.rubyforge.org">Snitch</a></li>
113
+ <li><a href="http://al3x.net/entries/766">Growl + Twitter</a></li>
114
+ <li><a href="http://snippets.dzone.com/posts/show/3714">Twitter Woot Bot</a> (<a href="http://soylentfoo.jnewland.com/articles/2007/03/22/woot-twitter-bot-now-official">more here</a>)</li>
115
+ <li><a href="http://soylentfoo.jnewland.com/articles/2007/01/22/tweet-update-twitter-via-quicksilver">Tweet Quicksilver Action</a></li>
116
+ <li><a href="http://blog.evanweaver.com/articles/2007/02/09/log-system-security-events-to-twitter">logging security events to twitter</a></li>
117
+ <li><a href="http://shareomatic.com/">Shareomatic</a> is using it for their <a href="http://twitter.com/shareomatic">twitter account</a></li>
118
+ </ul>
119
+
120
+ <p>Using the twitter gem for something, <a href="mailto:nunemaker@gmail.com">let me know</a> and I'll add you above.</p>
121
+ </div>
122
+
123
+ <div id="footer">
124
+ <p>Created by <a href="http://addictedtonew.com/about/">John Nunemaker</a></p>
125
+ </div>
126
+ </div>
127
+
128
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
129
+ <script type="text/javascript">_uacct = "UA-85301-9"; urchinTracker();</script>
130
+
131
+ <!-- 103bees.com 'bee' code v1.11 - please do not make any changes! -->
132
+ <script type="text/javascript" src="http://103bees.com/bees/?bee=3672&amp;fid=5643"></script>
133
+ <!-- 103bees.com 'bee' code -->
134
+ </body>
135
+ </html>
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jnunemaker-twitter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.8
5
+ platform: ruby
6
+ authors:
7
+ - John Nunemaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-07-06 00:00:00 -07:00
13
+ default_executable: twitter
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: activesupport
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: "0"
32
+ version:
33
+ description: a command line interface for twitter, also a library which wraps the twitter api
34
+ email: nunemaker@gmail.com
35
+ executables:
36
+ - twitter
37
+ extensions: []
38
+
39
+ extra_rdoc_files:
40
+ - History.txt
41
+ - License.txt
42
+ - Manifest.txt
43
+ - README.txt
44
+ files:
45
+ - History.txt
46
+ - License.txt
47
+ - Manifest.txt
48
+ - README.txt
49
+ - Rakefile
50
+ - bin/twitter
51
+ - config/hoe.rb
52
+ - config/requirements.rb
53
+ - examples/blocks.rb
54
+ - examples/direct_messages.rb
55
+ - examples/favorites.rb
56
+ - examples/friends_followers.rb
57
+ - examples/friendships.rb
58
+ - examples/location.rb
59
+ - examples/replies.rb
60
+ - examples/sent_messages.rb
61
+ - examples/timeline.rb
62
+ - examples/twitter.rb
63
+ - examples/verify_credentials.rb
64
+ - lib/twitter.rb
65
+ - lib/twitter/base.rb
66
+ - lib/twitter/cli.rb
67
+ - lib/twitter/cli/config.rb
68
+ - lib/twitter/cli/helpers.rb
69
+ - lib/twitter/cli/migrations/20080722194500_create_accounts.rb
70
+ - lib/twitter/cli/migrations/20080722194508_create_tweets.rb
71
+ - lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb
72
+ - lib/twitter/cli/migrations/20080722214606_create_configurations.rb
73
+ - lib/twitter/cli/models/account.rb
74
+ - lib/twitter/cli/models/configuration.rb
75
+ - lib/twitter/cli/models/tweet.rb
76
+ - lib/twitter/direct_message.rb
77
+ - lib/twitter/easy_class_maker.rb
78
+ - lib/twitter/rate_limit_status.rb
79
+ - lib/twitter/status.rb
80
+ - lib/twitter/user.rb
81
+ - lib/twitter/version.rb
82
+ - script/destroy
83
+ - script/generate
84
+ - script/txt2html
85
+ - setup.rb
86
+ - spec/base_spec.rb
87
+ - spec/direct_message_spec.rb
88
+ - spec/fixtures/followers.xml
89
+ - spec/fixtures/friends.xml
90
+ - spec/fixtures/friends_for.xml
91
+ - spec/fixtures/friends_lite.xml
92
+ - spec/fixtures/friends_timeline.xml
93
+ - spec/fixtures/public_timeline.xml
94
+ - spec/fixtures/rate_limit_status.xml
95
+ - spec/fixtures/status.xml
96
+ - spec/fixtures/user.xml
97
+ - spec/fixtures/user_timeline.xml
98
+ - spec/spec.opts
99
+ - spec/spec_helper.rb
100
+ - spec/status_spec.rb
101
+ - spec/user_spec.rb
102
+ - tasks/deployment.rake
103
+ - tasks/environment.rake
104
+ - tasks/website.rake
105
+ - twitter.gemspec
106
+ - website/css/common.css
107
+ - website/index.html
108
+ has_rdoc: true
109
+ homepage: http://twitter.rubyforge.org
110
+ post_install_message:
111
+ rdoc_options:
112
+ - --main
113
+ - README.txt
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: "0"
121
+ version:
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: "0"
127
+ version:
128
+ requirements: []
129
+
130
+ rubyforge_project: twitter
131
+ rubygems_version: 1.2.0
132
+ signing_key:
133
+ specification_version: 2
134
+ summary: a command line interface for twitter, also a library which wraps the twitter api
135
+ test_files: []
136
+