コンソールからhub browse コマンドを呼ぶautomatorを作ってみた

Trending repositories on GitHub today をコンソールで見るrochefort/git-trend というのがあり、気になったのは hub コマンドのbrowseオプション でブラウザでチェックするというのが日課になっています。
(hubはコレ 。 )
 
hub browseをgbというエイリアスに登録して実行しているのですが、

  1. コンソールでコピペ
  2. gb って打ってペースト
  3. return

っていうルーチンワークがだるいので、automatorで自動化させてみました。

こんなかんじ

automator起動してサービスで新規作成し、shell で呼ぶだけ。
検索対象はアプリで絞ってもよいです。

f:id:rochefort:20141115235226j:plain

これで右クリック、コンテキストメニューのServiceから実行できます。

ショートカット割り当て

f:id:rochefort:20141115235505p:plain

これで捗ります。

実施例

aliasに以下のように参照したいlanguage毎に実行するように登録。

$ alias trend
trend='g trend -n 10 && echo && g trend -l ruby -n 3 && echo && g trend -l objective-c -n 3 && echo && g trend -l php -n 3'

あとは実行して、気になったgem名を選択して、automatorのサービスをショートカットでcallするだけ。

$ trend
No. Name                                     Lang          Star Description
--- ---------------------------------------- ----------- ------ ------------------------------------------------------------------------------------------------------------
  1 mozilla/metrics-graphics                 JavaScript    1169 A library optimized for concise, principled data graphics and layouts.
  2 dotnet/corefx                            C#             375 This repository contains the foundational libraries that make up the .NET Core development stack.
  3 breach/thrust                            C++            373 Chromium-based cross-platform / cross-language application framework
  4 Microsoft/dotnet                                        308 dotnet is the official home of .NET on GitHub. It's a starting point to find .NET OSS projects from Micro...
  5 Ideon/SmudgeKit                          Objective-C    236 A drop in replacement for UIWindow to draw touch points for app previews and promotional videos.
  6 VincentGarreau/particles.js              JavaScript     214
  7 clusterinc/SketchToAppStore                             185 A sketch framework to make creating screenshots for the App Store incredibly simple
  8 kconner/KMCGeigerCounter                 Objective-C    185 A framerate meter that clicks like a Geiger counter when your animation drops a frame
  9 callemall/material-ui                    CSS            166 A CSS Framework and a Set of React Components that Implement Google's Material Design.
 10 nate-parrott/Flashlight                  Objective-C    149 The missing Spotlight plugin system

No. Name                                     Lang         Star Description
--- ---------------------------------------- ---------- ------ -------------------------------------------------------------------------------------------------------------
  1 KrauseFx/frameit                         Ruby          140 Want a device frame around your screenshot? Do it in an instant!
  2 KrauseFx/snapshot                        Ruby           33 Create hundreds of screenshots of your iPhone app... while doing something else.
  3 senny/sablon                             Ruby           30 Document Template Processor based on docx templates and Mail Merge fields.

No. Name                                     Lang          Star Description
--- ---------------------------------------- ----------- ------ ------------------------------------------------------------------------------------------------------------
  1 Ideon/SmudgeKit                          Objective-C    243 A drop in replacement for UIWindow to draw touch points for app previews and promotional videos.
  2 kconner/KMCGeigerCounter                 Objective-C    189 A framerate meter that clicks like a Geiger counter when your animation drops a frame
  3 nate-parrott/Flashlight                  Objective-C    145 The missing Spotlight plugin system

No. Name                                     Lang         Star Description
--- ---------------------------------------- ---------- ------ -------------------------------------------------------------------------------------------------------------
  1 laravel/laravel                          PHP            20 A PHP Framework For Web Artisans
  2 umpirsky/country-list                    PHP            21 List of all countries with names and ISO 3166-1 codes in all languages and data formats.
  3 yiisoft/yii2                             PHP            15 Yii 2 framework main development repo

See Also.

automatorを使ってコンテキストメニューにサービス追加 - rochefort's blog