Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I love the Notification center gesture and would love to be able to glance at my full Twitter stream that way. How can I put all of Twitter into that notification area?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

You can get the home timeline from the Twitter API and display tweets using terminal-notifier.

#!/usr/bin/env ruby -KU -rubygems

require 'twitter'
require 'cgi'

Twitter.configure do |config|
  config.consumer_key = ""
  config.consumer_secret = ""
  config.oauth_token = ""
  config.oauth_token_secret = ""
end

timeline = Twitter.home_timeline
first = timeline.first.id
previous = `defaults read me.lri.scripts nctwitter 2> /dev/null`.chomp
minid = previous == "" ? 0 : previous.to_i + 1
`defaults write me.lri.scripts nctwitter #{first}`

timeline.each do |tweet|
  break if tweet.id <= minid
  system("terminal-notifier", "-message", CGI.unescapeHTML(tweet.text),
  "-title", tweet.user.screen_name)
  # system("/usr/local/bin/growlnotify", "-t", tweet.user.screen_name,
  # "-m", CGI.unescapeHTML(tweet.text))
end

growlnotify would stack multiple notifications and not clip the text in long tweets.

The Twitter library can be installed with sudo gem install twitter.

You can run the script every minute by editing the crontab with EDITOR=nano crontab -e and adding a line like * * * * * ~/bin/nctwitter.


A recent update to Tweetbot added an option to send notifications for all tweets:

share|improve this answer
    
Nice listing! Wondering why you did come up with this when you actually believe it wouldn't make any sense :) –  myhd Sep 26 '12 at 21:32
add comment

You could also use the Growl app which will show all tweets you are interested in.

share|improve this answer
1  
Could you elaborate on your answer more? How would one set up Growl to do this, etc? –  jmlumpkin Sep 9 '12 at 15:44
add comment

You can’t get your Twitter stream in the Notification Center. Only those tweets that someone sends to you or those of the people you follow are sent to the Notification Center.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.