Code Monkey home page Code Monkey logo

t-ruby's Introduction

Application icon

Twitter CLI

Gem Version Build Status Dependency Status tip for next commit

A command-line power tool for Twitter.

The CLI takes syntactic cues from the Twitter SMS commands, but it offers vastly more commands and capabilities than are available via SMS.

Dependencies

First, make sure you have Ruby installed.

On a Mac, open /Applications/Utilities/Terminal.app and type:

ruby -v

If the output looks something like this, you're in good shape:

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

If the output looks more like this, you need to install Ruby:

ruby: command not found

On Linux, for Debian-based systems, open a terminal and type:

sudo apt-get install ruby-dev

or for Red Hat-based distros like Fedora and CentOS, type:

sudo yum install ruby-devel

(if necessary, adapt for your package manager)

On Windows, you can install Ruby with RubyInstaller.

Installation

Once you've verified that Ruby is installed:

gem install t

Configuration

Twitter API v1.1 requires OAuth for all of its functionality, so you'll need a registered Twitter application. If you've never registered a Twitter application before, it's easy! Just sign-in using your Twitter account and then fill out the short form at https://apps.twitter.com/app/new. If you've previously registered a Twitter application, it should be listed at https://apps.twitter.com/. Once you've registered an application, make sure to set your application's Access Level to "Read, Write and Access direct messages", otherwise you'll receive an error that looks like this:

Error processing your OAuth request: Read-only application cannot POST

A mobile phone number must be associated with your account in order to obtain write privileges. If your carrier is not supported by Twitter and you are unable to add a number, contact Twitter using https://support.twitter.com/forms/platform, selecting the last checkbox. Some users have reported success adding their number using the mobile site, https://mobile.twitter.com/settings, which seems to bypass the carrier check at the moment.

Now, you're ready to authorize a Twitter account with your application. To proceed, type the following command at the prompt and follow the instructions:

t authorize

This command will direct you to a URL where you can sign-in to Twitter, authorize the application, and then enter the returned PIN back into the terminal. If you type the PIN correctly, you should now be authorized to use t as that user. To authorize multiple accounts, simply repeat the last step, signing into Twitter as a different user.

NOTE: If you have problems authorizing multiple accounts, open a new window in your browser in incognito/private-browsing mode and repeat the t authorize steps. This is apparently due to a bug in twitter's cookie handling.

You can see a list of all the accounts you've authorized by typing the command:

t accounts

The output of which will be structured like this:

sferik
  UDfNTpOz5ZDG4a6w7dIWj
  uuP7Xbl2mEfGMiDu1uIyFN
gem
  thG9EfWoADtIr6NjbL9ON (active)

Note: One of your authorized accounts (specifically, the last one authorized) will be set as active. To change the active account, use the set subcommand, passing either just a username, if it's unambiguous, or a username and consumer key pair, like this:

t set active sferik UDfNTpOz5ZDG4a6w7dIWj

Account information is stored in a YAML-formatted file located at ~/.trc.

Note: Anyone with access to this file can impersonate you on Twitter, so it's important to keep it secure, just as you would treat your SSH private key. For this reason, the file is hidden and has the permission bits set to 0600.

Usage Examples

Typing t help will list all the available commands. You can type t help TASK to get help for a specific command.

t help

Update your status

t update "I'm tweeting from the command line. Isn't that special?"

Note: If your tweet includes special characters (e.g. !), make sure to wrap it in single quotes instead of double quotes, so those characters are not interpreted by your shell. If you use single quotes, your Tweet obviously can't contain any apostrophes unless you prefix them with a backslash \:

t update 'I\'m tweeting from the command line. Isn\'t that special?'

Retrieve detailed information about a Twitter user

t whois @sferik

Retrieve stats for multiple users

t users -l @sferik @gem

Follow users

t follow @sferik @gem

Check whether one user follows another

t does_follow @ev @sferik

Note: If the first user does not follow the second, t will exit with a non-zero exit code. This allows you to execute commands conditionally. For example, here's how to send a user a direct message only if they already follow you:

t does_follow @ev && t dm @ev "What's up, bro?"

Create a list for everyone you're following

t list create following-`date "+%Y-%m-%d"`

Add everyone you're following to that list (up to 500 users)

t followings | xargs t list add following-`date "+%Y-%m-%d"`

List all the members of a list, in long format

t list members -l following-`date "+%Y-%m-%d"`

List all your lists, in long format

t lists -l

List all your friends, in long format, ordered by number of followers

t friends -l --sort=followers

