2

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?

4

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:

  • 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
1

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.

-1

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

  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .