Permalink
Browse files

Add more scripts.

  • Loading branch information...
1 parent 796b8c3 commit c1af5ebdaf32438000868a7e51d972fc7bca6d1b @maxim maxim committed Mar 6, 2011
Showing with 87 additions and 2 deletions.
  1. +20 −0 gt_commits_count
  2. +4 −0 gt_date
  3. +3 −0 next_episodes → gt_episodes
  4. +11 −0 gt_gmail_count
  5. +1 −1 gt_lh
  6. +1 −1 my_stats → gt_my_stats
  7. +9 −0 gt_printio_deploy
  8. +2 −0 printio_stats → gt_printio_stats
  9. +9 −0 gt_weather_current
  10. +9 −0 gt_weather_description
  11. +18 −0 open_rp_song
View
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+# Intended for use with geektool.
+
+require 'rubygems'
+require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
+
+
+options_for __FILE__, :author => { :required => true,
+ :text => 'Name of author whose commits to count.'},
+ :projects => { :required => true, :type => Array,
+ :text => 'List of paths to projects in which to count commits.'}
+
+entries = @projects.map do |path|
+ " #{`cd #{path} && git log --all --since=yesterday --until=today --pretty=oneline --author=#{@author} | wc -l`.strip} in #{File.basename(path)}"
+end
+
+puts <<-STATS
+my commits since yesterday
+#{entries.join("\n")}
+STATS
View
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+# Intended for use with geektool.
+
+date '+%B %d'
@@ -5,6 +5,9 @@ require 'open-uri'
require 'nokogiri'
require 'time'
+# TODO:
+# Clean all of this up. Fix bugs.
+
# USAGE:
# Put ids of IMDB shows here:
movie_ids = %w(tt0773262 tt0121955 tt0182576 tt0460649 tt0903747 tt0412142)
View
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+# Intended for use with geektool.
+
+require 'rubygems'
+require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
+
+options_for __FILE__, :user => { :required => true, :text => 'Gmail username.'},
+ :pass => { :required => true, :text => 'Gmail password.'}
+
+count = `curl --silent https://#{@user}:#{@pass}@mail.google.com/mail/feed/atom/inbox | grep fullcount | grep -o '[0-9]\\+'`.strip
+puts "#{count} emails"
View
2 gt_lh
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# Outputs latest milestone tickets from a Lightohuse project.
-# Intended for geektool.
+# Intended for use with geektool.
require 'rubygems'
require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
View
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# Outputs twitter followers count, stack overflow reputation, and feedburner subscribers.
-# Intended for geektool.
+# Intended for use with geektool.
require 'rubygems'
require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
View
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+# Intended for use with geektool.
+
+require 'rubygems'
+require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
+
+options_for __FILE__, :dir => { :required => true }
+
+puts `cd #{@dir} && echo \`git log staging --max-count=1 --format=format:"printio was\\n staged %cr\\n"\` \`git log production --max-count=1 --format=format:"deployed %cr"\``
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby
+# Intended for use with geektool.
+
require 'rubygems'
require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
require 'yaml'
View
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+# Intended for use with geektool.
+
+require 'rubygems'
+require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
+
+options_for __FILE__, :code => { :required => true, :text => 'Weather station code.'}
+
+puts `curl --silent "http://xml.weather.yahoo.com/forecastrss?p=#{@code}&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \\/>//' -e 's/<b>//' -e 's/<\\/b>//' -e 's/<BR \\/>//' -e 's///' -e 's/<\\/description>//'`.strip
View
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+# Intended for use with geektool.
+
+require 'rubygems'
+require "#{File.expand_path(File.dirname(__FILE__))}/support/helpers"
+
+options_for __FILE__, :zip => { :required => true, :text => 'Weather location zip code.'}
+
+puts `curl -s "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=#{@zip}" | awk '/Today is/ || /Tomorrow is/' | textutil -convert txt -stdin -stdout -format html | sed -e 's/is forecast to/should/' -e 's/\\.//' | tr '[:upper:]' '[:lower:]'`.strip
View
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+# Open RP Song
+#
+# Opens currently playing Radio Paradise song in the default browser.
+#
+# Example usage:
+# - download to ~/scripts
+# - chmod +x open_rp_song.rb
+# - in QuickSilver add a hotkey trigger to run this file (i used ctrl+cmd+r)
+
+require 'open-uri'
+page = open('http://www.radioparadise.com/content.php?name=Playlist').read
+song_id = page[/song_id=(\d+)/, 1]
+song_keywords = page.match(/#{song_id}">([^<]+)<br>([^<]+)</)[1,2].join(' ').downcase.gsub(/[^\d\w\s]/, '').squeeze(' ')
+
+system "open", "http://www.radioparadise.com/content.php?name=songinfo&song_id=#{song_id}"
+system "open", "http://binsearch.info/?q=#{song_keywords}&max=250&adv_age="

0 comments on commit c1af5eb

Please sign in to comment.