Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (42 sloc) 1.33 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby -rjcode -Ku
SUPPORT = ENV['TM_SUPPORT_PATH']
DIALOG = ENV['DIALOG']
require SUPPORT + '/lib/escape'
require SUPPORT + '/lib/osx/plist'
require SUPPORT + '/lib/exit_codes'
require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/yahoo"
input = STDIN.read
query = e_url(input)
yahoo = RelatedSuggestion.new('TM_YAHOO', query, 'all', 10, 1, nil, 1)
ysuggest = []
yahoo.parse_analysis.each {|result|
ysuggest &lt;&lt; {
'title' =&gt; result}
}
plist = { 'menuItems' =&gt; ysuggest }.to_plist
res = OSX::PropertyList.load(`#{e_sh DIALOG} -up #{e_sh plist}`)
abort unless res.has_key? 'selectedMenuItem'
TextMate.exit_replace_text res['selectedMenuItem']['title']</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^Y</string>
<key>name</key>
<string>Yahoo Related Suggestion</string>
<key>output</key>
<string>replaceSelectedText</string>
<key>scope</key>
<string>text</string>
<key>uuid</key>
<string>6511380B-D4C7-408B-85FF-9E98C6AAEB4A</string>
</dict>
</plist>
Something went wrong with that request. Please try again.