You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.8 KiB

<?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>bundleid</key>
<string>com.alfredapp.david.googlesuggest</string>
<key>connections</key>
<dict>
<key>63F60794-BB56-4415-9372-BAF974C3A7E1</key>
<array>
<dict>
<key>destinationuid</key>
<string>B8FFA3AB-AD7D-4316-A84F-5958A671D4FF</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
</dict>
<key>createdby</key>
<string>David Ferguson</string>
<key>description</key>
<string>Get Google Search Suggestions</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Google Suggest</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>36</integer>
<key>keyword</key>
<string>g</string>
<key>runningsubtext</key>
<string>Retrieving search suggestions ...</string>
<key>script</key>
<string>require_once('workflows.php');
$wf = new Workflows();
$orig = "{query}";
$xml = $wf-&gt;request( "http://google.com/complete/search?output=toolbar&amp;q=".urlencode( $orig ) );
$xml = simplexml_load_string( utf8_encode($xml) );
$int = 1;
foreach( $xml as $sugg ):
$data = $sugg-&gt;suggestion-&gt;attributes()-&gt;data;
$wf-&gt;result( $int.'.'.time(), "$data", "$data", 'Search Google for '.$data, 'icon.png' );
$int++;
endforeach;
$results = $wf-&gt;results();
if ( count( $results ) == 0 ):
$wf-&gt;result( 'googlesuggest', $orig, 'No Suggestions', 'No search suggestions found. Search Google for '.$orig, 'icon.png' );
endif;
echo $wf-&gt;toxml();</string>
<key>subtext</key>
<string>Search Google with Suggestions</string>
<key>title</key>
<string>Search Google</string>
<key>type</key>
<integer>1</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>63F60794-BB56-4415-9372-BAF974C3A7E1</string>
<key>version</key>
<integer>0</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>searcher</key>
<integer>1635215215</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.systemwebsearch</string>
<key>uid</key>
<string>B8FFA3AB-AD7D-4316-A84F-5958A671D4FF</string>
<key>version</key>
<integer>0</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>63F60794-BB56-4415-9372-BAF974C3A7E1</key>
<dict>
<key>ypos</key>
<real>60</real>
</dict>
<key>B8FFA3AB-AD7D-4316-A84F-5958A671D4FF</key>
<dict>
<key>ypos</key>
<real>60</real>
</dict>
</dict>
<key>webaddress</key>
<string>dferg.us</string>
</dict>
</plist>