List all your leaders (people you follow who don't follow you back)

t leaders -l --sort=followers

Mute everyone you follow

t followings | xargs t mute

Unfollow everyone you follow who doesn't follow you back

t leaders | xargs t unfollow

Unfollow 10 people who haven't tweeted in the longest time

t followings -l --sort=tweeted | head -10 | awk '{print $1}' | xargs t unfollow -i

Twitter roulette: randomly follow someone who follows you (who you don't already follow)

t groupies | shuf | head -1 | xargs t follow

Favorite the last 10 tweets that mention you

t mentions -n 10 -l | awk '{print $1}' | xargs t favorite

Output the last 200 tweets in your timeline to a CSV file

t timeline -n 200 --csv > timeline.csv

Start streaming your timeline (Control-C to stop)

t stream timeline

Count the number of official Twitter engineering accounts

t list members twitter/engineering | wc -l

Search Twitter for the 20 most recent Tweets that match a specified query

t search all "query"

Download the latest Linux kernel via BitTorrent (possibly NSFW, depending on where you work)

t search all "lang:en filter:links linux torrent" -n 1 | grep -o "http://t.co/[0-9A-Za-z]*" | xargs open

Search Tweets you've favorited that match a specified query

t search favorites "query"

Search Tweets mentioning you that match a specified query

t search mentions "query"

Search Tweets you've retweeted that match a specified query

t search retweets "query"

Search Tweets in your home timeline that match a specified query

t search timeline "query"

Note: In Twitter API parlance, your “home timeline” is your “Newsfeed” whereas your “user timeline” are the tweets tweeted (and retweeted) by you.

Search Tweets in a specified user’s timeline

t search timeline @sferik "query"

Features

  • Deep search: Instead of using the Twitter Search API, which only goes back 6-9 days, t search fetches up to 3,200 tweets via the REST API and then checks each one against a regular expression.
  • Multi-threaded: Whenever possible, Twitter API requests are made in parallel, resulting in faster performance for bulk operations.
  • Designed for Unix: Output is designed to be piped to other Unix utilities, like grep, comm, cut, awk, bc, wc, and xargs for advanced text processing.
  • Generate spreadsheets: Convert the output of any command to CSV format simply by adding the --csv flag.
  • 95% C0 Code Coverage: Well tested, with a 2.5:1 test-to-code ratio.

Using T for Backup

@jphpsf wrote a blog post explaining how to use t to backup your Twitter account.

t was also mentioned on an episode of the Ruby 5 podcast.

t was also discussed on an episode of the Ruby Rogues podcast.

If you discuss t in a blog post or podcast, let me know and I'll link it here.

Relationship Terminology

There is some ambiguity in the terminology used to describe relationships on Twitter. For example, some people use the term "friends" to mean everyone you follow. In t, "friends" refers to just the subset of people who follow you back (i.e., friendship is bidirectional). Here is the full table of terminology used by t:

                           ___________________________________________________
                          |                         |                         |
                          |     YOU FOLLOW THEM     |  YOU DON'T FOLLOW THEM  |
 _________________________|_________________________|_________________________|_________________________
|                         |                         |                         |                         |
|     THEY FOLLOW YOU     |         friends         |        groupies         |        followers        |
|_________________________|_________________________|_________________________|_________________________|
|                         |                         |
|  THEY DON'T FOLLOW YOU  |         leaders         |
|_________________________|_________________________|
                          |                         |
                          |       followings        |
                          |_________________________|

Screenshots

Timeline List

Shell completion

If you're running Zsh or Bash, you can source one of the bundled completion files to get shell completion for t commands, subcommands, and flags.

Don't run Zsh or Bash? Why not contribute completion support for your favorite shell?

History

The twitter gem previously contained a command-line interface, up until version 0.5.0, when it was removed. This project is offered as a successor to that effort, however it is a clean room implementation that contains none of the original code.

History

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

  • Ruby 3.1
  • Ruby 3.2
  • Ruby 3.3

If something doesn't work on one of these Ruby versions, it's a bug.

This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the versions listed above.

If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.

Troubleshooting

If you are running t on a remote computer you can use the flag --display-uri during authorize process to display the url instead of opening the web browser.

t authorize --display-uri

Copyright

Copyright (c) 2011-2024 Erik Berlin. See LICENSE for details. Application icon by @nvk.

t-ruby's People

Contributors

acoravos avatar aniversarioperu avatar autodidacticon avatar benhc123 avatar bfontaine avatar blrhc avatar chastell avatar cobyism avatar copiousfreetime avatar iamdeuterium avatar iirelu avatar joshk avatar jphpsf avatar juanitofatas avatar mcfiredrill avatar mislav avatar mportiz08 avatar nickborromeo avatar nickmerwin avatar nvk avatar parkr avatar patmaddox avatar pengwynn avatar readmecritic avatar sferik avatar stve avatar tedkulp avatar timvdalen avatar waynn avatar ysksn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

t-ruby's Issues

t trends_locations support

Hi, t --help includes the following task:

t trends_locations                   # Returns the locations for which Twitter has trending topic information.

but running t trends_locations returns

Could not find task "trends_locations".

Is that not yet supported, but in the task list?

t lists crashes

I'm using t version 1.2.0, ruby 1.9.3-p194. I can use t without any problem, but it fails when I'm listing my lists.

❯ t lists -l
/home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/cursor.rb:36:in `[]': can't convert Symbol into Integer (TypeError)
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/cursor.rb:36:in `initialize'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/cursor.rb:19:in `new'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/cursor.rb:19:in `from_response'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/api.rb:2339:in `cursor_from_response'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/api.rb:2361:in `lists_from_response'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.0.0/lib/twitter/api.rb:1175:in `lists'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/t-1.2.0/lib/t/cli.rb:477:in `block in lists'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/t-1.2.0/lib/t/collectable.rb:15:in `block in collect_with_cursor'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/retryable-1.3.1/lib/retryable.rb:15:in `retryable'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/t-1.2.0/lib/t/collectable.rb:14:in `collect_with_cursor'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/t-1.2.0/lib/t/cli.rb:476:in `lists'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor.rb:275:in `dispatch'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/gems/t-1.2.0/bin/t:13:in `<top (required)>'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/bin/t:19:in `load'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/bin/t:19:in `<main>'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
        from /home/grota/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

Coloured terminal output

Is it possible to colour the output of t timeline, for example? It would make it much easier to read.

Using output in long format

Hi,

When I try to return a list of users, I get these error :

$ t users -l @J_Brison @follc
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/basic_object.rb:11:in raise': expected a time or date, got 2012-05-02 19:33:26 +0200 (ArgumentError) from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/duration.rb:94:inblock in sum'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/duration.rb:86:in each' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/duration.rb:86:ininject'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/duration.rb:86:in sum' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/duration.rb:69:inago'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.3/lib/t/printable.rb:38:in build_long_user' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.3/lib/t/printable.rb:179:inblock in print_users'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.3/lib/t/printable.rb:178:in map' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.3/lib/t/printable.rb:178:inprint_users'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.3/lib/t/cli.rb:810:in users' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor/task.rb:27:inrun'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor/invocation.rb:120:in invoke_task' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor.rb:275:indispatch'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor/base.rb:408:in start' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.3/bin/t:11:in<top (required)>'
from /usr/local/ruby/bin/t:19:in load' from /usr/local/ruby/bin/t:19:in

'

$ rails -v
Rails 3.0.0

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

$ t -v
0.9.3

How can I fix it ?

I found this : https://makandracards.com/makandra/1017-maximum-representable-value-for-a-ruby-time-object

Thx so much.

better docs for t timeline

perhaps its just me but it took me quite a few minutes to figure out that most important command is called 't timeline'. it would be great to add it to docs/help. 'timeline' command is mentioned but only combined with search.

Followers list has friends in it

Don' t know how to 'prove' this, or show it or help track down the issue but my followers list definitely has friends in it.

I did a

"t followers -lf"

And got some names that I know for sure I follow.

Tweets ending in exclamation points are rejected

Entering the command t update "I'm tweeting from the command line!" elicits the response:

-bash: !": event not found

Escaping the exclamation point (i.e. tweeting "I'm tweeting from the command line\!) allows the update to post. However, I think this is an unnecessary burden to place on the user.

Trouble Authorizing

I've tried to troubleshoot this myself the last 24-hours and going in circles. I've installed t v0.9.9 and OS X 10.7's core Ruby (1.8.7) i get the following error when loading "t":
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- oauth (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /Library/Ruby/Gems/1.8/gems/t-0.9.9/bin/t:3
from /usr/bin/t:19:in `load'
from /usr/bin/t:19

I installed RVM that provided me to run Ruby 1.9.3-p194 and now t runs, but I can't authorize. I enter "t authorize", no webpage loads as the t website instructions say and I get: No value provided for required options '--consumer-key', '--consumer-secret'
so, I manually enter based on the instructions inside the application: t authorize -c, --consumer-key=[MYKEY]-s, --consumer-secret= [MYSECRET]
and I get: Unknown switches '-c,, -s,'

I'm an experience OS X and OS X Server user, but novice in the terminal side of the world. I'm not seeing other concerns, so not sure if a me/PICNIC issue or an application issue.

Slow!

$ time ruby -rubygems -e ''
ruby -rubygems -e ''  0.04s user 0.06s system 90% cpu 0.111 total

$ time t version
0.9.6
t version  6.73s user 0.44s system 99% cpu 7.185 total

💩

uninitialized constant OAuth (NameError)

in version 0.9.8 I get this error when running "t stream timeline"

ruby-1.9.3-p194@twitter/gems/t-0.9.8/bin/t:15:in `rescue in <top (required)>': uninitialized constant OAuth (NameError)
    from /home/max/.rvm/gems/ruby-1.9.3-p194@twitter/gems/t-0.9.8/bin/t:10:in `<top (required)>'
    from /home/max/.rvm/gems/ruby-1.9.3-p194@twitter/bin/t:19:in `load'
    from /home/max/.rvm/gems/ruby-1.9.3-p194@twitter/bin/t:19:in `<main>'
    from /home/max/.rvm/gems/ruby-1.9.3-p194@twitter/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/max/.rvm/gems/ruby-1.9.3-p194@twitter/bin/ruby_noexec_wrapper:14:in `<main>'

gems:
activesupport (3.2.3)
addressable (2.2.8)
bundler (1.1.3)
daemons (1.1.8)
eventmachine (0.12.10)
faraday (0.8.0)
fastercsv (1.5.5)
geokit (1.6.5)
htmlentities (4.3.1)
http_parser.rb (0.5.3)
i18n (0.6.0)
json (1.7.3)
launchy (2.1.0)
multi_json (1.3.5)
multipart-post (1.1.5)
oauth (0.4.6)
rake (0.9.2.2)
retryable (1.2.5)
rubygems-bundler (1.0.2, 1.0.0)
rvm (1.11.3.3)
simple_oauth (0.1.8)
t (0.9.8, 0.9.7)
thor (0.15.2)
tweetstream (1.1.5)
twitter (2.4.0, 2.3.0)
twitter-stream (0.1.15)
twitter-text (1.4.17)

Unclear on how to get the status id of a message

In some commands, the status id is an argument:

  t favorite STATUS_ID [STATUS_ID...]                                                # Marks Tweets as favorites.
  t reply STATUS_ID MESSAGE                                                          # Post your Tweet as a reply directed...
  t retweet STATUS_ID [STATUS_ID...]                                                 # Sends Tweets to your followers.
  t status STATUS_ID                                                                 # Retrieves detailed information abou..

How do you actually get the STATUS_ID? Maybe we can add it in the examples?

ubuntu 11.10 and 12 gives me errors on execution.custom_require.rb:59 gem_original_require no such file

I did install ruby rubygems, then gem install i18n and t, twitter-text tilt thor maybe unecessary manually. Both Ubuntu 11.10 and 12.04.
t authorize -c XX -s YY puts the Error out:
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:in gem_original_require': no such file to load -- twitter-text (LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:inrequire'
from /var/lib/gems/1.8/gems/t-0.7.0/lib/t/cli.rb:31
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
from /var/lib/gems/1.8/gems/t-0.7.0/lib/t.rb:1
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:inrequire'
from /var/lib/gems/1.8/gems/t-0.7.0/bin/t:3
from /usr/local/bin/t:19:in `load'
from /usr/local/bin/t:19

followed a couple of links "ubuntu 11.10 ruby gem_original_request"....

some commands cannot post

─lukeholder@Lukes-MacBook-Pro  ~ ‹1.9.3-p125› 
╰─$ t authorize -c otxIO230fZEOV4rWMXshg -s Vt9UCKlD1Ccn3MjtdmwzgNuMXHyawnTgHNBytFl----                                                      1 ↵
In a moment, your web browser will open to the Twitter app authorization page.
Perform the following steps to complete the authorization process:
  1. Sign in to Twitter
  2. Press "Authorize app"
  3. Copy or memorize the supplied PIN
  4. Return to the terminal to enter the PIN

Press [Enter] to open the Twitter app authorization page. 

Paste in the supplied PIN: 2286862
Authorization successful.
╭─lukeholder@Lukes-MacBook-Pro  ~ ‹1.9.3-p125› 
╰─$ t followings | xargs t list add following-`date "+%Y-%m-%d"`                      
/Users/lukeholder/.rbenv/versions/1.9.3-p125/bin/t: Read-only application cannot POST Run `/Users/lukeholder/.rbenv/versions/1.9.3-p125/bin/t authorize --consumer-key=CONSUMER_KEY --consumer-secret=CONSUMER_SECRET` to authorize.
╭─lukeholder@Lukes-MacBook-Pro  ~ ‹1.9.3-p125› 
╰─$                                               

t stream timeline not working

I guess it's not really a bug in this gem but rather in twitter-stream. But filing here nonetheless...

.rvm/gems/ruby-1.9.3-p194@twitter/gems/twitter-stream-0.1.15/lib/twitter/json_stream.rb:120:in `<<': Could not parse data entirely (HTTP::Parser::Error)
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/twitter-stream-0.1.15/lib/twitter/json_stream.rb:120:in `receive_data'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:337:in `start'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:127:in `userstream'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/t-0.9.9/lib/t/stream.rb:116:in `timeline'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor/task.rb:27:in `run'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor/invocation.rb:120:in `invoke_task'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor.rb:275:in `dispatch'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor/invocation.rb:109:in `invoke'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor.rb:213:in `block in subcommand'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor/task.rb:27:in `run'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor/invocation.rb:120:in `invoke_task'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor.rb:275:in `dispatch'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/thor-0.15.2/lib/thor/base.rb:408:in `start'
    from .rvm/gems/ruby-1.9.3-p194@twitter/gems/t-0.9.9/bin/t:13:in `<top (required)>'
    from .rvm/gems/ruby-1.9.3-p194@twitter/bin/t:19:in `load'
    from .rvm/gems/ruby-1.9.3-p194@twitter/bin/t:19:in `<main>'
    from .rvm/gems/ruby-1.9.3-p194@twitter/bin/ruby_noexec_wrapper:14:in `eval'
    from .rvm/gems/ruby-1.9.3-p194@twitter/bin/ruby_noexec_wrapper:14:in `<main>'

Installation issues

I have been trying to install using gem install t but it doesn't work. It shows build status as failing on the project website so there might be an issue. Also, downloaded the tar and tried to install it manually and received the following output on gem build t.gemspec:

WARNING: no rubyforge_project specified
Successfully built RubyGem
Name: t
Version: 0.8.3
File: t-0.8.3.gem

And then this on gem install t-0.8.3.gem:

ERROR: Error installing /Users/winkerVSbecks/Desktop/sferik-t-1d6b244/t-0.8.3.gem:
activesupport requires i18n (~> 0.6, runtime)

Symbol not found: _SSL_SESSION_free

With ruby 1.9.3-p194 installed from homebrew, and t installed with gem, when I try to run it I get this error—any ideas?

$ t
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle, 9): Symbol not found: _SSL_SESSION_free (LoadError)
  Referenced from: /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle
  Expected in: flat namespace
 in /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle - /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/openssl.rb:17:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/net/https.rb:22:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/oauth-0.4.6/lib/oauth/consumer.rb:2:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/oauth-0.4.6/lib/oauth/client/helper.rb:2:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/oauth-0.4.6/lib/oauth.rb:10:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/t-0.6.3/lib/t/cli.rb:8:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/t-0.6.3/lib/t.rb:1:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/t-0.6.3/bin/t:3:in `<top (required)>'
  from /usr/local/Cellar/ruby/1.9.3-p194/bin/t:23:in `load'
  from /usr/local/Cellar/ruby/1.9.3-p194/bin/t:23:in `<main>'

/Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/response/parse_json.rb:17:in `parse': private method `load' called for MultiJson:Module (NoMethodError)

OSX 10.7.3

$ ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

$ t update "I'm tweeting from the command line. Isn't that special?"
/Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/response/parse_json.rb:17:in parse': private methodload' called for MultiJson:Module (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/response/parse_json.rb:23:in on_complete' from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/response.rb:9:incall'
from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/response.rb:62:in on_complete' from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/response.rb:8:incall'
from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/response.rb:8:in call' from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/request/url_encoded.rb:14:incall'
from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/request/multipart.rb:13:in call' from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/request/oauth.rb:17:incall'
from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/request/multipart_with_file.rb:17:in call' from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/request/phoenix.rb:13:incall'
from /Library/Ruby/Gems/1.8/gems/faraday-0.7.6/lib/faraday/connection.rb:210:in run_request' from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/request.rb:23:inrequest'
from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/request.rb:16:in post' from /Library/Ruby/Gems/1.8/gems/twitter-2.2.1/lib/twitter/client/tweets.rb:159:inupdate'
from /Library/Ruby/Gems/1.8/gems/t-0.3.1/lib/t/cli.rb:235:in status' from /Library/Ruby/Gems/1.8/gems/thor-0.15.0.rc2/lib/thor/task.rb:24:insend'
from /Library/Ruby/Gems/1.8/gems/thor-0.15.0.rc2/lib/thor/task.rb:24:in run' from /Library/Ruby/Gems/1.8/gems/thor-0.15.0.rc2/lib/thor/invocation.rb:120:ininvoke_task'
from /Library/Ruby/Gems/1.8/gems/thor-0.15.0.rc2/lib/thor.rb:274:in dispatch' from /Library/Ruby/Gems/1.8/gems/thor-0.15.0.rc2/lib/thor/base.rb:407:instart'
from /Library/Ruby/Gems/1.8/gems/t-0.3.1/bin/t:11
from /usr/bin/t:19:in `load'
from /usr/bin/t:19

Make the parser more resilient: Could not parse data entirely (HTTP::Parser::Error)

Every once in a while command like the stream fail with a HTTP error, causing the client to crash:

/var/lib/gems/1.8/gems/twitter-stream-0.1.15/lib/twitter/json_stream.rb:120:in `<<': Could not parse data entirely (HTTP::Parser::Error)
    from /var/lib/gems/1.8/gems/twitter-stream-0.1.15/lib/twitter/json_stream.rb:120:in `receive_data'
    from /var/lib/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
    from /var/lib/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
    from /var/lib/gems/1.8/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:337:in `start'
    from /var/lib/gems/1.8/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:127:in `userstream'
    from /var/lib/gems/1.8/gems/t-0.9.9/lib/t/stream.rb:116:in `timeline'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:in `send'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:in `run'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:120:in `invoke_task'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor.rb:275:in `dispatch'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:109:in `send'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:109:in `invoke'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor.rb:213:in `stream'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:in `send'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:in `run'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:120:in `invoke_task'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor.rb:275:in `dispatch'
    from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/base.rb:408:in `start'
    from /var/lib/gems/1.8/gems/t-0.9.9/bin/t:13
    from /usr/local/bin/t:19:in `load'
    from /usr/local/bin/t:19

"t timeline [SCREEN_NAME]" does not return user's tweets

The README claims that to retrieve a timeline of status updates posted by a user, you simply type "t timeline [SCREEN_NAME]," for instance:

t timeline sferik

However, entering this command currently elicits the following response:

"timeline" was called incorrectly. Call as "t timeline".

I looked through cli_spec and cli.rb hunting for that error message or some clue of what was going wrong, and couldn't figure it out.

t sets location to your current location by default

When first using t just now, my location was automatically included in the tweet although I had not set it. Maybe I'm confused, but the usage examples suggested to me that my location would only be shown if I set it. Over and above that, I can't see any way to unset it.

So, two requests:

  • Please warn users if geolocation is indeed the default.
  • Make it clearer how (if at all) this can be turned off.

Thanks.

following a user you already follow

This isn't a problem with t, this is a problem with twitter. It may be nice if t made this a nice experience anyway, though.

Scenario:

  • user a follows user b on twitter
  • user a uses t to follow user b
  • user b gets an email from Twitter saying that user a is now following them

Twitter isn't checking to see if you already follow that user, they blindly send the following email anyway.

It might be nice if t:

  • checked against the users you already follow
  • make a follow event a no-op if you already follow that account
  • no-op vs. error since this most often happens when following a list or piping names into t

I'm creating this ticket first to see if you think this is a good idea. I don't mind submitting a pull request for this if you're up for it.

cannot unfollow

I've successfully authorized and can pull leaders, followers, etc. However, when I attempt to unfollow I get:

mbmacbookpro:~ jonlorusso$ t unfollow Newsweek
/opt/local/bin/t: Read-only application cannot POST Run /opt/local/bin/t authorize --consumer-key=CONSUMER_KEY --consumer-secret=CONSUMER_SECRET to authorize.

Perhaps I'm doing something wrong.

Cannot install t!

So... i have Ruby 1.8.7 (on an undercover cop - haha)
and I am using Darwin (Mac OS 10.7.4 - Lion) -

I get this:

mini-me:~ Home$ sudo gem install t
Building native extensions. This could take a while...
ERROR: Error installing t:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
mini-me:~ Home$ t authorize
-bash: t: command not found

*** I then check the version again ***

mini-me:~ Home$ ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]

So, any clue?

uninitialized constant Faraday::Adapter::NetHttp::Zlib (NameError)

I feel like a problem child... I updated t, but now erring out when opening. I've even checked the .trc file this time :)

When opening I'm getting the following error:
/Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday/adapter/net_http.rb:21: uninitialized constant Faraday::Adapter::NetHttp::Zlib (NameError)
from /Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday.rb:67:in const_get' from /Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday.rb:67:inlookup_middleware'
from /Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday/builder.rb:146:in use_symbol' from /Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday/builder.rb:108:inadapter'
from /Library/Ruby/Gems/1.8/gems/twitter-3.6.0/lib/twitter/default.rb:42
from /Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday/builder.rb:61:in build' from /Library/Ruby/Gems/1.8/gems/faraday-0.8.2/lib/faraday/builder.rb:50:ininitialize'
from /Library/Ruby/Gems/1.8/gems/twitter-3.6.0/lib/twitter/default.rb:44:in new' from /Library/Ruby/Gems/1.8/gems/twitter-3.6.0/lib/twitter/default.rb:44 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' from /Library/Ruby/Gems/1.8/gems/twitter-3.6.0/lib/twitter/configurable.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' from /Library/Ruby/Gems/1.8/gems/twitter-3.6.0/lib/twitter/client.rb:4 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' from /Library/Ruby/Gems/1.8/gems/twitter-3.6.0/lib/twitter.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' from /Library/Ruby/Gems/1.8/gems/t-1.0.1/lib/t/cli.rb:4 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' from /Library/Ruby/Gems/1.8/gems/t-1.0.1/lib/t.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' from /Library/Ruby/Gems/1.8/gems/t-1.0.1/bin/t:4 from /usr/bin/t:23:inload'
from /usr/bin/t:23

Instead open browser to authenticate, show the url to copy/paste

It would be great to show the url to let the user open the browser, or like myself, open a browser in a remote computer.

The explanation is because I want T to be installed in a headless (only cli interface, no web browser, etc.) computer and cannot authenticate because I have no web browser at all, and it shows the url in a strange way:

Paste in the supplied PIN: /usr/bin/xdg-open: line 377: htmlview: command not found
/usr/bin/xdg-open: line 377: firefox: command not found
/usr/bin/xdg-open: line 377: mozilla: command not found
/usr/bin/xdg-open: line 377: netscape: command not found
/usr/bin/xdg-open: line 377: links: command not found
/usr/bin/xdg-open: line 377: lynx: command not found
xdg-open: no method available for opening 'https://api.twitter.com/oauth/authorize?oauth_callback=oob&oauth_consumer_key=BLABLABLA

uninitialized constant Module::ParseError

This is more of a heads up than something that needs to be fixed, but after building this gem from source everything appeared to be running smoothly until I tried:

t mentions -n 10 -l | awk '{print $1}' | xargs t favorite

That resulted in a stack trace with the title error coming from multi_json-1.3.6. I am running ruby 1.9.3-p194 inside rvm.

After doing a bit of research, I installed the "json_pure" gem and it now works as expected.

Hope this helps.

Here's the complete stack trace in case it helps:

/Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/multi_json-1.3.6/lib/multi_json.rb:94:in `rescue in load': uninitialized constant Module::ParseError (NameError)
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/multi_json-1.3.6/lib/multi_json.rb:92:in `load'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/response/parse_json.rb:13:in `parse'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/response/parse_json.rb:19:in `on_complete'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/response.rb:9:in `block in call'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/response.rb:63:in `on_complete'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/response.rb:8:in `call'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/response.rb:8:in `call'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/request/url_encoded.rb:14:in `call'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:13:in `call'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/request/multipart_with_file.rb:21:in `call'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/faraday-0.8.4/lib/faraday/connection.rb:226:in `run_request'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/client.rb:71:in `request'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/client.rb:41:in `post'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/api.rb:2350:in `object_from_response'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/api.rb:1448:in `block in favorite'
    from /Users/daryl/.rvm/gems/ruby-1.9.3-p194/gems/twitter-4.1.0/lib/twitter/core_ext/enumerable.rb:6:in `block (2 levels) in threaded_map'

Daryl

Gem install taking too long?

Not sure if this is an issue but gem install is taking too long. Even if I forked the master(I wanted to get the latest color changes) and did rake install) or even just rake build then gem install pkg/t... it is taking like forever. Is it downloading a lot of gems ro something?

yaml syntax error on load

t has been working GREAT over the last week. This morning I noticed the scripts that I have reference the application were erring out. So I went into the command line and if I try to open t I get the following error:
t
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in load': syntax error on line 49, col -1:' (ArgumentError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in load' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:144:inload_file'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:143:in open' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:143:inload_file'
from /Library/Ruby/Gems/1.8/gems/t-0.9.9/lib/t/rcfile.rb:63:in load' from /Library/Ruby/Gems/1.8/gems/t-0.9.9/lib/t/rcfile.rb:11:ininitialize'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/singleton.rb:94:in new' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/singleton.rb:94:ininstance'
from /Library/Ruby/Gems/1.8/gems/t-0.9.9/lib/t/cli.rb:39:in initialize' from /Library/Ruby/Gems/1.8/gems/thor-0.15.4/lib/thor.rb:271:innew'
from /Library/Ruby/Gems/1.8/gems/thor-0.15.4/lib/thor.rb:271:in dispatch' from /Library/Ruby/Gems/1.8/gems/thor-0.15.4/lib/thor/base.rb:425:instart'
from /Library/Ruby/Gems/1.8/gems/t-0.9.9/bin/t:13
from /usr/bin/t:23:in `load'
from /usr/bin/t:23

I've tried un-installing and re-installig, but no luck.

Add "tail -f" like switch for timeline

It would be very interesting to use the streaming api to pull tweets from your timeline in realtime in a "watcher" mode. Eg. running t timeline -f would print the n latest tweets (oldest to newest) and periodically append the latest tweets as they come to a new line.

list of followers of a user

Hi,
Is there any command to get list of all followers of a user as for example i want all followers of sachin...????

Thanks,
prerna

Error after authorizing another account

Hi,

I have just authorized another account and I got this error :

$ t help
/usr/local/ruby/lib/ruby/1.9.1/syck.rb:135:in load': syntax error on line 21, col -1:' (ArgumentError)
from /usr/local/ruby/lib/ruby/1.9.1/syck.rb:135:in load' from /usr/local/ruby/lib/ruby/1.9.1/syck.rb:146:inblock in load_file'
from /usr/local/ruby/lib/ruby/1.9.1/syck.rb:145:in open' from /usr/local/ruby/lib/ruby/1.9.1/syck.rb:145:inload_file'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.4/lib/t/rcfile.rb:63:in load' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.4/lib/t/rcfile.rb:12:ininitialize'
from /usr/local/ruby/lib/ruby/1.9.1/singleton.rb:109:in new' from /usr/local/ruby/lib/ruby/1.9.1/singleton.rb:109:inblock in instance'
from internal:prelude:10:in synchronize' from /usr/local/ruby/lib/ruby/1.9.1/singleton.rb:107:ininstance'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.4/lib/t/cli.rb:53:in initialize' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor.rb:271:innew'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor.rb:271:in dispatch' from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/thor-0.15.0/lib/thor/base.rb:408:instart'
from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/t-0.9.4/bin/t:11:in <top (required)>' from /usr/local/ruby/bin/t:23:inload'
from /usr/local/ruby/bin/t:23:in `

'

Thx so much

Broken when installed using brew-gem

This is potentially an issue with josh/brew-gem, but I can successfully install t via brew gem t however when I try to run anything with t I get:

Faraday: you may want to install system_timer for reliable timeouts
/usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_dispatch.rb:35:in `require': no such file to load -- rack (LoadError)
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_dispatch.rb:35
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_view/helpers/url_helper.rb:5:in `require'
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_view/helpers/url_helper.rb:5
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_view/helpers/form_tag_helper.rb:18
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_view/helpers/form_helper.rb:4:in `require'
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_view/helpers/form_helper.rb:4
from /usr/local/Cellar/t/0.9.1/gems/actionpack-3.2.3/lib/action_view/helpers.rb:46
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t/printable.rb:12
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t/list.rb:10:in `require'
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t/list.rb:10
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t/cli.rb:17:in `require'
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t/cli.rb:17
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t.rb:1:in `require'
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/lib/t.rb:1
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/bin/t:3:in `require'
from /usr/local/Cellar/t/0.9.1/gems/t-0.9.1/bin/t:3
from /usr/local/bin/t:3:in `load'
from /usr/local/bin/t:3'

This is on a pretty fresh system install of OSX, so I suspect this might be a dependency problem or a problem with how brew-gem handles dependencies. Installing actionpack with gem install actionpack worked successfully but had no impact on the error. This is using stock OSX Ruby 1.8.7 and not using rbenv.

Junk being written to .trc

For some reason, when I authorize an account, the tool writes a few characters from the end of that accounts "secret" value for that account as an extra line at the end of the YAML file. This causes Psych to fail with a Psych::SyntaxError. If I manually delete the extra characters, the file parses normally.

Json error in latest gem's timeline command

Snowy: ~:$ t version
Faraday: you may want to install system_timer for reliable timeouts
0.7.0
Snowy: ~:$ t timeline -l
Faraday: you may want to install system_timer for reliable timeouts
/Users/eumir/.rvm/gems/ruby-1.9.2-p290@t/gems/json-1.7.0/ext/json/ext/json/ext/parser.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

Abort trap: 6

Work around rate limit issues

/Users/giro/.rvm/gems/ruby-1.9.3-p194/bin/t: Rate limit exceeded. Clients may not make more than 350 requests per hour.

How about handling this error by sleeping with exponential backoff number of seconds? Should result in resilient scripts with robust performance.

t stream timeline, errors. ubuntu 12.04

mark@ubuntu:~$ t stream timeline
/var/lib/gems/1.8/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:458:in parser_from': undefined methodadapter=' for MultiJson:Module (NoMethodError)
from /var/lib/gems/1.8/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:41:in json_parser' from /var/lib/gems/1.8/gems/tweetstream-1.1.5/lib/tweetstream/client.rb:36:ininitialize'
from /var/lib/gems/1.8/gems/t-0.9.6/lib/t/stream.rb:107:in new' from /var/lib/gems/1.8/gems/t-0.9.6/lib/t/stream.rb:107:inclient'
from /var/lib/gems/1.8/gems/t-0.9.6/lib/t/stream.rb:67:in timeline' from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:insend'
from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:in run' from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:120:ininvoke_task'
from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor.rb:275:in dispatch' from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:109:insend'
from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:109:in invoke' from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor.rb:213:instream'
from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:in send' from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/task.rb:27:inrun'
from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/invocation.rb:120:in invoke_task' from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor.rb:275:indispatch'
from /var/lib/gems/1.8/gems/thor-0.15.2/lib/thor/base.rb:408:in start' from /var/lib/gems/1.8/gems/t-0.9.6/bin/t:11 from /usr/local/bin/t:19:inload'
from /usr/local/bin/t:19

Only seeing 4 chars of help text comments

I just pulled down the code, did rake install, then just ran t to see what would happen. I got the help text that looks like this in an 80 char wide terminal:

$ t
Tasks:
  t accounts                                                       # List...
  t authorize -c, --consumer-key=KEY -s, --consumer-secret=SECRET  # Allo...
  t block USER [USER...]                                           # Bloc...
  t delete SUBCOMMAND ...ARGS                                      # Dele...
  t direct_messages                                                # Retu...
  t direct_messages_sent                                           # Retu...
...etc...

Because the t authorize line is so long, it's pushing all the other comments over so much that I only get to see 4 chars of them :( The other commands aren't nearly as long, so they have the potential to show much more of the comment.

undefined method `[]' for nil:NilClass (NoMethodError)

when I authorize twitter app, paste PIN to terminal, some error occured:

$HOME/.gem/ruby/1.9.1/gems/t-0.9.9/lib/t/rcfile.rb:19:in []=': undefined method[]' for nil:NilClass (NoMethodError)
from /home/v/.gem/ruby/1.9.1/gems/t-0.9.9/lib/t/cli.rb:79:in authorize' from /home/v/.gem/ruby/1.9.1/gems/thor-0.16.0/lib/thor/task.rb:27:inrun'
from /home/v/.gem/ruby/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:120:in invoke_task' from /home/v/.gem/ruby/1.9.1/gems/thor-0.16.0/lib/thor.rb:275:indispatch'
from /home/v/.gem/ruby/1.9.1/gems/thor-0.16.0/lib/thor/base.rb:425:in start' from /home/v/.gem/ruby/1.9.1/gems/t-0.9.9/bin/t:13:in<top (required)>'
from /home/v/.gem/ruby/1.9.1/bin/t:23:in load' from /home/v/.gem/ruby/1.9.1/bin/t:23:in

'

I use the command is 'proxychains t authorize --consumer-key MY-CONSUMER-KEY --consumer-secret MY-CONSUMER-SECRET', because I'm leave in China mainland.

Installation problem

Sorry, I'm afraid I'm a total Ruby noob - have installed Ruby 1.9.3 and DevKit (on Windows XP) without trouble, but attempting to install t throws up errors. Any suggestions where the problem may lie? I'm assuming the warnings aren't an issue, but the errors sound serious:

C:\>gem install t
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing t:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
checking for main() in -lssl... no
creating Makefile

make
generating rubyeventmachine-i386-mingw32.def
compiling binder.cpp
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is val
id for C/ObjC but not for C++
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is v
alid for C/ObjC but not for C++
In file included from binder.cpp:20:0:
project.h:85:0: warning: "FD_SETSIZE" redefined
<command-line>:0:0: note: this is the location of the previous definition
In file included from project.h:137:0,
                 from binder.cpp:20:
binder.h:35:34: warning: type qualifiers ignored on function return type
In file included from project.h:138:0,
                 from binder.cpp:20:
em.h:91:47: warning: type qualifiers ignored on function return type
em.h:92:76: warning: type qualifiers ignored on function return type
em.h:93:56: warning: type qualifiers ignored on function return type
em.h:95:57: warning: type qualifiers ignored on function return type
em.h:96:60: warning: type qualifiers ignored on function return type
em.h:97:58: warning: type qualifiers ignored on function return type
em.h:98:55: warning: type qualifiers ignored on function return type
em.h:99:36: warning: type qualifiers ignored on function return type
em.h:101:47: warning: type qualifiers ignored on function return type
em.h:106:42: warning: type qualifiers ignored on function return type
em.h:123:45: warning: type qualifiers ignored on function return type
em.h:132:36: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from binder.cpp:20:
eventmachine.h:45:61: warning: type qualifiers ignored on function return type
eventmachine.h:46:112: warning: type qualifiers ignored on function return type
eventmachine.h:47:69: warning: type qualifiers ignored on function return type
eventmachine.h:49:73: warning: type qualifiers ignored on function return type
eventmachine.h:62:75: warning: type qualifiers ignored on function return type
eventmachine.h:63:74: warning: type qualifiers ignored on function return type
eventmachine.h:64:77: warning: type qualifiers ignored on function return type
eventmachine.h:65:41: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from binder.cpp:20:
eventmachine.h:99:60: warning: type qualifiers ignored on function return type
eventmachine.h:100:58: warning: type qualifiers ignored on function return type
eventmachine.h:102:60: warning: type qualifiers ignored on function return type
eventmachine.h:105:41: warning: type qualifiers ignored on function return type
compiling cmain.cpp
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is val
id for C/ObjC but not for C++
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is v
alid for C/ObjC but not for C++
In file included from cmain.cpp:20:0:
project.h:85:0: warning: "FD_SETSIZE" redefined
<command-line>:0:0: note: this is the location of the previous definition
In file included from project.h:137:0,
                 from cmain.cpp:20:
binder.h:35:34: warning: type qualifiers ignored on function return type
In file included from project.h:138:0,
                 from cmain.cpp:20:
em.h:91:47: warning: type qualifiers ignored on function return type
em.h:92:76: warning: type qualifiers ignored on function return type
em.h:93:56: warning: type qualifiers ignored on function return type
em.h:95:57: warning: type qualifiers ignored on function return type
em.h:96:60: warning: type qualifiers ignored on function return type
em.h:97:58: warning: type qualifiers ignored on function return type
em.h:98:55: warning: type qualifiers ignored on function return type
em.h:99:36: warning: type qualifiers ignored on function return type
em.h:101:47: warning: type qualifiers ignored on function return type
em.h:106:42: warning: type qualifiers ignored on function return type
em.h:123:45: warning: type qualifiers ignored on function return type
em.h:132:36: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from cmain.cpp:20:
eventmachine.h:45:61: warning: type qualifiers ignored on function return type
eventmachine.h:46:112: warning: type qualifiers ignored on function return type
eventmachine.h:47:69: warning: type qualifiers ignored on function return type
eventmachine.h:49:73: warning: type qualifiers ignored on function return type
eventmachine.h:62:75: warning: type qualifiers ignored on function return type
eventmachine.h:63:74: warning: type qualifiers ignored on function return type
eventmachine.h:64:77: warning: type qualifiers ignored on function return type
eventmachine.h:65:41: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from cmain.cpp:20:
eventmachine.h:99:60: warning: type qualifiers ignored on function return type
eventmachine.h:100:58: warning: type qualifiers ignored on function return type
eventmachine.h:102:60: warning: type qualifiers ignored on function return type
eventmachine.h:105:41: warning: type qualifiers ignored on function return type
cmain.cpp:98:71: warning: type qualifiers ignored on function return type
cmain.cpp:109:122: warning: type qualifiers ignored on function return type
cmain.cpp:119:79: warning: type qualifiers ignored on function return type
cmain.cpp:129:83: warning: type qualifiers ignored on function return type
cmain.cpp:260:85: warning: type qualifiers ignored on function return type
cmain.cpp:270:84: warning: type qualifiers ignored on function return type
cmain.cpp:280:88: warning: type qualifiers ignored on function return type
cmain.cpp:290:51: warning: type qualifiers ignored on function return type
cmain.cpp:300:70: warning: type qualifiers ignored on function return type
cmain.cpp:320:55: warning: type qualifiers ignored on function return type
cmain.cpp:546:70: warning: type qualifiers ignored on function return type
cmain.cpp:669:68: warning: type qualifiers ignored on function return type
cmain.cpp: In function 'int evma_send_file_data_to_connection(long unsigned int,
 const char*)':
cmain.cpp:752:6: error: cannot convert 'stat*' to '_stati64*' for argument '2' t
o 'int _fstati64(int, _stati64*)'
make: *** [cmain.o] Error 1


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmach
ine-0.12.10 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/g
em_make.out

Argument Error while installing gem?

I am trying to install the gem and I get the following:
ERROR: While executing gem ... (ArgumentError)
invalid byte sequence in US-ASCII

The last thing it fetches before hand is thor-0.16.0.gem

If it helps, my machine is running Windows Vista.

Thanks in advance!

Slightly odd phrasing for time ago when updating twitter status

Just trying out t now, and the first thing I did was try a tweet. Here's the output:

$ t update 'Woot! Tweeting from the command-line using the awesome t, by @sferik — https://github.com/sferik/t'
Tweet created by @cobyism (about 0 year ago).

Run `t delete status 205102099422384128` to delete.

Specifically, it's the bit in brackets that says (about 0 year ago) that feels a bit odd me—not only does it feel a bit unnecessary to tell me how long ago the tweet was posted (I just posted it then, so I already know), but it's odd for it to say 0 <something> ago, and even odder for the word year not to be pluralized. If it were me, the output I'd choose to have would be either Tweet created by @cobyism (a few seconds ago)., or Tweet created by @cobyism (posted just now). or something similar. For the update command it may even be more appropriate to simply have a timestamp (UTC+X?) in the brackets for reference sake, e.g. Tweet created by @cobyism (at 12:34pm).

I had a quick look at the code, and it looks like you're using the stock time_ago_in_words function, but I'm not familiar enough with the codebase yet to know where else to look for the code that's doing this.

@sferik What is your take on this? If you've any suggestions for a better way you'd like to do it let me know and I'll see if I get time to work it up :)

Alias to t instead of hard-coding it

I do appreciate the brevity of just having to type t, but hard-coding it as the name of the executable takes away a precious character from the global namespace of single-character commands.

I would like to propose to rename the bin script to something longer (e.g. twit), and document that users can have back their beloved t with a simple

alias t=twit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.