├── CDN-Searcher ├── ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png ├── FileCache.php ├── default.png ├── icon.png ├── info.plist ├── remote.json ├── update.json └── workflows.php ├── Copy-Path ├── 5D2EEEE3-220B-41FF-934E-FB25C7ED8A1B.png ├── icon.png └── info.plist ├── Downloads ├── CDN-Searcher.alfredworkflow ├── Copy-Path.alfredworkflow ├── GeekPark.alfredworkflow ├── SEO-Checker.alfredworkflow ├── Shorten-URL.alfredworkflow ├── Sublime-Like.alfredappearance ├── V2EX.alfredworkflow ├── Workflow-Searcher.alfredworkflow ├── XAMPP-Control.alfredextension └── extra │ ├── CDN-Searcher-latest.png │ ├── CDN-Searcher-logo.png │ ├── Copy-Path-demo.png │ ├── Copy-Path-logo.png │ ├── GeekPark-logo.png │ ├── GeekPark-screenshot.png │ ├── SEO-Checker-input.png │ ├── SEO-Checker-logo.png │ ├── SEO-Checker-notification.png │ ├── Shorten URL(with su.pr).alfredworkflow │ ├── Shorten-URL-icon.png │ ├── Shorten-URL-notification.png │ ├── Shorten-URL-trigger.png │ ├── Shorten-URL-workflow.png │ ├── Sublime-Like-1.png │ ├── Sublime-like.png │ ├── V2EX-latest.png │ ├── V2EX-logo.png │ ├── V2EX-user.png │ ├── V2EX-workflow.png │ ├── Workflow-Searcher-logo.png │ ├── Workflow-Searcher-screenshot.png │ ├── XAMPP-Control-icon.png │ └── XAMPP-Control-trigger.png ├── GeekPark ├── ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png ├── default.png ├── icon.png ├── info.plist ├── remote.json ├── update.json └── workflows.php ├── Quick-Open-Finder ├── icon.png └── info.plist ├── README.md ├── SEO-Checker ├── E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E.png ├── favicons │ ├── alexa.png │ └── pr.png ├── feedback.py ├── icon.png └── info.plist ├── Shorten-URL ├── FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904.png ├── favicons │ ├── bit.ly.png │ ├── git.io.png │ ├── goo.gl.png │ ├── is.gd.png │ ├── j.mp.png │ ├── t.cn.png │ └── v.gd.png ├── feedback.py ├── feedback.pyc ├── icon.png ├── info.plist ├── remote.json ├── shorten_url.py └── update.json ├── V2EX ├── ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png ├── icon.png ├── info.plist ├── temp_avatar │ └── default.png └── workflows.php ├── Workflow-Searcher ├── ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png ├── FileCache.php ├── default.png ├── icon.png ├── info.plist ├── remote.json ├── update.json └── workflows.php └── XAMPP-Control ├── README.md ├── icon.png ├── info.plist ├── kudos.plist ├── screenshot.png ├── update.xml └── version.xml /CDN-Searcher/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/CDN-Searcher/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png -------------------------------------------------------------------------------- /CDN-Searcher/FileCache.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.8.1 20120620 8 | */ 9 | 10 | final class FileCache 11 | { 12 | 13 | private static $_iscache = true; 14 | private static $_cachedir = '/tmp/'; 15 | private static $_cachetime = 3600; 16 | 17 | public static function get($key=false,$d=false) 18 | { 19 | if(empty($key) or !self::$_iscache) 20 | { 21 | return false; 22 | } 23 | $filename = self::get_filename($key,$d); 24 | if(!file_exists($filename)) 25 | { 26 | return false; 27 | } 28 | $data = file_get_contents($filename); 29 | $data = unserialize($data); 30 | $time = (int)$data['time']; 31 | $data = $data['data']; 32 | if($time>time()) 33 | { 34 | return $data; 35 | } 36 | else 37 | { 38 | return false; 39 | } 40 | } 41 | 42 | public static function set($key=false,$value=false,$t=0,$d=false) 43 | { 44 | if(empty($key) or !self::$_iscache) 45 | { 46 | return false; 47 | } 48 | $t = (int)$t ? (int)$t : self::$_cachetime; 49 | $filename = self::get_filename($key,$d); 50 | if(!self::is_mkdir(dirname($filename))) 51 | { 52 | return false; 53 | } 54 | $data['time'] = time()+$t; 55 | $data['data'] = $value; 56 | $data = serialize($data); 57 | if(PHP_VERSION >= '5') 58 | { 59 | file_put_contents($filename,$data); 60 | } 61 | else 62 | { 63 | $handle = fopen($filename,'wb'); 64 | fwrite($handle,$data); 65 | fclose($handle); 66 | } 67 | return true; 68 | } 69 | 70 | public static function un_set($key=false,$d=false) 71 | { 72 | if(empty($key)) 73 | { 74 | return false; 75 | } 76 | $filename = self::get_filename($key,$d); 77 | @unlink($filename); 78 | return true; 79 | } 80 | 81 | public static function get_filename($key=false,$d=false) 82 | { 83 | if(empty($key)) 84 | { 85 | return false; 86 | } 87 | $dir = empty($d) ? self::$_cachedir : $d ; 88 | $key_md5 = md5($key); 89 | $filename = rtrim($dir,'/').'/'.substr($key_md5,0,2).'/'.substr($key_md5,2,2).'/'.substr($key_md5,4,2).'/'.$key_md5; 90 | return $filename; 91 | } 92 | 93 | public static function is_mkdir($dir='') 94 | { 95 | if(empty($dir)) 96 | { 97 | return false; 98 | } 99 | if(!is_writable($dir)) 100 | { 101 | if(!@mkdir($dir,0777,true)) 102 | { 103 | return false; 104 | } 105 | } 106 | return true; 107 | } 108 | 109 | } 110 | 111 | ?> -------------------------------------------------------------------------------- /CDN-Searcher/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/CDN-Searcher/default.png -------------------------------------------------------------------------------- /CDN-Searcher/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/CDN-Searcher/icon.png -------------------------------------------------------------------------------- /CDN-Searcher/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.cdnsearcher.hzlzh 7 | connections 8 | 9 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 10 | 11 | 12 | destinationuid 13 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 21 | 22 | 23 | destinationuid 24 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 25 | modifiers 26 | 1048576 27 | modifiersubtext 28 | Copy and Open 29 | 30 | 31 | destinationuid 32 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 33 | modifiers 34 | 0 35 | modifiersubtext 36 | 37 | 38 | 39 | destinationuid 40 | 5C0825B6-635B-478A-839C-3457CD7772BE 41 | modifiers 42 | 0 43 | modifiersubtext 44 | 45 | 46 | 47 | 48 | createdby 49 | hzlzh 50 | description 51 | Search CDN links from staticfile.org 52 | disabled 53 | 54 | name 55 | CDN Searcher 56 | objects 57 | 58 | 59 | config 60 | 61 | plusspaces 62 | 63 | url 64 | {query} 65 | utf8 66 | 67 | 68 | type 69 | alfred.workflow.action.openurl 70 | uid 71 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 72 | version 73 | 0 74 | 75 | 76 | config 77 | 78 | lastpathcomponent 79 | 80 | onlyshowifquerypopulated 81 | 82 | output 83 | 0 84 | removeextension 85 | 86 | sticky 87 | 88 | text 89 | {query} 90 | title 91 | CDN Link copied! 92 | 93 | type 94 | alfred.workflow.output.notification 95 | uid 96 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 97 | version 98 | 0 99 | 100 | 101 | config 102 | 103 | action 104 | 0 105 | argument 106 | 1 107 | hotkey 108 | 0 109 | hotmod 110 | 0 111 | leftcursor 112 | 113 | modsmode 114 | 0 115 | 116 | type 117 | alfred.workflow.trigger.hotkey 118 | uid 119 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 120 | version 121 | 0 122 | 123 | 124 | config 125 | 126 | argumenttype 127 | 0 128 | escaping 129 | 63 130 | keyword 131 | cdn 132 | runningsubtext 133 | Wait, searching … … on staticfile.org API 134 | script 135 | /* 136 | # Project Source 137 | 138 | * API: https://github.com/hzlzh/AlfredWorkflow.com 139 | 140 | * Github: https://github.com/hzlzh/Alfred-Workflows 141 | * Blog Post: https://zlz.im/Alfred-Workflows/ 142 | 143 | # Contact 144 | 145 | * hzlzh (hzlzh.dev@gmail.com) 146 | * Twitter: https://twitter.com/hzlzh 147 | */ 148 | require_once('workflows.php'); 149 | require_once('FileCache.php'); 150 | 151 | function load_data($api,$query) { 152 | 153 | $opts = array( 154 | 'http'=>array( 155 | 'method'=>"GET", 156 | 'timeout'=>10 157 | ) 158 | ); 159 | $context = stream_context_create($opts); 160 | $obj = false; 161 | 162 | 163 | $fck = md5($query); 164 | $data = FileCache::get($fck); 165 | if(!$data) 166 | { 167 | $xml = @file_get_contents( $api.$query,false, $context); 168 | $data = $xml; 169 | FileCache::set($fck,$data,86400); 170 | } 171 | $obj=json_decode($data); 172 | 173 | return $obj; 174 | } 175 | 176 | $wf = new Workflows(); 177 | 178 | $orig = "{query}"; 179 | 180 | 181 | date_default_timezone_set('Asia/Shanghai'); 182 | if($orig){ 183 | $obj = load_data('http://api.staticfile.org/v1/search?q=',$orig); 184 | $int = 1; 185 | if($obj != null): 186 | foreach( $obj->libs as $key => $item ): 187 | if(!stristr($item -> name, $orig) && !stristr($item -> description, $orig)) continue; 188 | 189 | $name = $item -> name; 190 | $filename = $item -> filename; 191 | $homepage = $item -> homepage; 192 | $version = $item -> version; 193 | $description = $item -> description; 194 | $workflow_type = $item -> workflow_type; 195 | $assets = $item -> assets; 196 | $repositories = $item -> repositories; 197 | $keywords = $item -> keywords; 198 | 199 | $wf->result( $name, 'http://cdn.staticfile.org/'.$name.'/'.$version.'/'.$filename, '[v'.$version.'] '.$name, $description . ' — @'.$homepage, 'default.png' ); 200 | $int++; 201 | endforeach; 202 | endif; 203 | } 204 | 205 | $results = $wf->results(); 206 | if ( count( $results ) == 0 ): 207 | $wf->result( 'CDNworkflow_500', 'Please make sure your internet works well.', 'No responce, try again!', 'Please make sure your internet works well.', 'icon.png' ); 208 | endif; 209 | 210 | echo $wf->toxml(); 211 | 212 | ?> 213 | subtext 214 | The result is from staticfile.org API 215 | title 216 | Input keyword to search CDN. 217 | type 218 | 1 219 | withspace 220 | 221 | 222 | type 223 | alfred.workflow.input.scriptfilter 224 | uid 225 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 226 | version 227 | 0 228 | 229 | 230 | config 231 | 232 | autopaste 233 | 234 | clipboardtext 235 | {query} 236 | 237 | type 238 | alfred.workflow.output.clipboard 239 | uid 240 | 5C0825B6-635B-478A-839C-3457CD7772BE 241 | version 242 | 0 243 | 244 | 245 | readme 246 | # Project Source 247 | 248 | * Github: https://github.com/hzlzh/Alfred-Workflows 249 | * Blog Post: https://zlz.im/Alfred-Workflows/ 250 | 251 | # Contact 252 | 253 | * hzlzh (hzlzh.dev@gmail.com) 254 | * Twitter: https://twitter.com/hzlzh 255 | uidata 256 | 257 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 258 | 259 | ypos 260 | 110 261 | 262 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 263 | 264 | ypos 265 | 200 266 | 267 | 5C0825B6-635B-478A-839C-3457CD7772BE 268 | 269 | ypos 270 | 320 271 | 272 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 273 | 274 | ypos 275 | 10 276 | 277 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 278 | 279 | ypos 280 | 200 281 | 282 | 283 | webaddress 284 | http://zlz.im/ 285 | 286 | 287 | -------------------------------------------------------------------------------- /CDN-Searcher/remote.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.0, 3 | "download_uri": "https://raw.github.com/hzlzh/Alfred-Workflows/master/Downloads/CDN-Searcher.alfredworkflow", 4 | "description": "First version." 5 | } 6 | -------------------------------------------------------------------------------- /CDN-Searcher/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.0, 3 | "remote_json": "https://raw.github.com/hzlzh/Alfred-Workflows/master/CDN-Searcher/remote.json" 4 | } 5 | -------------------------------------------------------------------------------- /CDN-Searcher/workflows.php: -------------------------------------------------------------------------------- 1 | path = exec('pwd'); 31 | $this->home = exec('printf $HOME'); 32 | 33 | if ( file_exists( 'info.plist' ) ): 34 | $this->bundle = $this->get( 'bundleid', 'info.plist' ); 35 | endif; 36 | 37 | if ( !is_null( $bundleid ) ): 38 | $this->bundle = $bundleid; 39 | endif; 40 | 41 | $this->cache = $this->home. "/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/".$this->bundle; 42 | $this->data = $this->home. "/Library/Application Support/Alfred 2/Workflow Data/".$this->bundle; 43 | 44 | if ( !file_exists( $this->cache ) ): 45 | exec("mkdir '".$this->cache."'"); 46 | endif; 47 | 48 | if ( !file_exists( $this->data ) ): 49 | exec("mkdir '".$this->data."'"); 50 | endif; 51 | 52 | $this->results = array(); 53 | } 54 | 55 | /** 56 | * Description: 57 | * Accepts no parameter and returns the value of the bundle id for the current workflow. 58 | * If no value is available, then false is returned. 59 | * 60 | * @param none 61 | * @return false if not available, bundle id value if available. 62 | */ 63 | public function bundle() 64 | { 65 | if ( is_null( $this->bundle ) ): 66 | return false; 67 | else: 68 | return $this->bundle; 69 | endif; 70 | } 71 | 72 | /** 73 | * Description: 74 | * Accepts no parameter and returns the value of the path to the cache directory for your 75 | * workflow if it is available. Returns false if the value isn't available. 76 | * 77 | * @param none 78 | * @return false if not available, path to the cache directory for your workflow if available. 79 | */ 80 | public function cache() 81 | { 82 | if ( is_null( $this->bundle ) ): 83 | return false; 84 | else: 85 | if ( is_null( $this->cache ) ): 86 | return false; 87 | else: 88 | return $this->cache; 89 | endif; 90 | endif; 91 | } 92 | 93 | /** 94 | * Description: 95 | * Accepts no parameter and returns the value of the path to the storage directory for your 96 | * workflow if it is available. Returns false if the value isn't available. 97 | * 98 | * @param none 99 | * @return false if not available, path to the storage directory for your workflow if available. 100 | */ 101 | public function data() 102 | { 103 | if ( is_null( $this->bundle ) ): 104 | return false; 105 | else: 106 | if ( is_null( $this->data ) ): 107 | return false; 108 | else: 109 | return $this->data; 110 | endif; 111 | endif; 112 | } 113 | 114 | /** 115 | * Description: 116 | * Accepts no parameter and returns the value of the path to the current directory for your 117 | * workflow if it is available. Returns false if the value isn't available. 118 | * 119 | * @param none 120 | * @return false if not available, path to the current directory for your workflow if available. 121 | */ 122 | public function path() 123 | { 124 | if ( is_null( $this->path ) ): 125 | return false; 126 | else: 127 | return $this->path; 128 | endif; 129 | } 130 | 131 | /** 132 | * Description: 133 | * Accepts no parameter and returns the value of the home path for the current user 134 | * Returns false if the value isn't available. 135 | * 136 | * @param none 137 | * @return false if not available, home path for the current user if available. 138 | */ 139 | public function home() 140 | { 141 | if ( is_null( $this->home ) ): 142 | return false; 143 | else: 144 | return $this->home; 145 | endif; 146 | } 147 | 148 | /** 149 | * Description: 150 | * Returns an array of available result items 151 | * 152 | * @param none 153 | * @return array - list of result items 154 | */ 155 | public function results() 156 | { 157 | return $this->results; 158 | } 159 | 160 | /** 161 | * Description: 162 | * Convert an associative array into XML format 163 | * 164 | * @param $a - An associative array to convert 165 | * @param $format - format of data being passed (json or array), defaults to array 166 | * @return - XML string representation of the array 167 | */ 168 | public function toxml( $a=null, $format='array' ) { 169 | 170 | if ( $format == 'json' ): 171 | $a = json_decode( $a, TRUE ); 172 | endif; 173 | 174 | if ( is_null( $a ) && !empty( $this->results ) ): 175 | $a = $this->results; 176 | elseif ( is_null( $a ) && empty( $this->results ) ): 177 | return false; 178 | endif; 179 | 180 | $items = new SimpleXMLElement(""); // Create new XML element 181 | 182 | foreach( $a as $b ): // Lop through each object in the array 183 | $c = $items->addChild( 'item' ); // Add a new 'item' element for each object 184 | $c_keys = array_keys( $b ); // Grab all the keys for that item 185 | foreach( $c_keys as $key ): // For each of those keys 186 | if ( $key == 'uid' ): 187 | $c->addAttribute( 'uid', $b[$key] ); 188 | elseif ( $key == 'arg' ): 189 | $c->addAttribute( 'arg', $b[$key] ); 190 | elseif ( $key == 'type' ): 191 | $c->addAttribute( 'type', $b[$key] ); 192 | elseif ( $key == 'valid' ): 193 | if ( $b[$key] == 'yes' || $b[$key] == 'no' ): 194 | $c->addAttribute( 'valid', $b[$key] ); 195 | endif; 196 | elseif ( $key == 'autocomplete' ): 197 | $c->addAttribute( 'autocomplete', $b[$key] ); 198 | elseif ( $key == 'icon' ): 199 | if ( substr( $b[$key], 0, 9 ) == 'fileicon:' ): 200 | $val = substr( $b[$key], 9 ); 201 | $c->$key = $val; 202 | $c->$key->addAttribute( 'type', 'fileicon' ); 203 | elseif ( substr( $b[$key], 0, 9 ) == 'filetype:' ): 204 | $val = substr( $b[$key], 9 ); 205 | $c->$key = $val; 206 | $c->$key->addAttribute( 'type', 'filetype' ); 207 | else: 208 | $c->$key = $b[$key]; 209 | endif; 210 | else: 211 | $c->$key = $b[$key]; 212 | endif; 213 | endforeach; 214 | endforeach; 215 | 216 | return $items->asXML(); // Return XML string representation of the array 217 | 218 | } 219 | 220 | /** 221 | * Description: 222 | * Remove all items from an associative array that do not have a value 223 | * 224 | * @param $a - Associative array 225 | * @return bool 226 | */ 227 | private function empty_filter( $a ) { 228 | if ( $a == '' || $a == null ): // if $a is empty or null 229 | return false; // return false, else, return true 230 | else: 231 | return true; 232 | endif; 233 | } 234 | 235 | /** 236 | * Description: 237 | * Save values to a specified plist. If the first parameter is an associative 238 | * array, then the second parameter becomes the plist file to save to. If the 239 | * first parameter is string, then it is assumed that the first parameter is 240 | * the label, the second parameter is the value, and the third parameter is 241 | * the plist file to save the data to. 242 | * 243 | * @param $a - associative array of values to save 244 | * @param $b - the value of the setting 245 | * @param $c - the plist to save the values into 246 | * @return string - execution output 247 | */ 248 | public function set( $a=null, $b=null, $c=null ) 249 | { 250 | if ( is_array( $a ) ): 251 | if ( file_exists( $b ) ): 252 | $b = $this->path."/".$b; 253 | elseif ( file_exists( $this->data."/".$b ) ): 254 | $b = $this->data."/".$b; 255 | elseif ( file_exists( $this->cache."/".$b ) ): 256 | $b = $this->cache."/".$b; 257 | else: 258 | $b = $this->data."/".$b; 259 | endif; 260 | else: 261 | if ( file_exists( $c ) ): 262 | $c = $this->path."/".$c; 263 | elseif ( file_exists( $this->data."/".$c ) ): 264 | $c = $this->data."/".$c; 265 | elseif ( file_exists( $this->cache."/".$c ) ): 266 | $c = $this->cache."/".$c; 267 | else: 268 | $c = $this->data."/".$c; 269 | endif; 270 | endif; 271 | 272 | if ( is_array( $a ) ): 273 | foreach( $a as $k => $v ): 274 | exec( 'defaults write "'. $b .'" '. $k .' "'. $v .'"'); 275 | endforeach; 276 | else: 277 | exec( 'defaults write "'. $c .'" '. $a .' "'. $b .'"'); 278 | endif; 279 | } 280 | 281 | /** 282 | * Description: 283 | * Read a value from the specified plist 284 | * 285 | * @param $a - the value to read 286 | * @param $b - plist to read the values from 287 | * @return bool false if not found, string if found 288 | */ 289 | public function get( $a, $b ) { 290 | 291 | if ( file_exists( $b ) ): 292 | $b = $this->path."/".$b; 293 | elseif ( file_exists( $this->data."/".$b ) ): 294 | $b = $this->data."/".$b; 295 | elseif ( file_exists( $this->cache."/".$b ) ): 296 | $b = $this->cache."/".$b; 297 | else: 298 | return false; 299 | endif; 300 | 301 | exec( 'defaults read "'. $b .'" '.$a, $out ); // Execute system call to read plist value 302 | 303 | if ( $out == "" ): 304 | return false; 305 | endif; 306 | 307 | $out = $out[0]; 308 | return $out; // Return item value 309 | } 310 | 311 | /** 312 | * Description: 313 | * Read data from a remote file/url, essentially a shortcut for curl 314 | * 315 | * @param $url - URL to request 316 | * @param $options - Array of curl options 317 | * @return result from curl_exec 318 | */ 319 | public function request( $url=null, $options=null ) 320 | { 321 | if ( is_null( $url ) ): 322 | return false; 323 | endif; 324 | 325 | $defaults = array( // Create a list of default curl options 326 | CURLOPT_RETURNTRANSFER => true, // Returns the result as a string 327 | CURLOPT_URL => $url, // Sets the url to request 328 | CURLOPT_FRESH_CONNECT => true 329 | ); 330 | 331 | if ( $options ): 332 | foreach( $options as $k => $v ): 333 | $defaults[$k] = $v; 334 | endforeach; 335 | endif; 336 | 337 | array_filter( $defaults, // Filter out empty options from the array 338 | array( $this, 'empty_filter' ) ); 339 | 340 | $ch = curl_init(); // Init new curl object 341 | curl_setopt_array( $ch, $defaults ); // Set curl options 342 | $out = curl_exec( $ch ); // Request remote data 343 | $err = curl_error( $ch ); 344 | curl_close( $ch ); // End curl request 345 | 346 | if ( $err ): 347 | return $err; 348 | else: 349 | return $out; 350 | endif; 351 | } 352 | 353 | /** 354 | * Description: 355 | * Allows searching the local hard drive using mdfind 356 | * 357 | * @param $query - search string 358 | * @return array - array of search results 359 | */ 360 | public function mdfind( $query ) 361 | { 362 | exec('mdfind "'.$query.'"', $results); 363 | return $results; 364 | } 365 | 366 | /** 367 | * Description: 368 | * Accepts data and a string file name to store data to local file as cache 369 | * 370 | * @param array - data to save to file 371 | * @param file - filename to write the cache data to 372 | * @return none 373 | */ 374 | public function write( $a, $b ) 375 | { 376 | if ( file_exists( $b ) ): 377 | $b = $this->path."/".$b; 378 | elseif ( file_exists( $this->data."/".$b ) ): 379 | $b = $this->data."/".$b; 380 | elseif ( file_exists( $this->cache."/".$b ) ): 381 | $b = $this->cache."/".$b; 382 | else: 383 | $b = $this->data."/".$b; 384 | endif; 385 | 386 | if ( is_array( $a ) ): 387 | $a = json_encode( $a ); 388 | file_put_contents( $b, $a ); 389 | return true; 390 | elseif ( is_string( $a ) ): 391 | file_put_contents( $b, $a ); 392 | return true; 393 | else: 394 | return false; 395 | endif; 396 | } 397 | 398 | /** 399 | * Description: 400 | * Returns data from a local cache file 401 | * 402 | * @param file - filename to read the cache data from 403 | * @return false if the file cannot be found, the file data if found. If the file 404 | * format is json encoded, then a json object is returned. 405 | */ 406 | public function read( $a ) 407 | { 408 | if ( file_exists( $a ) ): 409 | $a = $this->path."/".$a; 410 | elseif ( file_exists( $this->data."/".$a ) ): 411 | $a = $this->data."/".$a; 412 | elseif ( file_exists( $this->cache."/".$a ) ): 413 | $a = $this->cache."/".$a; 414 | else: 415 | return false; 416 | endif; 417 | 418 | $out = file_get_contents( $a ); 419 | if ( !is_null( json_decode( $out ) ) ): 420 | $out = json_decode( $out ); 421 | endif; 422 | 423 | return $out; 424 | } 425 | 426 | /** 427 | * Description: 428 | * Helper function that just makes it easier to pass values into a function 429 | * and create an array result to be passed back to Alfred 430 | * 431 | * @param $uid - the uid of the result, should be unique 432 | * @param $arg - the argument that will be passed on 433 | * @param $title - The title of the result item 434 | * @param $sub - The subtitle text for the result item 435 | * @param $icon - the icon to use for the result item 436 | * @param $valid - sets whether the result item can be actioned 437 | * @param $auto - the autocomplete value for the result item 438 | * @return array - array item to be passed back to Alfred 439 | */ 440 | public function result( $uid, $arg, $title, $sub, $icon, $valid='yes', $auto=null, $type=null ) 441 | { 442 | $temp = array( 443 | 'uid' => $uid, 444 | 'arg' => $arg, 445 | 'title' => $title, 446 | 'subtitle' => $sub, 447 | 'icon' => $icon, 448 | 'valid' => $valid, 449 | 'autocomplete' => $auto, 450 | 'type' => $type 451 | ); 452 | 453 | if ( is_null( $type ) ): 454 | unset( $temp['type'] ); 455 | endif; 456 | 457 | array_push( $this->results, $temp ); 458 | 459 | return $temp; 460 | } 461 | 462 | } -------------------------------------------------------------------------------- /Copy-Path/5D2EEEE3-220B-41FF-934E-FB25C7ED8A1B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Copy-Path/5D2EEEE3-220B-41FF-934E-FB25C7ED8A1B.png -------------------------------------------------------------------------------- /Copy-Path/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Copy-Path/icon.png -------------------------------------------------------------------------------- /Copy-Path/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.copy-path.hzlzh 7 | connections 8 | 9 | 0087609E-6564-4C39-A1BC-BC72E3EA0589 10 | 11 | 12 | destinationuid 13 | 08407005-847B-487E-883A-A25B62CAC23E 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | destinationuid 21 | DB7D6EAB-2AEE-4BAF-B97E-E0E613BDB994 22 | modifiers 23 | 0 24 | modifiersubtext 25 | 26 | 27 | 28 | 591D08A4-2B08-4DEB-B779-FA98A5EEEBB3 29 | 30 | 31 | destinationuid 32 | 0087609E-6564-4C39-A1BC-BC72E3EA0589 33 | modifiers 34 | 0 35 | modifiersubtext 36 | 37 | 38 | 39 | 40 | createdby 41 | hzlzh 42 | description 43 | Copy files' path in Finder to Clipboard. 44 | disabled 45 | 46 | name 47 | Copy Path 48 | objects 49 | 50 | 51 | config 52 | 53 | applescript 54 | on alfred_script(q) 55 | tell application "Finder" 56 | set theItems to selection 57 | set filePath to (POSIX path of (the selection as alias)) 58 | end tell 59 | set q to filePath 60 | return q 61 | end alfred_script 62 | cachescript 63 | 64 | 65 | type 66 | alfred.workflow.action.applescript 67 | uid 68 | 0087609E-6564-4C39-A1BC-BC72E3EA0589 69 | version 70 | 0 71 | 72 | 73 | config 74 | 75 | lastpathcomponent 76 | 77 | onlyshowifquerypopulated 78 | 79 | output 80 | 1 81 | removeextension 82 | 83 | sticky 84 | 85 | text 86 | {query} 87 | title 88 | Path Copied! 89 | 90 | type 91 | alfred.workflow.output.notification 92 | uid 93 | 08407005-847B-487E-883A-A25B62CAC23E 94 | version 95 | 0 96 | 97 | 98 | config 99 | 100 | action 101 | 0 102 | argument 103 | 0 104 | hotkey 105 | 35 106 | hotmod 107 | 1179648 108 | hotstring 109 | P 110 | leftcursor 111 | 112 | modsmode 113 | 0 114 | 115 | type 116 | alfred.workflow.trigger.hotkey 117 | uid 118 | 591D08A4-2B08-4DEB-B779-FA98A5EEEBB3 119 | version 120 | 0 121 | 122 | 123 | config 124 | 125 | autopaste 126 | 127 | clipboardtext 128 | {query} 129 | 130 | type 131 | alfred.workflow.output.clipboard 132 | uid 133 | DB7D6EAB-2AEE-4BAF-B97E-E0E613BDB994 134 | version 135 | 0 136 | 137 | 138 | readme 139 | # Shorten URL v1.0 140 | 141 | Copy files' path in Finder to Clipboard. 142 | 143 | # Project Source 144 | 145 | * Github: https://github.com/hzlzh/Alfred-Workflows 146 | * Blog Post: http://hzlzh.io/Alfred-Workflows/ 147 | 148 | # Contact 149 | 150 | * Zed Huang (hzlzh.dev@gmail.com) 151 | * Twitter: https://twitter.com/hzlzh 152 | 153 | (If you need more services to be added, please let me know.) 154 | uidata 155 | 156 | 0087609E-6564-4C39-A1BC-BC72E3EA0589 157 | 158 | ypos 159 | 10 160 | 161 | 08407005-847B-487E-883A-A25B62CAC23E 162 | 163 | ypos 164 | 10 165 | 166 | 591D08A4-2B08-4DEB-B779-FA98A5EEEBB3 167 | 168 | ypos 169 | 10 170 | 171 | DB7D6EAB-2AEE-4BAF-B97E-E0E613BDB994 172 | 173 | ypos 174 | 130 175 | 176 | 177 | webaddress 178 | http://hzlzh.io/ 179 | 180 | 181 | -------------------------------------------------------------------------------- /Downloads/CDN-Searcher.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/CDN-Searcher.alfredworkflow -------------------------------------------------------------------------------- /Downloads/Copy-Path.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/Copy-Path.alfredworkflow -------------------------------------------------------------------------------- /Downloads/GeekPark.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/GeekPark.alfredworkflow -------------------------------------------------------------------------------- /Downloads/SEO-Checker.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/SEO-Checker.alfredworkflow -------------------------------------------------------------------------------- /Downloads/Shorten-URL.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/Shorten-URL.alfredworkflow -------------------------------------------------------------------------------- /Downloads/Sublime-Like.alfredappearance: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | background 6 | 7 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 8 | ZmZmg6WkJD6DpaQkPoOlpCQ+gzMzcz+G 9 | 10 | border 11 | 12 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm 13 | ZmZmAQEBg65H4T2G 14 | 15 | cornerRoundness 16 | 3 17 | credits 18 | hzlzh 19 | imageStyle 20 | 9 21 | name 22 | Sublime Like 23 | resultPaddingSize 24 | 4 25 | resultSelectedBackgroundColor 26 | 27 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 28 | ZmZmg8LAwD2DwsDAPYPCwMA9gzMzcz+G 29 | 30 | resultSelectedSubtextColor 31 | 32 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 33 | ZmZmg9TSUj+D1NJSP4PU0lI/AYY= 34 | 35 | resultSelectedTextColor 36 | 37 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 38 | ZmZmAQEBgzMzcz+G 39 | 40 | resultSubtextColor 41 | 42 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm 43 | ZmZmg2zQBD+DeRIEP4NejgU/gzMzcz+G 44 | 45 | resultSubtextFont 46 | Courier 47 | resultSubtextFontSize 48 | 2 49 | resultTextColor 50 | 51 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 52 | ZmZmg9TSUj+D1NJSP4PU0lI/gzMzcz+G 53 | 54 | resultTextFont 55 | Lucida Grande 56 | resultTextFontSize 57 | 1 58 | scrollbarColor 59 | 60 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 61 | ZmZmg8LAwD2DwsDAPYPCwMA9gzMzcz+G 62 | 63 | searchBackgroundColor 64 | 65 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMDhAJm 66 | ZoOH+GM+AYY= 67 | 68 | searchFont 69 | Geneva 70 | searchFontSize 71 | 1 72 | searchForegroundColor 73 | 74 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 75 | ZmZmg/b0dD+D+vh4P4P6+Hg/gzMzcz+G 76 | 77 | searchPaddingSize 78 | 0 79 | separatorColor 80 | 81 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 82 | ZmZmg4WEBD6DhYQEPoOFhAQ+AYY= 83 | 84 | shortcutColor 85 | 86 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMChARm 87 | ZmZmg9jW1j6D4N7ePoPa2Ng+gzMzcz+G 88 | 89 | shortcutFont 90 | Courier 91 | shortcutFontSize 92 | 2 93 | shortcutSelectedColor 94 | 95 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm 96 | ZmZmg8N1CT+DpyARP4MYPwg/gzMzcz+G 97 | 98 | uid 99 | alfred.theme.custom.475ABA65-9AFE-4AAF-AE8D-D2818C38DAD5 100 | widthSize 101 | 3 102 | 103 | 104 | -------------------------------------------------------------------------------- /Downloads/V2EX.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/V2EX.alfredworkflow -------------------------------------------------------------------------------- /Downloads/Workflow-Searcher.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/Workflow-Searcher.alfredworkflow -------------------------------------------------------------------------------- /Downloads/XAMPP-Control.alfredextension: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/XAMPP-Control.alfredextension -------------------------------------------------------------------------------- /Downloads/extra/CDN-Searcher-latest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/CDN-Searcher-latest.png -------------------------------------------------------------------------------- /Downloads/extra/CDN-Searcher-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/CDN-Searcher-logo.png -------------------------------------------------------------------------------- /Downloads/extra/Copy-Path-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Copy-Path-demo.png -------------------------------------------------------------------------------- /Downloads/extra/Copy-Path-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Copy-Path-logo.png -------------------------------------------------------------------------------- /Downloads/extra/GeekPark-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/GeekPark-logo.png -------------------------------------------------------------------------------- /Downloads/extra/GeekPark-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/GeekPark-screenshot.png -------------------------------------------------------------------------------- /Downloads/extra/SEO-Checker-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/SEO-Checker-input.png -------------------------------------------------------------------------------- /Downloads/extra/SEO-Checker-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/SEO-Checker-logo.png -------------------------------------------------------------------------------- /Downloads/extra/SEO-Checker-notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/SEO-Checker-notification.png -------------------------------------------------------------------------------- /Downloads/extra/Shorten URL(with su.pr).alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Shorten URL(with su.pr).alfredworkflow -------------------------------------------------------------------------------- /Downloads/extra/Shorten-URL-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Shorten-URL-icon.png -------------------------------------------------------------------------------- /Downloads/extra/Shorten-URL-notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Shorten-URL-notification.png -------------------------------------------------------------------------------- /Downloads/extra/Shorten-URL-trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Shorten-URL-trigger.png -------------------------------------------------------------------------------- /Downloads/extra/Shorten-URL-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Shorten-URL-workflow.png -------------------------------------------------------------------------------- /Downloads/extra/Sublime-Like-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Sublime-Like-1.png -------------------------------------------------------------------------------- /Downloads/extra/Sublime-like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Sublime-like.png -------------------------------------------------------------------------------- /Downloads/extra/V2EX-latest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/V2EX-latest.png -------------------------------------------------------------------------------- /Downloads/extra/V2EX-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/V2EX-logo.png -------------------------------------------------------------------------------- /Downloads/extra/V2EX-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/V2EX-user.png -------------------------------------------------------------------------------- /Downloads/extra/V2EX-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/V2EX-workflow.png -------------------------------------------------------------------------------- /Downloads/extra/Workflow-Searcher-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Workflow-Searcher-logo.png -------------------------------------------------------------------------------- /Downloads/extra/Workflow-Searcher-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/Workflow-Searcher-screenshot.png -------------------------------------------------------------------------------- /Downloads/extra/XAMPP-Control-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/XAMPP-Control-icon.png -------------------------------------------------------------------------------- /Downloads/extra/XAMPP-Control-trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Downloads/extra/XAMPP-Control-trigger.png -------------------------------------------------------------------------------- /GeekPark/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/GeekPark/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png -------------------------------------------------------------------------------- /GeekPark/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/GeekPark/default.png -------------------------------------------------------------------------------- /GeekPark/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/GeekPark/icon.png -------------------------------------------------------------------------------- /GeekPark/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.geekpark.hzlzh 7 | connections 8 | 9 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 10 | 11 | 12 | destinationuid 13 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 21 | 22 | 23 | destinationuid 24 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 25 | modifiers 26 | 1048576 27 | modifiersubtext 28 | ⌘ > 仅复制此文章链接到剪切板 29 | 30 | 31 | destinationuid 32 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 33 | modifiers 34 | 0 35 | modifiersubtext 36 | 37 | 38 | 39 | destinationuid 40 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 41 | modifiers 42 | 1048576 43 | modifiersubtext 44 | ⌘ > 仅复制此文章链接到剪切板 45 | 46 | 47 | destinationuid 48 | 03A62D0B-A768-4DCE-A3C8-3DCC8D672125 49 | modifiers 50 | 0 51 | modifiersubtext 52 | 53 | 54 | 55 | destinationuid 56 | 29B4395A-0D13-4C81-A252-26A55CA7E1B6 57 | modifiers 58 | 524288 59 | modifiersubtext 60 | 在搜索引擎检索本条 61 | 62 | 63 | 64 | createdby 65 | hzlzh 66 | description 67 | Workflow for GeekPark.net 68 | disabled 69 | 70 | name 71 | GeekPark 72 | objects 73 | 74 | 75 | config 76 | 77 | action 78 | 0 79 | argument 80 | 1 81 | hotkey 82 | 0 83 | hotmod 84 | 0 85 | leftcursor 86 | 87 | modsmode 88 | 0 89 | 90 | type 91 | alfred.workflow.trigger.hotkey 92 | uid 93 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 94 | 95 | 96 | config 97 | 98 | lastpathcomponent 99 | 100 | onlyshowifquerypopulated 101 | 102 | output 103 | 0 104 | removeextension 105 | 106 | sticky 107 | 108 | text 109 | {query} 110 | title 111 | {query} 112 | 113 | type 114 | alfred.workflow.output.notification 115 | uid 116 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 117 | 118 | 119 | config 120 | 121 | autopaste 122 | 123 | clipboardtext 124 | 125 | 126 | type 127 | alfred.workflow.output.clipboard 128 | uid 129 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 130 | 131 | 132 | config 133 | 134 | argumenttype 135 | 0 136 | escaping 137 | 63 138 | keyword 139 | gpk 140 | runningsubtext 141 | 正在处理中 … 142 | script 143 | /* 144 | # Project Source 145 | 146 | * Github: https://github.com/hzlzh/Alfred-Workflows 147 | * Blog Post: https://zlz.im/Alfred-Workflows/ 148 | 149 | # Contact 150 | 151 | * hzlzh (hzlzh.dev@gmail.com) 152 | * Twitter: https://twitter.com/hzlzh 153 | */ 154 | require_once('workflows.php'); 155 | 156 | function load_data($api) { 157 | 158 | $opts = array( 159 | 'http'=>array( 160 | 'method'=>"GET", 161 | 'timeout'=>10 162 | ) 163 | ); 164 | $context = stream_context_create($opts); 165 | $obj = false; 166 | 167 | $xml = @file_get_contents( $api,false, $context); 168 | $obj=json_decode($xml); 169 | 170 | return $obj; 171 | 172 | } 173 | 174 | 175 | $wf = new Workflows(); 176 | 177 | $orig = "{query}"; 178 | 179 | 180 | date_default_timezone_set('Asia/Shanghai'); 181 | if($orig == 'n' || $orig == 'new' ){ 182 | $obj = load_data('http://www.geekpark.net/api?api_key=d7d1fe3f36fdb557f56ef72922a556b0&api_sig=05b245b49a33fe3c849ee424d069fccc&method=read.seed&limit=15&offset=0&day=3'); 183 | $int = 1; 184 | if($obj != null): 185 | foreach( $obj->articles as $post ): 186 | $post_id = $post->guid; 187 | $post_author_name = $post->author->screen_name; 188 | $post_title = $post->title; 189 | $post_url = $post->url; 190 | $post_content = $post->abstract; 191 | $post_time = $post->publish_time; 192 | 193 | $wf->result( $post_id, $post_url, $post_title.' @'.$post_author_name.' ☀ '.date("H:i m/d", $post_time), $post_content, 'default.png' ); 194 | $int++; 195 | endforeach; 196 | endif; 197 | }else if ($orig == 'v' || $orig == 'video') { 198 | $obj = load_data('http://www.geekpark.net/api?api_key=d7d1fe3f36fdb557f56ef72922a556b0&api_sig=877b50598a81a1f86b36e00dba975ad8&method=cast.clip&limit=15&offset=0&day=3'); 199 | 200 | $int = 1; 201 | if($obj != null): 202 | foreach( $obj->articles as $post ): 203 | $post_id = $post->guid; 204 | 205 | $post_title = $post->title; 206 | $post_url = $post->url; 207 | $post_content = $post->highlight; 208 | $post_time = $post->publish_time; 209 | 210 | $wf->result( $post_id, $post_url, $post_title.' ☀ '.date("H:i m/d", $post_time), $post_content, 'default.png' ); 211 | $int++; 212 | endforeach; 213 | endif; 214 | } 215 | 216 | $results = $wf->results(); 217 | if ( count( $results ) == 0 ): 218 | $wf->result( 'geekpark_500', '请确保指令和网络链接正常', '没有响应,请再试一次。', '请确保指令和网络链接正常', 'icon.png' ); 219 | endif; 220 | 221 | echo $wf->toxml(); 222 | subtext 223 | 按住`Command`键,可以只复制URL到剪切板 224 | title 225 | 常用指令:n或new 获取最新极客阅读 | v 获得极客广播 226 | type 227 | 1 228 | withspace 229 | 230 | 231 | type 232 | alfred.workflow.input.scriptfilter 233 | uid 234 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 235 | 236 | 237 | config 238 | 239 | plusspaces 240 | 241 | url 242 | {query} 243 | utf8 244 | 245 | 246 | type 247 | alfred.workflow.action.openurl 248 | uid 249 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 250 | 251 | 252 | config 253 | 254 | lastpathcomponent 255 | 256 | onlyshowifquerypopulated 257 | 258 | output 259 | 0 260 | removeextension 261 | 262 | sticky 263 | 264 | text 265 | {query} 266 | title 267 | {query} 268 | 269 | type 270 | alfred.workflow.output.notification 271 | uid 272 | 03A62D0B-A768-4DCE-A3C8-3DCC8D672125 273 | 274 | 275 | config 276 | 277 | searcher 278 | 1635215215 279 | 280 | type 281 | alfred.workflow.action.systemwebsearch 282 | uid 283 | 29B4395A-0D13-4C81-A252-26A55CA7E1B6 284 | 285 | 286 | readme 287 | # GeekPark v1.1 288 | 289 | 一个给GeekPark 用户的Alfred 2 workflow. 290 | 功能: 291 | * 获取最新极客阅读,指令:n 或 new 292 | * 获取最新极客广播,指令:v 或 video 293 | * 列表状态下按住`Command`键,可以只复制URL到剪切板 294 | * 列表状态下按住`Opition`键,在搜索引擎中检索该文章 295 | * 更多功能添加中... 296 | 297 | # Project Source 298 | 299 | * Github: https://github.com/hzlzh/Alfred-Workflows 300 | * Blog Post: https://zlz.im/Alfred-Workflows/ 301 | 302 | # Contact 303 | 304 | * hzlzh (hzlzh.dev@gmail.com) 305 | * Twitter: https://twitter.com/hzlzh 306 | uidata 307 | 308 | 03A62D0B-A768-4DCE-A3C8-3DCC8D672125 309 | 310 | ypos 311 | 270 312 | 313 | 29B4395A-0D13-4C81-A252-26A55CA7E1B6 314 | 315 | ypos 316 | 280 317 | 318 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 319 | 320 | ypos 321 | 10 322 | 323 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 324 | 325 | ypos 326 | 140 327 | 328 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 329 | 330 | ypos 331 | 10 332 | 333 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 334 | 335 | ypos 336 | 140 337 | 338 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 339 | 340 | ypos 341 | 140 342 | 343 | 344 | webaddress 345 | https://zlz.im/ 346 | 347 | 348 | -------------------------------------------------------------------------------- /GeekPark/remote.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.1, 3 | "download_uri": "https://raw.github.com/hzlzh/Alfred-Workflows/master/Downloads/GeekPark.alfredworkflow", 4 | "description": "Author Name added." 5 | } 6 | -------------------------------------------------------------------------------- /GeekPark/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.1, 3 | "remote_json": "https://raw.github.com/hzlzh/Alfred-Workflows/master/GeekPark/remote.json" 4 | } 5 | -------------------------------------------------------------------------------- /GeekPark/workflows.php: -------------------------------------------------------------------------------- 1 | path = exec('pwd'); 31 | $this->home = exec('printf $HOME'); 32 | 33 | if ( file_exists( 'info.plist' ) ): 34 | $this->bundle = $this->get( 'bundleid', 'info.plist' ); 35 | endif; 36 | 37 | if ( !is_null( $bundleid ) ): 38 | $this->bundle = $bundleid; 39 | endif; 40 | 41 | $this->cache = $this->home. "/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/".$this->bundle; 42 | $this->data = $this->home. "/Library/Application Support/Alfred 2/Workflow Data/".$this->bundle; 43 | 44 | if ( !file_exists( $this->cache ) ): 45 | exec("mkdir '".$this->cache."'"); 46 | endif; 47 | 48 | if ( !file_exists( $this->data ) ): 49 | exec("mkdir '".$this->data."'"); 50 | endif; 51 | 52 | $this->results = array(); 53 | } 54 | 55 | /** 56 | * Description: 57 | * Accepts no parameter and returns the value of the bundle id for the current workflow. 58 | * If no value is available, then false is returned. 59 | * 60 | * @param none 61 | * @return false if not available, bundle id value if available. 62 | */ 63 | public function bundle() 64 | { 65 | if ( is_null( $this->bundle ) ): 66 | return false; 67 | else: 68 | return $this->bundle; 69 | endif; 70 | } 71 | 72 | /** 73 | * Description: 74 | * Accepts no parameter and returns the value of the path to the cache directory for your 75 | * workflow if it is available. Returns false if the value isn't available. 76 | * 77 | * @param none 78 | * @return false if not available, path to the cache directory for your workflow if available. 79 | */ 80 | public function cache() 81 | { 82 | if ( is_null( $this->bundle ) ): 83 | return false; 84 | else: 85 | if ( is_null( $this->cache ) ): 86 | return false; 87 | else: 88 | return $this->cache; 89 | endif; 90 | endif; 91 | } 92 | 93 | /** 94 | * Description: 95 | * Accepts no parameter and returns the value of the path to the storage directory for your 96 | * workflow if it is available. Returns false if the value isn't available. 97 | * 98 | * @param none 99 | * @return false if not available, path to the storage directory for your workflow if available. 100 | */ 101 | public function data() 102 | { 103 | if ( is_null( $this->bundle ) ): 104 | return false; 105 | else: 106 | if ( is_null( $this->data ) ): 107 | return false; 108 | else: 109 | return $this->data; 110 | endif; 111 | endif; 112 | } 113 | 114 | /** 115 | * Description: 116 | * Accepts no parameter and returns the value of the path to the current directory for your 117 | * workflow if it is available. Returns false if the value isn't available. 118 | * 119 | * @param none 120 | * @return false if not available, path to the current directory for your workflow if available. 121 | */ 122 | public function path() 123 | { 124 | if ( is_null( $this->path ) ): 125 | return false; 126 | else: 127 | return $this->path; 128 | endif; 129 | } 130 | 131 | /** 132 | * Description: 133 | * Accepts no parameter and returns the value of the home path for the current user 134 | * Returns false if the value isn't available. 135 | * 136 | * @param none 137 | * @return false if not available, home path for the current user if available. 138 | */ 139 | public function home() 140 | { 141 | if ( is_null( $this->home ) ): 142 | return false; 143 | else: 144 | return $this->home; 145 | endif; 146 | } 147 | 148 | /** 149 | * Description: 150 | * Returns an array of available result items 151 | * 152 | * @param none 153 | * @return array - list of result items 154 | */ 155 | public function results() 156 | { 157 | return $this->results; 158 | } 159 | 160 | /** 161 | * Description: 162 | * Convert an associative array into XML format 163 | * 164 | * @param $a - An associative array to convert 165 | * @param $format - format of data being passed (json or array), defaults to array 166 | * @return - XML string representation of the array 167 | */ 168 | public function toxml( $a=null, $format='array' ) { 169 | 170 | if ( $format == 'json' ): 171 | $a = json_decode( $a, TRUE ); 172 | endif; 173 | 174 | if ( is_null( $a ) && !empty( $this->results ) ): 175 | $a = $this->results; 176 | elseif ( is_null( $a ) && empty( $this->results ) ): 177 | return false; 178 | endif; 179 | 180 | $items = new SimpleXMLElement(""); // Create new XML element 181 | 182 | foreach( $a as $b ): // Lop through each object in the array 183 | $c = $items->addChild( 'item' ); // Add a new 'item' element for each object 184 | $c_keys = array_keys( $b ); // Grab all the keys for that item 185 | foreach( $c_keys as $key ): // For each of those keys 186 | if ( $key == 'uid' ): 187 | $c->addAttribute( 'uid', $b[$key] ); 188 | elseif ( $key == 'arg' ): 189 | $c->addAttribute( 'arg', $b[$key] ); 190 | elseif ( $key == 'type' ): 191 | $c->addAttribute( 'type', $b[$key] ); 192 | elseif ( $key == 'valid' ): 193 | if ( $b[$key] == 'yes' || $b[$key] == 'no' ): 194 | $c->addAttribute( 'valid', $b[$key] ); 195 | endif; 196 | elseif ( $key == 'autocomplete' ): 197 | $c->addAttribute( 'autocomplete', $b[$key] ); 198 | elseif ( $key == 'icon' ): 199 | if ( substr( $b[$key], 0, 9 ) == 'fileicon:' ): 200 | $val = substr( $b[$key], 9 ); 201 | $c->$key = $val; 202 | $c->$key->addAttribute( 'type', 'fileicon' ); 203 | elseif ( substr( $b[$key], 0, 9 ) == 'filetype:' ): 204 | $val = substr( $b[$key], 9 ); 205 | $c->$key = $val; 206 | $c->$key->addAttribute( 'type', 'filetype' ); 207 | else: 208 | $c->$key = $b[$key]; 209 | endif; 210 | else: 211 | $c->$key = $b[$key]; 212 | endif; 213 | endforeach; 214 | endforeach; 215 | 216 | return $items->asXML(); // Return XML string representation of the array 217 | 218 | } 219 | 220 | /** 221 | * Description: 222 | * Remove all items from an associative array that do not have a value 223 | * 224 | * @param $a - Associative array 225 | * @return bool 226 | */ 227 | private function empty_filter( $a ) { 228 | if ( $a == '' || $a == null ): // if $a is empty or null 229 | return false; // return false, else, return true 230 | else: 231 | return true; 232 | endif; 233 | } 234 | 235 | /** 236 | * Description: 237 | * Save values to a specified plist. If the first parameter is an associative 238 | * array, then the second parameter becomes the plist file to save to. If the 239 | * first parameter is string, then it is assumed that the first parameter is 240 | * the label, the second parameter is the value, and the third parameter is 241 | * the plist file to save the data to. 242 | * 243 | * @param $a - associative array of values to save 244 | * @param $b - the value of the setting 245 | * @param $c - the plist to save the values into 246 | * @return string - execution output 247 | */ 248 | public function set( $a=null, $b=null, $c=null ) 249 | { 250 | if ( is_array( $a ) ): 251 | if ( file_exists( $b ) ): 252 | $b = $this->path."/".$b; 253 | elseif ( file_exists( $this->data."/".$b ) ): 254 | $b = $this->data."/".$b; 255 | elseif ( file_exists( $this->cache."/".$b ) ): 256 | $b = $this->cache."/".$b; 257 | else: 258 | $b = $this->data."/".$b; 259 | endif; 260 | else: 261 | if ( file_exists( $c ) ): 262 | $c = $this->path."/".$c; 263 | elseif ( file_exists( $this->data."/".$c ) ): 264 | $c = $this->data."/".$c; 265 | elseif ( file_exists( $this->cache."/".$c ) ): 266 | $c = $this->cache."/".$c; 267 | else: 268 | $c = $this->data."/".$c; 269 | endif; 270 | endif; 271 | 272 | if ( is_array( $a ) ): 273 | foreach( $a as $k => $v ): 274 | exec( 'defaults write "'. $b .'" '. $k .' "'. $v .'"'); 275 | endforeach; 276 | else: 277 | exec( 'defaults write "'. $c .'" '. $a .' "'. $b .'"'); 278 | endif; 279 | } 280 | 281 | /** 282 | * Description: 283 | * Read a value from the specified plist 284 | * 285 | * @param $a - the value to read 286 | * @param $b - plist to read the values from 287 | * @return bool false if not found, string if found 288 | */ 289 | public function get( $a, $b ) { 290 | 291 | if ( file_exists( $b ) ): 292 | $b = $this->path."/".$b; 293 | elseif ( file_exists( $this->data."/".$b ) ): 294 | $b = $this->data."/".$b; 295 | elseif ( file_exists( $this->cache."/".$b ) ): 296 | $b = $this->cache."/".$b; 297 | else: 298 | return false; 299 | endif; 300 | 301 | exec( 'defaults read "'. $b .'" '.$a, $out ); // Execute system call to read plist value 302 | 303 | if ( $out == "" ): 304 | return false; 305 | endif; 306 | 307 | $out = $out[0]; 308 | return $out; // Return item value 309 | } 310 | 311 | /** 312 | * Description: 313 | * Read data from a remote file/url, essentially a shortcut for curl 314 | * 315 | * @param $url - URL to request 316 | * @param $options - Array of curl options 317 | * @return result from curl_exec 318 | */ 319 | public function request( $url=null, $options=null ) 320 | { 321 | if ( is_null( $url ) ): 322 | return false; 323 | endif; 324 | 325 | $defaults = array( // Create a list of default curl options 326 | CURLOPT_RETURNTRANSFER => true, // Returns the result as a string 327 | CURLOPT_URL => $url, // Sets the url to request 328 | CURLOPT_FRESH_CONNECT => true 329 | ); 330 | 331 | if ( $options ): 332 | foreach( $options as $k => $v ): 333 | $defaults[$k] = $v; 334 | endforeach; 335 | endif; 336 | 337 | array_filter( $defaults, // Filter out empty options from the array 338 | array( $this, 'empty_filter' ) ); 339 | 340 | $ch = curl_init(); // Init new curl object 341 | curl_setopt_array( $ch, $defaults ); // Set curl options 342 | $out = curl_exec( $ch ); // Request remote data 343 | $err = curl_error( $ch ); 344 | curl_close( $ch ); // End curl request 345 | 346 | if ( $err ): 347 | return $err; 348 | else: 349 | return $out; 350 | endif; 351 | } 352 | 353 | /** 354 | * Description: 355 | * Allows searching the local hard drive using mdfind 356 | * 357 | * @param $query - search string 358 | * @return array - array of search results 359 | */ 360 | public function mdfind( $query ) 361 | { 362 | exec('mdfind "'.$query.'"', $results); 363 | return $results; 364 | } 365 | 366 | /** 367 | * Description: 368 | * Accepts data and a string file name to store data to local file as cache 369 | * 370 | * @param array - data to save to file 371 | * @param file - filename to write the cache data to 372 | * @return none 373 | */ 374 | public function write( $a, $b ) 375 | { 376 | if ( file_exists( $b ) ): 377 | $b = $this->path."/".$b; 378 | elseif ( file_exists( $this->data."/".$b ) ): 379 | $b = $this->data."/".$b; 380 | elseif ( file_exists( $this->cache."/".$b ) ): 381 | $b = $this->cache."/".$b; 382 | else: 383 | $b = $this->data."/".$b; 384 | endif; 385 | 386 | if ( is_array( $a ) ): 387 | $a = json_encode( $a ); 388 | file_put_contents( $b, $a ); 389 | return true; 390 | elseif ( is_string( $a ) ): 391 | file_put_contents( $b, $a ); 392 | return true; 393 | else: 394 | return false; 395 | endif; 396 | } 397 | 398 | /** 399 | * Description: 400 | * Returns data from a local cache file 401 | * 402 | * @param file - filename to read the cache data from 403 | * @return false if the file cannot be found, the file data if found. If the file 404 | * format is json encoded, then a json object is returned. 405 | */ 406 | public function read( $a ) 407 | { 408 | if ( file_exists( $a ) ): 409 | $a = $this->path."/".$a; 410 | elseif ( file_exists( $this->data."/".$a ) ): 411 | $a = $this->data."/".$a; 412 | elseif ( file_exists( $this->cache."/".$a ) ): 413 | $a = $this->cache."/".$a; 414 | else: 415 | return false; 416 | endif; 417 | 418 | $out = file_get_contents( $a ); 419 | if ( !is_null( json_decode( $out ) ) ): 420 | $out = json_decode( $out ); 421 | endif; 422 | 423 | return $out; 424 | } 425 | 426 | /** 427 | * Description: 428 | * Helper function that just makes it easier to pass values into a function 429 | * and create an array result to be passed back to Alfred 430 | * 431 | * @param $uid - the uid of the result, should be unique 432 | * @param $arg - the argument that will be passed on 433 | * @param $title - The title of the result item 434 | * @param $sub - The subtitle text for the result item 435 | * @param $icon - the icon to use for the result item 436 | * @param $valid - sets whether the result item can be actioned 437 | * @param $auto - the autocomplete value for the result item 438 | * @return array - array item to be passed back to Alfred 439 | */ 440 | public function result( $uid, $arg, $title, $sub, $icon, $valid='yes', $auto=null, $type=null ) 441 | { 442 | $temp = array( 443 | 'uid' => $uid, 444 | 'arg' => $arg, 445 | 'title' => $title, 446 | 'subtitle' => $sub, 447 | 'icon' => $icon, 448 | 'valid' => $valid, 449 | 'autocomplete' => $auto, 450 | 'type' => $type 451 | ); 452 | 453 | if ( is_null( $type ) ): 454 | unset( $temp['type'] ); 455 | endif; 456 | 457 | array_push( $this->results, $temp ); 458 | 459 | return $temp; 460 | } 461 | 462 | } -------------------------------------------------------------------------------- /Quick-Open-Finder/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Quick-Open-Finder/icon.png -------------------------------------------------------------------------------- /Quick-Open-Finder/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.quick-open-finder.hzlzh 7 | connections 8 | 9 | D9932075-CB6F-45CA-9A84-831683E5B26C 10 | 11 | 12 | destinationuid 13 | AE0D1A31-87F9-4DB4-9F31-B2E51C48CC62 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | 21 | createdby 22 | hzlzh 23 | description 24 | Quick open finder.app with hotkey. 25 | disabled 26 | 27 | name 28 | Quick Open Finder 29 | objects 30 | 31 | 32 | config 33 | 34 | action 35 | 0 36 | argument 37 | 0 38 | hotkey 39 | 3 40 | hotmod 41 | 1572864 42 | hotstring 43 | F 44 | leftcursor 45 | 46 | modsmode 47 | 0 48 | 49 | type 50 | alfred.workflow.trigger.hotkey 51 | uid 52 | D9932075-CB6F-45CA-9A84-831683E5B26C 53 | version 54 | 0 55 | 56 | 57 | config 58 | 59 | paths 60 | 61 | /System/Library/CoreServices/Finder.app 62 | 63 | toggle 64 | 65 | 66 | type 67 | alfred.workflow.action.launchfiles 68 | uid 69 | AE0D1A31-87F9-4DB4-9F31-B2E51C48CC62 70 | version 71 | 0 72 | 73 | 74 | readme 75 | # Project Source 76 | 77 | * Github: https://github.com/hzlzh/Alfred-Workflows 78 | * Blog Post: https://zlz.im/Alfred-Workflows/ 79 | 80 | # Contact 81 | 82 | * Andy Huang (hzlzh.dev@gmail.com) 83 | * Twitter: https://twitter.com/hzlzh 84 | 85 | (If you need more services to be added, please let me know.) 86 | uidata 87 | 88 | AE0D1A31-87F9-4DB4-9F31-B2E51C48CC62 89 | 90 | ypos 91 | 40 92 | 93 | D9932075-CB6F-45CA-9A84-831683E5B26C 94 | 95 | ypos 96 | 40 97 | 98 | 99 | webaddress 100 | http://hzlzh.io 101 | 102 | 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Alfred Workflows/Extensions/Themes 2 | 3 | Make your Alfred more powerful. **([Alfred 2] powerpack required)** 4 | 5 | For more workflows, check [AlfredWorkflow.com] and [Workflow Searcher] 6 | 7 | * * * 8 | 9 | ## Sublime Like *(Alfred 2 Theme)* 10 | [\[Download Link\]][9] 11 | 12 | Make your Alfred look like [Sublime Text 2] `⌘ +Sift +P` 13 | 14 | ![Sublime Like][10] 15 | 16 | * * * 17 | 18 | ## Copy Path *(v1.0 Released 2014.05.05)* 19 | ![Copy-Path-logo] 20 | 21 | [\[Download Link\]][12] 22 | 23 | Copy files' path in Finder to Clipboard. 24 | 25 | #### Examples: 26 | 27 | ![Copy-Path-screenshot] 28 | 29 | * * * 30 | 31 | ## Workflow Searcher *(v1.2 Released 2013.04.25)* 32 | ![Workflow-Searcher-logo] 33 | 34 | [\[Download Link\]][11] 35 | 36 | Search workflows from [AlfredWorkflow.com API] List 37 | 38 | * Get the download & released link of the workflow you search. 39 | * API file Cache `6 minutes`(360s) 40 | 41 | #### Examples: 42 | 43 | ![Workflow-Searcher-screenshot] 44 | 45 | * * * 46 | 47 | ## Shorten URL *(v1.5)* 48 | ![4] 49 | 50 | [\[Download Link\]][8] 51 | 52 | This workflow support URL shortener like below. 53 | 54 | 55 | goo.gl/ 56 | bit.ly/ 57 | t.cn/ 58 | j.mp/ 59 | is.gd/ 60 | v.gd/ 61 | git.io/ 62 | 63 | You can use Hotkey to trigger without outpen Alfred input window. 64 | Also available in [PopClip Extension](https://github.com/hzlzh/PopClip-Extensions) 65 | 66 | #### Tips: 67 | 68 | * To use this workflow without copy/paste, just use Alfred trigger HotKey [\[#1\]](https://github.com/hzlzh/Alfred-Workflows/issues/1) 69 | * How to custom your own service sort? [\[#2\]](https://github.com/hzlzh/Alfred-Workflows/issues/2) 70 | 71 | 72 | ![Shorten-URL-trigger][5] 73 | ![Shorten-URL-notification][6] 74 | 75 | (If you need more services to be added, please let me know.) 76 | 77 | ### goo.gl setup 78 | 79 | For this to work you need to add your [Google API key](https://developers.google.com/url-shortener/v1/getting_started#APIKey) first by modifying the corresponding string of **short** Script Filter in Alfred Workflow. 80 | 81 | Default string: 82 | 83 | ``` python 84 | 0 : {'api_url':'https://www.googleapis.com/urlshortener/v1/url','title':'goo.gl','des':'http://goo.gl/'}, 85 | ``` 86 | 87 | You need to add a `?key=` value to `url`: 88 | 89 | ``` python 90 | 0 : {'api_url':'https://www.googleapis.com/urlshortener/v1/url?key=YOUR_API_KEY_HERE','title':'goo.gl','des':'http://goo.gl/'}, 91 | ``` 92 | 93 | * * * 94 | 95 | ## SEO Checker *(v1.0)* 96 | 97 | ![SEO-Checker-logo] 98 | 99 | [\[Download Link\]][SEO-Checker.alfredworkflow] 100 | 101 | Check domain's PR, Alexa, etc instantly in Alfred feedback. 102 | 103 | ![SEO-Checker-input] 104 | ![SEO-Checker-notification] 105 | 106 | (If you need more SEO services to be added, please let me know.) 107 | 108 | * * * 109 | 110 | ## GeekPark *(v1.1)* 111 | 112 | ![GeekPark-logo] 113 | 114 | [\[Download Link\]][GeekPark.alfredworkflow] 115 | 116 | 一个给GeekPark用户的Alfred 2 workflow. 117 | 目前功能有: 118 | 119 | * 获取最新极客阅读,指令:n 或 new 120 | * 获取最新极客广播,指令:v 或 video 121 | * 列表状态下按住`Command`键,可以只复制URL到剪切板 122 | * 列表状态下按住`Opition`键,在搜索引擎中检索该文章 123 | * 更多功能添加中... 124 | 125 | ![GeekPark-latest] 126 | 127 | * * * 128 | 129 | ## V2EX *(v1.0)* 130 | 131 | ![V2EX-logo] 132 | 133 | [\[Download Link\]][V2EX.alfredworkflow] 134 | 135 | 一个给V2EXer用的Alfred 2 workflow. 136 | 目前功能有: 137 | 138 | * 获取最新文章列表,指令:n 或 new 139 | * 获取指定用户的文章列表,指令:@hzlzh 140 | * 列表状态下按住`Command`键,可以只复制URL到剪切板 141 | * 列表状态下按住`Opition`键,在搜索引擎中检索该文章 142 | * 更多功能添加中... 143 | 144 | ![V2EX-latest] 145 | 146 | * * * 147 | 148 | ## CDN Searcher *(v1.0)* 149 | 150 | ![CDN-Searcher-logo] 151 | 152 | [\[Download Link\]][CDN-Searcher.alfredworkflow] 153 | 154 | * 快速获得 JS/CSS/Image 等项目的 CDN 的链接,如:jQuery、Bootstrap等 155 | * 这是第一版,下一版会支持版本选择等功能 156 | * API文件会在本地缓存,时间为24小时 157 | * CDN服务使用:[http://staticfile.org/](http://staticfile.org/) 158 | 159 | ![CDN-Searcher-latest] 160 | 161 | * * * 162 | 163 | ## Quick Open Finder *(v1.0)* 164 | 165 | [\[Download Link\]][Quick-Open-Finder.alfredworkflow] 166 | 167 | * Quick open `Finder.app` wirh hotkey. 168 | 169 | * * * 170 | 171 | ## XAMPP Control *(v1.1)* 172 | ![XAMPP Control Logo] 173 | 174 | [\[Download Link\]][XAMPP-Control.alfredextension] 175 | 176 | Start/Stop Apache & MySQL & FTP of XAMPP in Alfred with PowerPack. From now on you will be no longer launch XAMPP in your Dock continually. 177 | 178 | ![XAMPP-Control-trigger] 179 | 180 | *Note:* # Note: You may need to input your admin **ROOT** password just once when using this extension. To reset your **ROOT** password just run `xampp root` 181 | 182 | run `xampp {query}` from the command chart below. 183 | 184 | start Start XAMPP (Apache, MySQL and eventually others) 185 | startapache Start only Apache 186 | startmysql Start only MySQL 187 | startftp Start only ProFTPD 188 | 189 | stop Stop XAMPP (Apache, MySQL and eventually others) 190 | stopapache Stop only Apache 191 | stopmysql Stop only MySQL 192 | stopftp Stop only ProFTPD 193 | 194 | reload Reload XAMPP (Apache, MySQL and eventually others) 195 | reloadapache Reload only Apache 196 | reloadmysql Reload only MySQL 197 | reloadftp Reload only ProFTPD 198 | 199 | restart Stop and start XAMPP 200 | security Check XAMPP's security 201 | 202 | enablessl Enable SSL support for Apache 203 | disablessl Disable SSL support for Apache 204 | 205 | backup Make backup file of your XAMPP config, log and data files 206 | 207 | fix_rights Resets file permissions. 208 | 209 | 210 | * * * 211 | 212 | Release Note 213 | 214 | `v1.1` 215 | 216 | * Authenticate.app supported & root password auto-saved 217 | * Extension Updater supported 218 | 219 | ## License 220 | 221 | Released under [MIT](http://rem.mit-license.org/) LICENSE. 222 | 223 | Post: [http://hzlzh.io/tag/alfred](http://hzlzh.io/tag/alfred) 224 | Github: [hzlzh/Alfred-Workflows/](https://github.com/hzlzh/Alfred-Workflows/) 225 | 226 | 227 | [XAMPP Control Logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/XAMPP-Control-icon.png "XAMPP Control for Alfred Logo" 228 | [XAMPP-Control.alfredextension]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/XAMPP-Control.alfredextension "XAMPP Control Download Link" 229 | [XAMPP-Control-trigger]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/XAMPP-Control-trigger.png "XAMPP Control for Alfred Screenshot" 230 | [4]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Shorten-URL-icon.png 231 | [5]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Shorten-URL-trigger.png 232 | [6]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Shorten-URL-notification.png 233 | [7]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Shorten-URL-workflow.png 234 | [8]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/Shorten-URL.alfredworkflow "Download Shorten-URL.alfredworkflow" 235 | [9]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/Sublime-Like.alfredappearance 236 | [10]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Sublime-like.png 237 | [11]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/Workflow-Searcher.alfredworkflow "Download Workflow-Searcher.alfredworkflow" 238 | [12]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/Copy-Path.alfredworkflow "Download Copy-Path.alfredworkflow" 239 | 240 | [Workflow-Searcher-logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Workflow-Searcher-logo.png 241 | [Workflow-Searcher-screenshot]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Workflow-Searcher-screenshot.png 242 | 243 | [SEO-Checker-logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/SEO-Checker-logo.png 244 | [SEO-Checker.alfredworkflow]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/SEO-Checker.alfredworkflow 245 | [SEO-Checker-input]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/SEO-Checker-input.png 246 | [SEO-Checker-notification]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/SEO-Checker-notification.png 247 | [V2EX-logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/V2EX-logo.png 248 | [V2EX-latest]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/V2EX-latest.png 249 | [V2EX.alfredworkflow]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/V2EX.alfredworkflow 250 | [GeekPark-logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/GeekPark-logo.png 251 | [Copy-Path-logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Copy-Path-logo.png 252 | [GeekPark.alfredworkflow]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/GeekPark.alfredworkflow 253 | [GeekPark-latest]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/GeekPark-screenshot.png 254 | [CDN-Searcher-logo]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/CDN-Searcher-logo.png 255 | [CDN-Searcher.alfredworkflow]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/CDN-Searcher.alfredworkflow 256 | [CDN-Searcher-latest]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/CDN-Searcher-latest.png 257 | [Copy-Path-screenshot]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/extra/Copy-Path-demo.png 258 | 259 | 260 | [Quick-Open-Finder.alfredworkflow]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/Quick-Open-Finder.alfredworkflow 261 | 262 | 263 | 264 | 265 | 266 | [AlfredWorkflow.com API]: https://github.com/hzlzh/AlfredWorkflow.com#workflows-json-api-updated-2013425 267 | [AlfredWorkflow.com]: http://www.alfredworkflow.com/ 'Alfred Workflow List' 268 | [Workflow Searcher]: https://github.com/hzlzh/Alfred-Workflows/raw/master/Downloads/Workflow-Searcher.alfredworkflow 269 | 270 | [Alfred 2]: http://www.alfredapp.com/ 271 | -------------------------------------------------------------------------------- /SEO-Checker/E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/SEO-Checker/E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E.png -------------------------------------------------------------------------------- /SEO-Checker/favicons/alexa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/SEO-Checker/favicons/alexa.png -------------------------------------------------------------------------------- /SEO-Checker/favicons/pr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/SEO-Checker/favicons/pr.png -------------------------------------------------------------------------------- /SEO-Checker/feedback.py: -------------------------------------------------------------------------------- 1 | #author: Peter Okma 2 | import xml.etree.ElementTree as et 3 | 4 | 5 | class Feedback(): 6 | """Feeback used by Alfred Script Filter 7 | 8 | Usage: 9 | fb = Feedback() 10 | fb.add_item('Hello', 'World') 11 | fb.add_item('Foo', 'Bar') 12 | print fb 13 | 14 | """ 15 | 16 | def __init__(self): 17 | self.feedback = et.Element('items') 18 | 19 | def __repr__(self): 20 | """XML representation used by Alfred 21 | 22 | Returns: 23 | XML string 24 | """ 25 | return et.tostring(self.feedback) 26 | 27 | def add_item(self, title, subtitle="", arg="", valid="yes", autocomplete="", icon="icon.png"): 28 | """ 29 | Add item to alfred Feedback 30 | 31 | Args: 32 | title(str): the title displayed by Alfred 33 | Keyword Args: 34 | subtitle(str): the subtitle displayed by Alfred 35 | arg(str): the value returned by alfred when item is selected 36 | valid(str): whether or not the entry can be selected in Alfred to trigger an action 37 | autcomplete(str): the text to be inserted if an invalid item is selected. This is only used if 'valid' is 'no' 38 | icon(str): filename of icon that Alfred will display 39 | """ 40 | item = et.SubElement(self.feedback, 'item', uid=str(len(self.feedback)), 41 | arg=arg, valid=valid, autocomplete=autocomplete) 42 | _title = et.SubElement(item, 'title') 43 | _title.text = title 44 | _sub = et.SubElement(item, 'subtitle') 45 | _sub.text = subtitle 46 | _icon = et.SubElement(item, 'icon') 47 | _icon.text = icon 48 | -------------------------------------------------------------------------------- /SEO-Checker/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/SEO-Checker/icon.png -------------------------------------------------------------------------------- /SEO-Checker/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.seo-checker.hzlzh 7 | connections 8 | 9 | 5AF9DBA5-62D9-44A4-B634-119DFCF6EE12 10 | 11 | 12 | destinationuid 13 | E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | 6A5855DC-E66B-40CD-B6C0-0CAF18F63BE9 21 | 22 | 23 | destinationuid 24 | 1405700F-1171-44FB-A236-34DF8CF9E101 25 | modifiers 26 | 0 27 | modifiersubtext 28 | 29 | 30 | 31 | E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E 32 | 33 | 34 | destinationuid 35 | 6A5855DC-E66B-40CD-B6C0-0CAF18F63BE9 36 | modifiers 37 | 0 38 | modifiersubtext 39 | 40 | 41 | 42 | 43 | createdby 44 | hzlzh 45 | description 46 | Check domain's PR, Alexa, etc 47 | disabled 48 | 49 | name 50 | SEO Checker 51 | objects 52 | 53 | 54 | config 55 | 56 | plusspaces 57 | 58 | url 59 | {query} 60 | utf8 61 | 62 | 63 | type 64 | alfred.workflow.action.openurl 65 | uid 66 | 6A5855DC-E66B-40CD-B6C0-0CAF18F63BE9 67 | 68 | 69 | config 70 | 71 | lastpathcomponent 72 | 73 | onlyshowifquerypopulated 74 | 75 | output 76 | 0 77 | removeextension 78 | 79 | sticky 80 | 81 | text 82 | {query} 83 | title 84 | Check it on website. 85 | 86 | type 87 | alfred.workflow.output.notification 88 | uid 89 | 1405700F-1171-44FB-A236-34DF8CF9E101 90 | 91 | 92 | config 93 | 94 | argumenttype 95 | 0 96 | escaping 97 | 63 98 | keyword 99 | seo 100 | runningsubtext 101 | Checking … please wait 102 | script 103 | ''' 104 | SEO Checker v1.0 105 | 106 | Github: https://github.com/hzlzh/Alfred-Workflows 107 | Author: hzlzh (hzlzh.dev@gmail.com) 108 | Twitter: @hzlzh 109 | Blog: https://zlz.im/Alfred-Workflows/ 110 | ''' 111 | from feedback import Feedback 112 | 113 | import urllib 114 | import urllib2 115 | import json 116 | import sys 117 | import re 118 | 119 | 120 | def get_root_domain(domain): 121 | r = re.compile('([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}') 122 | s_match = r.search(domain) 123 | return s_match.group() 124 | 125 | def get_pr(domain): 126 | api = 'http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&' 127 | # get google domain hask 128 | GPR_HASH_SEED ="Mining PageRank dmoanin hash" 129 | def google_hash(value): 130 | magic = 0x1020345 131 | for i in xrange(len(value)): 132 | magic ^= ord(GPR_HASH_SEED[i % len(GPR_HASH_SEED)]) ^ ord(value[i]) 133 | magic = (magic >> 23 | magic << 9) & 0xFFFFFFFF 134 | return "8%08x" % (magic) 135 | 136 | try: 137 | request = api + 'ch=' + google_hash(domain) + '&q=info:' + domain 138 | terms = urllib.quote_plus(request.strip()) 139 | data = urllib2.urlopen(request).read() 140 | except Exception, e: 141 | print 'Error' 142 | 143 | return str.split(data,':')[-1] 144 | 145 | def get_alexa(domain): 146 | api = 'http://data.alexa.com/data?cli=10&dat=snbamz&url=' 147 | request = api + domain 148 | terms = urllib.quote_plus(request.strip()) 149 | data = urllib2.urlopen(request).read() 150 | return data[data.index('REACH RANK')+12:data.index('RANK DELTA')-5] 151 | 152 | def check_rank(type,domain): 153 | if(type == 'pr'): 154 | return get_pr(domain) 155 | elif(type == 'alexa'): 156 | return get_alexa(domain) 157 | 158 | query = get_root_domain('{query}') 159 | 160 | api = { 161 | 'pr':{'title':'Checking Google PR for >>> ','des':'Result: ','checker':'http://www.prfind.com/?q='}, 162 | 'alexa':{'title':'Checking Alexa reach Rank for >>> ','des':'Result: ','checker':'http://www.alexa.com/search?q='} 163 | } 164 | 165 | fb = Feedback() 166 | for title in api: 167 | fb.add_item(api[title]['title'] + query, 168 | subtitle=api[title]['des'] + " %s" % check_rank(title,query),arg=api[title]['checker']+query,icon='favicons/'+title+'.png') 169 | print fb 170 | subtext 171 | Include PR, Alexa 172 | title 173 | Input any domain URL here 174 | type 175 | 3 176 | withspace 177 | 178 | 179 | type 180 | alfred.workflow.input.scriptfilter 181 | uid 182 | E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E 183 | 184 | 185 | config 186 | 187 | action 188 | 0 189 | argument 190 | 1 191 | hotkey 192 | 35 193 | hotmod 194 | 1835008 195 | hotstring 196 | P 197 | leftcursor 198 | 199 | modsmode 200 | 0 201 | 202 | type 203 | alfred.workflow.trigger.hotkey 204 | uid 205 | 5AF9DBA5-62D9-44A4-B634-119DFCF6EE12 206 | 207 | 208 | readme 209 | # SEO Checker v1.0 210 | 211 | Check domain's PR, Alexa, etc 212 | 213 | # Project Source 214 | 215 | * Github: https://github.com/hzlzh/Alfred-Workflows 216 | * Blog Post: https://zlz.im/Alfred-Workflows/ 217 | 218 | # Contact 219 | 220 | * Andy Huang (hzlzh.dev@gmail.com) 221 | * Twitter: https://twitter.com/hzlzh 222 | 223 | (If you need more SEO services to be added, please let me know.) 224 | uidata 225 | 226 | 1405700F-1171-44FB-A236-34DF8CF9E101 227 | 228 | ypos 229 | 10 230 | 231 | 5AF9DBA5-62D9-44A4-B634-119DFCF6EE12 232 | 233 | ypos 234 | 10 235 | 236 | 6A5855DC-E66B-40CD-B6C0-0CAF18F63BE9 237 | 238 | ypos 239 | 10 240 | 241 | E0A62B76-2AC4-4EA9-9229-5AEBD2D5499E 242 | 243 | ypos 244 | 10 245 | 246 | 247 | webaddress 248 | https://zlz.im/ 249 | 250 | 251 | -------------------------------------------------------------------------------- /Shorten-URL/FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/bit.ly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/bit.ly.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/git.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/git.io.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/goo.gl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/goo.gl.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/is.gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/is.gd.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/j.mp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/j.mp.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/t.cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/t.cn.png -------------------------------------------------------------------------------- /Shorten-URL/favicons/v.gd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/favicons/v.gd.png -------------------------------------------------------------------------------- /Shorten-URL/feedback.py: -------------------------------------------------------------------------------- 1 | #author: Peter Okma 2 | import xml.etree.ElementTree as et 3 | 4 | 5 | class Feedback(): 6 | """Feeback used by Alfred Script Filter 7 | 8 | Usage: 9 | fb = Feedback() 10 | fb.add_item('Hello', 'World') 11 | fb.add_item('Foo', 'Bar') 12 | print fb 13 | 14 | """ 15 | 16 | def __init__(self): 17 | self.feedback = et.Element('items') 18 | 19 | def __repr__(self): 20 | """XML representation used by Alfred 21 | 22 | Returns: 23 | XML string 24 | """ 25 | return et.tostring(self.feedback) 26 | 27 | def add_item(self, title, subtitle="", arg="", valid="yes", autocomplete="", icon="icon.png"): 28 | """ 29 | Add item to alfred Feedback 30 | 31 | Args: 32 | title(str): the title displayed by Alfred 33 | Keyword Args: 34 | subtitle(str): the subtitle displayed by Alfred 35 | arg(str): the value returned by alfred when item is selected 36 | valid(str): whether or not the entry can be selected in Alfred to trigger an action 37 | autcomplete(str): the text to be inserted if an invalid item is selected. This is only used if 'valid' is 'no' 38 | icon(str): filename of icon that Alfred will display 39 | """ 40 | item = et.SubElement(self.feedback, 'item', uid=str(len(self.feedback)), 41 | arg=arg, valid=valid, autocomplete=autocomplete) 42 | _title = et.SubElement(item, 'title') 43 | _title.text = title 44 | _sub = et.SubElement(item, 'subtitle') 45 | _sub.text = subtitle 46 | _icon = et.SubElement(item, 'icon') 47 | _icon.text = icon 48 | -------------------------------------------------------------------------------- /Shorten-URL/feedback.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/feedback.pyc -------------------------------------------------------------------------------- /Shorten-URL/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Shorten-URL/icon.png -------------------------------------------------------------------------------- /Shorten-URL/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.shorten-url.hzlzh 7 | connections 8 | 9 | 29221F47-9904-4EE7-AAF9-D300BAFAF2EF 10 | 11 | 12 | destinationuid 13 | 162D1E3F-9D73-4C83-AD8C-869165521442 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | destinationuid 21 | 82524AB3-0487-48D7-9CB8-7A456D78F473 22 | modifiers 23 | 0 24 | modifiersubtext 25 | 26 | 27 | 28 | 82E5133A-F114-4C1D-9FD4-365C395B6DF1 29 | 30 | 31 | destinationuid 32 | FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904 33 | modifiers 34 | 0 35 | modifiersubtext 36 | 37 | 38 | 39 | FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904 40 | 41 | 42 | destinationuid 43 | 29221F47-9904-4EE7-AAF9-D300BAFAF2EF 44 | modifiers 45 | 0 46 | modifiersubtext 47 | 48 | 49 | 50 | 51 | createdby 52 | hzlzh 53 | description 54 | Shorten link with (goo.gl, bit.ly, t.cn, j.mp, is.gd, v.gd, git.io etc.) 55 | disabled 56 | 57 | name 58 | Shorten URL 59 | objects 60 | 61 | 62 | config 63 | 64 | escaping 65 | 63 66 | script 67 | ''' 68 | Shorten URL v1.5 69 | 70 | Github: https://github.com/hzlzh/Alfred-Workflows 71 | Author: hzlzh (hzlzh.dev@gmail.com) 72 | Twitter: @hzlzh 73 | Blog: https://zlz.im/Alfred-Workflows/ 74 | ''' 75 | 76 | from __future__ import print_function 77 | import urllib 78 | import urllib2 79 | import json 80 | import sys 81 | import re 82 | 83 | def getLink(type,service,url): 84 | 85 | if (('http' in url) == False): 86 | url = 'http://'+url 87 | 88 | if type == 'goo.gl': 89 | terms = urllib.quote_plus(url.strip()) 90 | data = json.dumps({"longUrl": url}) 91 | clen = len(data) 92 | req = urllib2.Request(service,data,{'Content-Type': 'application/json', 'Content-Length': clen}) 93 | f = urllib2.urlopen(req) 94 | data = f.read() 95 | output = json.loads(data)["id"] 96 | elif type == 'git.io': 97 | match = re.search('^(https?:\/\/)?(gist\.)?github.com', url) 98 | if match: 99 | terms = urllib.quote_plus(url.strip()) 100 | data = urllib2.urlopen(url=service, data='url=' + terms) 101 | output = dict(data.info())['location'] 102 | else: 103 | output = 'URL must be from github.com' 104 | else: 105 | try: 106 | terms = urllib.quote_plus(url.strip()) 107 | url = service + terms 108 | data = urllib2.urlopen(url).read() 109 | except Exception, e: 110 | print('') 111 | if type == 'bit.ly': 112 | result = json.loads(data) 113 | if(result["status_code"] == 500): 114 | output = result["status_txt"] 115 | else: 116 | output = result["data"]["url"] 117 | elif type == 'j.mp': 118 | result = json.loads(data) 119 | if(result["status_code"] == 500): 120 | output = result["status_txt"] 121 | else: 122 | output = result["data"]["url"] 123 | elif type == 't.cn': 124 | result = json.loads(data) 125 | if('error_code' in result.keys()): 126 | output = result["error"] 127 | else: 128 | output = result["urls"][0]["url_short"] 129 | elif type == 'is.gd': 130 | result = json.loads(data) 131 | if('errorcode' in result.keys()): 132 | output = result["errormessage"] 133 | else: 134 | output = result["shorturl"] 135 | elif type == 'v.gd': 136 | result = json.loads(data) 137 | if('errorcode' in result.keys()): 138 | output = result["errormessage"] 139 | else: 140 | output = result["shorturl"] 141 | return output 142 | 143 | temp = '{query}' 144 | response = json.loads(temp) 145 | 146 | type = response['type'] 147 | service = response['api_url'] 148 | url = response['long_url'] 149 | 150 | last_output = getLink(type,service,url) 151 | 152 | if ('http' in last_output): 153 | print(last_output, end='') 154 | else: 155 | print('Error: '+ last_output, end='') 156 | type 157 | 3 158 | 159 | type 160 | alfred.workflow.action.script 161 | uid 162 | 29221F47-9904-4EE7-AAF9-D300BAFAF2EF 163 | 164 | 165 | config 166 | 167 | autopaste 168 | 169 | clipboardtext 170 | {query} 171 | 172 | type 173 | alfred.workflow.output.clipboard 174 | uid 175 | 162D1E3F-9D73-4C83-AD8C-869165521442 176 | 177 | 178 | config 179 | 180 | action 181 | 0 182 | argument 183 | 1 184 | hotkey 185 | 37 186 | hotmod 187 | 1835008 188 | hotstring 189 | L 190 | leftcursor 191 | 192 | modsmode 193 | 0 194 | 195 | type 196 | alfred.workflow.trigger.hotkey 197 | uid 198 | 82E5133A-F114-4C1D-9FD4-365C395B6DF1 199 | 200 | 201 | config 202 | 203 | argumenttype 204 | 0 205 | escaping 206 | 63 207 | keyword 208 | short 209 | runningsubtext 210 | Loading services list. 211 | script 212 | ''' 213 | Shorten URL v1.5 214 | 215 | Github: https://github.com/hzlzh/Alfred-Workflows 216 | Author: hzlzh (hzlzh.dev@gmail.com) 217 | Twitter: @hzlzh 218 | Blog: https://zlz.im/Alfred-Workflows/ 219 | ''' 220 | from feedback import Feedback 221 | 222 | import urllib 223 | import urllib2 224 | import json 225 | import sys 226 | 227 | query = '{query}' 228 | 229 | #Change the sort number 0,1,2,3,4,5 into your own. 230 | 231 | api = { 232 | 0 : {'api_url':'https://www.googleapis.com/urlshortener/v1/url','title':'goo.gl','des':'http://goo.gl/'}, 233 | 1 : {'api_url':'https://api-ssl.bitly.com/v3/shorten?format=json&login=hzlzh&apiKey=R_e8bcc43adaa5f818cc5d8a544a17d27d&longUrl=','title':'bit.ly','des':'http://bit.ly/'}, 234 | 2 : {'api_url':'https://api.weibo.com/2/short_url/shorten.json?access_token=2.00WSLtpB0GRHJ9745670860ceNWWiC&source=5786724301&url_long=','title':'t.cn','des':'http://t.cn/'}, 235 | 3 : {'api_url':'http://api.j.mp/v3//shorten?format=json&login=hzlzh&apiKey=R_e8bcc43adaa5f818cc5d8a544a17d27d&longUrl=','title':'j.mp','des':'http://j.mp/'}, 236 | 4 : {'api_url':'http://is.gd/create.php?format=json&url=','title':'is.gd','des':'http://is.gd/'}, 237 | 5 : {'api_url':'http://v.gd/create.php?format=json&url=','title':'v.gd','des':'http://v.gd/'}, 238 | 6 : {'api_url':'http://git.io','title':'git.io','des':'http://git.io/'} 239 | } 240 | 241 | fb = Feedback() 242 | for title in api: 243 | fb.add_item(api[title]['title'], 244 | subtitle="Using %s" % api[title]['des'], 245 | arg='{"type":"'+api[title]['title']+'","api_url":"'+api[title]['api_url']+'","long_url":"'+query+'"}',icon='favicons/'+api[title]['title']+'.png') 246 | print fb 247 | 248 | subtext 249 | Include goo.gl, bit.ly, t.cn, j.mp, is.gd, v.gd, git.io etc. 250 | title 251 | Shorten URL 252 | type 253 | 3 254 | withspace 255 | 256 | 257 | type 258 | alfred.workflow.input.scriptfilter 259 | uid 260 | FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904 261 | 262 | 263 | config 264 | 265 | lastpathcomponent 266 | 267 | onlyshowifquerypopulated 268 | 269 | output 270 | 0 271 | removeextension 272 | 273 | sticky 274 | 275 | text 276 | Copied to Clipboard! 277 | title 278 | {query} 279 | 280 | type 281 | alfred.workflow.output.notification 282 | uid 283 | 82524AB3-0487-48D7-9CB8-7A456D78F473 284 | 285 | 286 | readme 287 | # Shorten URL v1.5 288 | 289 | This workflow support URL shortener like (goo.gl, bit.ly, t.cn, j.mp, is.gd, v.gd, git.io), you can use Hotkey to trigger without open Alfred input window. 290 | 291 | # Project Source 292 | 293 | * Github: https://github.com/hzlzh/Alfred-Workflows 294 | * Blog Post: https://zlz.im/Alfred-Workflows/ 295 | 296 | # Contact 297 | 298 | * Andy Huang (hzlzh.dev@gmail.com) 299 | * Twitter: https://twitter.com/hzlzh 300 | 301 | (If you need more services to be added, please let me know.) 302 | uidata 303 | 304 | 162D1E3F-9D73-4C83-AD8C-869165521442 305 | 306 | ypos 307 | 10 308 | 309 | 29221F47-9904-4EE7-AAF9-D300BAFAF2EF 310 | 311 | ypos 312 | 10 313 | 314 | 82524AB3-0487-48D7-9CB8-7A456D78F473 315 | 316 | ypos 317 | 130 318 | 319 | 82E5133A-F114-4C1D-9FD4-365C395B6DF1 320 | 321 | ypos 322 | 10 323 | 324 | FE7E3DAE-D8FF-4C84-AC14-4A1D11A10904 325 | 326 | ypos 327 | 10 328 | 329 | 330 | webaddress 331 | https://zlz.im/ 332 | 333 | 334 | -------------------------------------------------------------------------------- /Shorten-URL/remote.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.5, 3 | "download_uri": "https://raw.github.com/hzlzh/Alfred-Workflows/master/Downloads/Shorten-URL.alfredworkflow", 4 | "description": "Fix t.cn" 5 | } 6 | -------------------------------------------------------------------------------- /Shorten-URL/shorten_url.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Shorten URL v1.5 3 | 4 | Github: https://github.com/hzlzh/Alfred-Workflows 5 | Author: hzlzh (hzlzh.dev@gmail.com) 6 | Twitter: @hzlzh 7 | Blog: https://zlz.im/Alfred-Workflows/ 8 | ''' 9 | from feedback import Feedback 10 | 11 | import urllib 12 | import urllib2 13 | import json 14 | import sys 15 | 16 | query = sys.argv[1] 17 | 18 | api = { 19 | 'goo.gl' : {'api_url':'https://www.googleapis.com/urlshortener/v1/url','title':'goo.gl','des':'http://goo.gl/'}, 20 | 'bit.ly' : {'api_url':'https://api-ssl.bitly.com/v3/shorten?format=json&login=hzlzh&apiKey=R_e8bcc43adaa5f818cc5d8a544a17d27d&longUrl=','title':'bit.ly','des':'http://bit.ly/'}, 21 | 't.cn' : {'api_url':'https://api.weibo.com/2/short_url/shorten.json?source=2849184197&url_long=','title':'t.cn','des':'http://t.cn/'}, 22 | 'j.mp' : {'api_url':'http://api.j.mp/v3//shorten?format=json&login=hzlzh&apiKey=R_e8bcc43adaa5f818cc5d8a544a17d27d&longUrl=','title':'j.mp','des':'http://j.mp/'}, 23 | 'is.gd' : {'api_url':'http://is.gd/create.php?format=json&url=','title':'is.gd','des':'http://is.gd/'}, 24 | 'v.gd' : {'api_url':'http://v.gd/create.php?format=json&url=','title':'v.gd','des':'http://v.gd/'}, 25 | 'git.io' : {'api_url':'https://git.io','title':'git.io','des':'https://git.io/'} 26 | } 27 | 28 | fb = Feedback() 29 | for title in api: 30 | fb.add_item(api[title]['title'], 31 | subtitle="Using %s" % api[title]['des'], 32 | arg='{"type":"'+title+'","api_url":"'+api[title]['api_url']+'","long_url":"'+query+'"}',icon='favicons/'+title+'.png') 33 | print fb 34 | -------------------------------------------------------------------------------- /Shorten-URL/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.5, 3 | "remote_json": "https://raw.github.com/hzlzh/Alfred-Workflows/master/Shorten-URL/remote.json" 4 | } 5 | -------------------------------------------------------------------------------- /V2EX/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/V2EX/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png -------------------------------------------------------------------------------- /V2EX/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/V2EX/icon.png -------------------------------------------------------------------------------- /V2EX/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.v2ex.hzlzh 7 | connections 8 | 9 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 10 | 11 | 12 | destinationuid 13 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 21 | 22 | 23 | destinationuid 24 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 25 | modifiers 26 | 1048576 27 | modifiersubtext 28 | ⌘ > 仅复制此文章链接到剪切板 29 | 30 | 31 | destinationuid 32 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 33 | modifiers 34 | 0 35 | modifiersubtext 36 | 37 | 38 | 39 | destinationuid 40 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 41 | modifiers 42 | 1048576 43 | modifiersubtext 44 | ⌘ > 仅复制此文章链接到剪切板 45 | 46 | 47 | destinationuid 48 | 03A62D0B-A768-4DCE-A3C8-3DCC8D672125 49 | modifiers 50 | 0 51 | modifiersubtext 52 | 53 | 54 | 55 | destinationuid 56 | 29B4395A-0D13-4C81-A252-26A55CA7E1B6 57 | modifiers 58 | 524288 59 | modifiersubtext 60 | 搜索本条 61 | 62 | 63 | 64 | createdby 65 | hzlzh 66 | description 67 | Workflow for v2ex.com 68 | disabled 69 | 70 | name 71 | V2EX 72 | objects 73 | 74 | 75 | config 76 | 77 | action 78 | 0 79 | argument 80 | 1 81 | hotkey 82 | 32 83 | hotmod 84 | 1835008 85 | hotstring 86 | U 87 | leftcursor 88 | 89 | modsmode 90 | 0 91 | 92 | type 93 | alfred.workflow.trigger.hotkey 94 | uid 95 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 96 | 97 | 98 | config 99 | 100 | lastpathcomponent 101 | 102 | onlyshowifquerypopulated 103 | 104 | output 105 | 0 106 | removeextension 107 | 108 | sticky 109 | 110 | text 111 | {query} 112 | title 113 | {query} 114 | 115 | type 116 | alfred.workflow.output.notification 117 | uid 118 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 119 | 120 | 121 | config 122 | 123 | autopaste 124 | 125 | clipboardtext 126 | 127 | 128 | type 129 | alfred.workflow.output.clipboard 130 | uid 131 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 132 | 133 | 134 | config 135 | 136 | argumenttype 137 | 0 138 | escaping 139 | 63 140 | keyword 141 | v2ex 142 | runningsubtext 143 | 正在处理中 … 144 | script 145 | 146 | require_once('workflows.php'); 147 | 148 | 149 | function load_data($api) { 150 | 151 | $opts = array( 152 | 'http'=>array( 153 | 'method'=>"GET", 154 | 'timeout'=>10 155 | ) 156 | ); 157 | $context = stream_context_create($opts); 158 | $obj = false; 159 | 160 | $xml = @file_get_contents( $api,false, $context); 161 | $obj=json_decode($xml); 162 | 163 | return $obj; 164 | 165 | } 166 | 167 | 168 | $wf = new Workflows(); 169 | 170 | $orig = "{query}"; 171 | 172 | if($orig == 'n' || $orig == 'new' ){ 173 | $obj = load_data('https://v2ex.com/api/topics/latest.json'); 174 | $int = 1; 175 | 176 | if($obj != null): 177 | foreach( $obj as $post ): 178 | $post_id = $post->id; 179 | $post_title = $post->title; 180 | $post_url = $post->url; 181 | $post_content = $post->content; 182 | $post_member = $post->member->username; 183 | $post_member_id = $post->member->id; 184 | $post_avatar = $post->member->avatar_normal; 185 | $post_local_avatar = 'temp_avatar/default.png'; 186 | 187 | $wf->result( $post_id, $post_url, $post_title.' - @'.$post_member, $post_content, $post_local_avatar ); 188 | $int++; 189 | endforeach; 190 | endif; 191 | 192 | }else if(strstr($orig,'@')){ 193 | $obj = load_data('https://v2ex.com/api/topics/show.json?username='.substr($orig,1)); 194 | $int = 1; 195 | 196 | if($obj != null): 197 | foreach( $obj as $post ): 198 | $post_id = $post->id; 199 | $post_title = $post->title; 200 | $post_url = $post->url; 201 | $post_content = $post->content; 202 | $post_member = $post->member->username; 203 | $post_member_id = $post->member->id; 204 | $post_local_avatar = 'temp_avatar/default.png'; 205 | 206 | $wf->result( $post_id, $post_url, $post_title.' - @'.$post_member, $post_content, $post_local_avatar ); 207 | $int++; 208 | endforeach; 209 | endif; 210 | } 211 | 212 | $results = $wf->results(); 213 | if ( count( $results ) == 0 ): 214 | $wf->result( 'v2ex_500', '请确保指令和网络链接正常', '没有响应,请再试一次。', '请确保指令和网络链接正常', 'icon.png' ); 215 | endif; 216 | 217 | echo $wf->toxml(); 218 | 219 | subtext 220 | new或n: 获取最新文章列表 | @name: 获取指定用户文章列表 221 | title 222 | 常用指令:n或new | @name 223 | type 224 | 1 225 | withspace 226 | 227 | 228 | type 229 | alfred.workflow.input.scriptfilter 230 | uid 231 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 232 | 233 | 234 | config 235 | 236 | plusspaces 237 | 238 | url 239 | {query} 240 | utf8 241 | 242 | 243 | type 244 | alfred.workflow.action.openurl 245 | uid 246 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 247 | 248 | 249 | config 250 | 251 | lastpathcomponent 252 | 253 | onlyshowifquerypopulated 254 | 255 | output 256 | 0 257 | removeextension 258 | 259 | sticky 260 | 261 | text 262 | {query} 263 | title 264 | {query} 265 | 266 | type 267 | alfred.workflow.output.notification 268 | uid 269 | 03A62D0B-A768-4DCE-A3C8-3DCC8D672125 270 | 271 | 272 | config 273 | 274 | searcher 275 | 1635215215 276 | 277 | type 278 | alfred.workflow.action.systemwebsearch 279 | uid 280 | 29B4395A-0D13-4C81-A252-26A55CA7E1B6 281 | 282 | 283 | readme 284 | # V2EX v1.0 285 | 286 | 一个给V2EXer用的Alfred 2 workflow. 287 | 功能: 288 | * 获取最新文章列表,指令:n 或 new 289 | * 获取指定用户的文章列表,指令:@hzlzh 290 | * 列表状态下按住`Command`键,可以只复制URL到剪切板 291 | * 列表状态下按住`Opition`键,在搜索引擎中检索该文章 292 | * 更多功能添加中... 293 | 294 | # Project Source 295 | 296 | * Github: https://github.com/hzlzh/Alfred-Workflows 297 | * Blog Post: https://zlz.im/Alfred-Workflows/ 298 | 299 | # Contact 300 | 301 | * hzlzh (hzlzh.dev@gmail.com) 302 | * Twitter: https://twitter.com/hzlzh 303 | uidata 304 | 305 | 03A62D0B-A768-4DCE-A3C8-3DCC8D672125 306 | 307 | ypos 308 | 270 309 | 310 | 29B4395A-0D13-4C81-A252-26A55CA7E1B6 311 | 312 | ypos 313 | 280 314 | 315 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 316 | 317 | ypos 318 | 10 319 | 320 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 321 | 322 | ypos 323 | 140 324 | 325 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 326 | 327 | ypos 328 | 10 329 | 330 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 331 | 332 | ypos 333 | 140 334 | 335 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 336 | 337 | ypos 338 | 140 339 | 340 | 341 | webaddress 342 | https://zlz.im/ 343 | 344 | 345 | -------------------------------------------------------------------------------- /V2EX/temp_avatar/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/V2EX/temp_avatar/default.png -------------------------------------------------------------------------------- /V2EX/workflows.php: -------------------------------------------------------------------------------- 1 | path = exec('pwd'); 31 | $this->home = exec('printf "$HOME"'); 32 | 33 | if ( file_exists( 'info.plist' ) ): 34 | $this->bundle = $this->get( 'bundleid', 'info.plist' ); 35 | endif; 36 | 37 | if ( !is_null( $bundleid ) ): 38 | $this->bundle = $bundleid; 39 | endif; 40 | 41 | $this->cache = $this->home. "/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/".$this->bundle; 42 | $this->data = $this->home. "/Library/Application Support/Alfred 2/Workflow Data/".$this->bundle; 43 | 44 | if ( !file_exists( $this->cache ) ): 45 | exec("mkdir '".$this->cache."'"); 46 | endif; 47 | 48 | if ( !file_exists( $this->data ) ): 49 | exec("mkdir '".$this->data."'"); 50 | endif; 51 | 52 | $this->results = array(); 53 | } 54 | 55 | /** 56 | * Description: 57 | * Accepts no parameter and returns the value of the bundle id for the current workflow. 58 | * If no value is available, then false is returned. 59 | * 60 | * @param none 61 | * @return false if not available, bundle id value if available. 62 | */ 63 | public function bundle() 64 | { 65 | if ( is_null( $this->bundle ) ): 66 | return false; 67 | else: 68 | return $this->bundle; 69 | endif; 70 | } 71 | 72 | /** 73 | * Description: 74 | * Accepts no parameter and returns the value of the path to the cache directory for your 75 | * workflow if it is available. Returns false if the value isn't available. 76 | * 77 | * @param none 78 | * @return false if not available, path to the cache directory for your workflow if available. 79 | */ 80 | public function cache() 81 | { 82 | if ( is_null( $this->bundle ) ): 83 | return false; 84 | else: 85 | if ( is_null( $this->cache ) ): 86 | return false; 87 | else: 88 | return $this->cache; 89 | endif; 90 | endif; 91 | } 92 | 93 | /** 94 | * Description: 95 | * Accepts no parameter and returns the value of the path to the storage directory for your 96 | * workflow if it is available. Returns false if the value isn't available. 97 | * 98 | * @param none 99 | * @return false if not available, path to the storage directory for your workflow if available. 100 | */ 101 | public function data() 102 | { 103 | if ( is_null( $this->bundle ) ): 104 | return false; 105 | else: 106 | if ( is_null( $this->data ) ): 107 | return false; 108 | else: 109 | return $this->data; 110 | endif; 111 | endif; 112 | } 113 | 114 | /** 115 | * Description: 116 | * Accepts no parameter and returns the value of the path to the current directory for your 117 | * workflow if it is available. Returns false if the value isn't available. 118 | * 119 | * @param none 120 | * @return false if not available, path to the current directory for your workflow if available. 121 | */ 122 | public function path() 123 | { 124 | if ( is_null( $this->path ) ): 125 | return false; 126 | else: 127 | return $this->path; 128 | endif; 129 | } 130 | 131 | /** 132 | * Description: 133 | * Accepts no parameter and returns the value of the home path for the current user 134 | * Returns false if the value isn't available. 135 | * 136 | * @param none 137 | * @return false if not available, home path for the current user if available. 138 | */ 139 | public function home() 140 | { 141 | if ( is_null( $this->home ) ): 142 | return false; 143 | else: 144 | return $this->home; 145 | endif; 146 | } 147 | 148 | /** 149 | * Description: 150 | * Returns an array of available result items 151 | * 152 | * @param none 153 | * @return array - list of result items 154 | */ 155 | public function results() 156 | { 157 | return $this->results; 158 | } 159 | 160 | /** 161 | * Description: 162 | * Convert an associative array into XML format 163 | * 164 | * @param $a - An associative array to convert 165 | * @param $format - format of data being passed (json or array), defaults to array 166 | * @return - XML string representation of the array 167 | */ 168 | public function toxml( $a=null, $format='array' ) { 169 | 170 | if ( $format == 'json' ): 171 | $a = json_decode( $a, TRUE ); 172 | endif; 173 | 174 | if ( is_null( $a ) && !empty( $this->results ) ): 175 | $a = $this->results; 176 | elseif ( is_null( $a ) && empty( $this->results ) ): 177 | return false; 178 | endif; 179 | 180 | $items = new SimpleXMLElement(""); // Create new XML element 181 | 182 | foreach( $a as $b ): // Lop through each object in the array 183 | $c = $items->addChild( 'item' ); // Add a new 'item' element for each object 184 | $c_keys = array_keys( $b ); // Grab all the keys for that item 185 | foreach( $c_keys as $key ): // For each of those keys 186 | if ( $key == 'uid' ): 187 | if ( $b[$key] === null || $b[$key] === '' ): 188 | continue; 189 | else: 190 | $c->addAttribute( 'uid', $b[$key] ); 191 | endif; 192 | elseif ( $key == 'arg' ): 193 | $c->addAttribute( 'arg', $b[$key] ); 194 | $c->$key = $b[$key]; 195 | elseif ( $key == 'type' ): 196 | $c->addAttribute( 'type', $b[$key] ); 197 | elseif ( $key == 'valid' ): 198 | if ( $b[$key] == 'yes' || $b[$key] == 'no' ): 199 | $c->addAttribute( 'valid', $b[$key] ); 200 | endif; 201 | elseif ( $key == 'autocomplete' ): 202 | if ( $b[$key] === null || $b[$key] === '' ): 203 | continue; 204 | else: 205 | $c->addAttribute( 'autocomplete', $b[$key] ); 206 | endif; 207 | elseif ( $key == 'icon' ): 208 | if ( substr( $b[$key], 0, 9 ) == 'fileicon:' ): 209 | $val = substr( $b[$key], 9 ); 210 | $c->$key = $val; 211 | $c->$key->addAttribute( 'type', 'fileicon' ); 212 | elseif ( substr( $b[$key], 0, 9 ) == 'filetype:' ): 213 | $val = substr( $b[$key], 9 ); 214 | $c->$key = $val; 215 | $c->$key->addAttribute( 'type', 'filetype' ); 216 | else: 217 | $c->$key = $b[$key]; 218 | endif; 219 | else: 220 | $c->$key = $b[$key]; 221 | endif; 222 | endforeach; 223 | endforeach; 224 | 225 | return $items->asXML(); // Return XML string representation of the array 226 | 227 | } 228 | 229 | /** 230 | * Description: 231 | * Remove all items from an associative array that do not have a value 232 | * 233 | * @param $a - Associative array 234 | * @return bool 235 | */ 236 | private function empty_filter( $a ) { 237 | if ( $a == '' || $a == null ): // if $a is empty or null 238 | return false; // return false, else, return true 239 | else: 240 | return true; 241 | endif; 242 | } 243 | 244 | /** 245 | * Description: 246 | * Save values to a specified plist. If the first parameter is an associative 247 | * array, then the second parameter becomes the plist file to save to. If the 248 | * first parameter is string, then it is assumed that the first parameter is 249 | * the label, the second parameter is the value, and the third parameter is 250 | * the plist file to save the data to. 251 | * 252 | * @param $a - associative array of values to save 253 | * @param $b - the value of the setting 254 | * @param $c - the plist to save the values into 255 | * @return string - execution output 256 | */ 257 | public function set( $a=null, $b=null, $c=null ) 258 | { 259 | if ( is_array( $a ) ): 260 | if ( file_exists( $b ) ): 261 | if ( file_exists( $this->path.'/'.$b ) ): 262 | $b = $this->path.'/'.$b; 263 | endif; 264 | elseif ( file_exists( $this->data."/".$b ) ): 265 | $b = $this->data."/".$b; 266 | elseif ( file_exists( $this->cache."/".$b ) ): 267 | $b = $this->cache."/".$b; 268 | else: 269 | $b = $this->data."/".$b; 270 | endif; 271 | else: 272 | if ( file_exists( $c ) ): 273 | if ( file_exists( $this->path.'/'.$c ) ): 274 | $c = $this->path.'/'.$c; 275 | endif; 276 | elseif ( file_exists( $this->data."/".$c ) ): 277 | $c = $this->data."/".$c; 278 | elseif ( file_exists( $this->cache."/".$c ) ): 279 | $c = $this->cache."/".$c; 280 | else: 281 | $c = $this->data."/".$c; 282 | endif; 283 | endif; 284 | 285 | if ( is_array( $a ) ): 286 | foreach( $a as $k => $v ): 287 | exec( 'defaults write "'. $b .'" '. $k .' "'. $v .'"'); 288 | endforeach; 289 | else: 290 | exec( 'defaults write "'. $c .'" '. $a .' "'. $b .'"'); 291 | endif; 292 | } 293 | 294 | /** 295 | * Description: 296 | * Read a value from the specified plist 297 | * 298 | * @param $a - the value to read 299 | * @param $b - plist to read the values from 300 | * @return bool false if not found, string if found 301 | */ 302 | public function get( $a, $b ) { 303 | 304 | if ( file_exists( $b ) ): 305 | if ( file_exists( $this->path.'/'.$b ) ): 306 | $b = $this->path.'/'.$b; 307 | endif; 308 | elseif ( file_exists( $this->data."/".$b ) ): 309 | $b = $this->data."/".$b; 310 | elseif ( file_exists( $this->cache."/".$b ) ): 311 | $b = $this->cache."/".$b; 312 | else: 313 | return false; 314 | endif; 315 | 316 | exec( 'defaults read "'. $b .'" '.$a, $out ); // Execute system call to read plist value 317 | 318 | if ( $out == "" ): 319 | return false; 320 | endif; 321 | 322 | $out = $out[0]; 323 | return $out; // Return item value 324 | } 325 | 326 | /** 327 | * Description: 328 | * Read data from a remote file/url, essentially a shortcut for curl 329 | * 330 | * @param $url - URL to request 331 | * @param $options - Array of curl options 332 | * @return result from curl_exec 333 | */ 334 | public function request( $url=null, $options=null ) 335 | { 336 | if ( is_null( $url ) ): 337 | return false; 338 | endif; 339 | 340 | $defaults = array( // Create a list of default curl options 341 | CURLOPT_RETURNTRANSFER => true, // Returns the result as a string 342 | CURLOPT_URL => $url, // Sets the url to request 343 | CURLOPT_FRESH_CONNECT => true 344 | ); 345 | 346 | if ( $options ): 347 | foreach( $options as $k => $v ): 348 | $defaults[$k] = $v; 349 | endforeach; 350 | endif; 351 | 352 | array_filter( $defaults, // Filter out empty options from the array 353 | array( $this, 'empty_filter' ) ); 354 | 355 | $ch = curl_init(); // Init new curl object 356 | curl_setopt_array( $ch, $defaults ); // Set curl options 357 | $out = curl_exec( $ch ); // Request remote data 358 | $err = curl_error( $ch ); 359 | curl_close( $ch ); // End curl request 360 | 361 | if ( $err ): 362 | return $err; 363 | else: 364 | return $out; 365 | endif; 366 | } 367 | 368 | /** 369 | * Description: 370 | * Allows searching the local hard drive using mdfind 371 | * 372 | * @param $query - search string 373 | * @return array - array of search results 374 | */ 375 | public function mdfind( $query ) 376 | { 377 | exec('mdfind "'.$query.'"', $results); 378 | return $results; 379 | } 380 | 381 | /** 382 | * Description: 383 | * Accepts data and a string file name to store data to local file as cache 384 | * 385 | * @param array - data to save to file 386 | * @param file - filename to write the cache data to 387 | * @return none 388 | */ 389 | public function write( $a, $b ) 390 | { 391 | if ( file_exists( $b ) ): 392 | if ( file_exists( $this->path.'/'.$b ) ): 393 | $b = $this->path.'/'.$b; 394 | endif; 395 | elseif ( file_exists( $this->data."/".$b ) ): 396 | $b = $this->data."/".$b; 397 | elseif ( file_exists( $this->cache."/".$b ) ): 398 | $b = $this->cache."/".$b; 399 | else: 400 | $b = $this->data."/".$b; 401 | endif; 402 | 403 | if ( is_array( $a ) ): 404 | $a = json_encode( $a ); 405 | file_put_contents( $b, $a ); 406 | return true; 407 | elseif ( is_string( $a ) ): 408 | file_put_contents( $b, $a ); 409 | return true; 410 | else: 411 | return false; 412 | endif; 413 | } 414 | 415 | /** 416 | * Description: 417 | * Returns data from a local cache file 418 | * 419 | * @param file - filename to read the cache data from 420 | * @return false if the file cannot be found, the file data if found. If the file 421 | * format is json encoded, then a json object is returned. 422 | */ 423 | public function read( $a, $array = false ) 424 | { 425 | if ( file_exists( $a ) ): 426 | if ( file_exists( $this->path.'/'.$a ) ): 427 | $a = $this->path.'/'.$a; 428 | endif; 429 | elseif ( file_exists( $this->data."/".$a ) ): 430 | $a = $this->data."/".$a; 431 | elseif ( file_exists( $this->cache."/".$a ) ): 432 | $a = $this->cache."/".$a; 433 | else: 434 | return false; 435 | endif; 436 | 437 | $out = file_get_contents( $a ); 438 | if ( !is_null( json_decode( $out ) ) && !$array ): 439 | $out = json_decode( $out ); 440 | elseif ( !is_null( json_decode( $out ) ) && !$array ): 441 | $out = json_decode( $out, true ); 442 | endif; 443 | 444 | return $out; 445 | } 446 | 447 | /** 448 | * Description: 449 | * Helper function that just makes it easier to pass values into a function 450 | * and create an array result to be passed back to Alfred 451 | * 452 | * @param $uid - the uid of the result, should be unique 453 | * @param $arg - the argument that will be passed on 454 | * @param $title - The title of the result item 455 | * @param $sub - The subtitle text for the result item 456 | * @param $icon - the icon to use for the result item 457 | * @param $valid - sets whether the result item can be actioned 458 | * @param $auto - the autocomplete value for the result item 459 | * @return array - array item to be passed back to Alfred 460 | */ 461 | public function result( $uid, $arg, $title, $sub, $icon, $valid='yes', $auto=null, $type=null ) 462 | { 463 | $temp = array( 464 | 'uid' => $uid, 465 | 'arg' => $arg, 466 | 'title' => $title, 467 | 'subtitle' => $sub, 468 | 'icon' => $icon, 469 | 'valid' => $valid, 470 | 'autocomplete' => $auto, 471 | 'type' => $type 472 | ); 473 | 474 | if ( is_null( $type ) ): 475 | unset( $temp['type'] ); 476 | endif; 477 | 478 | array_push( $this->results, $temp ); 479 | 480 | return $temp; 481 | } 482 | 483 | } -------------------------------------------------------------------------------- /Workflow-Searcher/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Workflow-Searcher/ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C.png -------------------------------------------------------------------------------- /Workflow-Searcher/FileCache.php: -------------------------------------------------------------------------------- 1 | 7 | * @version 1.8.1 20120620 8 | */ 9 | 10 | final class FileCache 11 | { 12 | 13 | private static $_iscache = true; 14 | private static $_cachedir = '/tmp/'; 15 | private static $_cachetime = 3600; 16 | 17 | public static function get($key=false,$d=false) 18 | { 19 | if(empty($key) or !self::$_iscache) 20 | { 21 | return false; 22 | } 23 | $filename = self::get_filename($key,$d); 24 | if(!file_exists($filename)) 25 | { 26 | return false; 27 | } 28 | $data = file_get_contents($filename); 29 | $data = unserialize($data); 30 | $time = (int)$data['time']; 31 | $data = $data['data']; 32 | if($time>time()) 33 | { 34 | return $data; 35 | } 36 | else 37 | { 38 | return false; 39 | } 40 | } 41 | 42 | public static function set($key=false,$value=false,$t=0,$d=false) 43 | { 44 | if(empty($key) or !self::$_iscache) 45 | { 46 | return false; 47 | } 48 | $t = (int)$t ? (int)$t : self::$_cachetime; 49 | $filename = self::get_filename($key,$d); 50 | if(!self::is_mkdir(dirname($filename))) 51 | { 52 | return false; 53 | } 54 | $data['time'] = time()+$t; 55 | $data['data'] = $value; 56 | $data = serialize($data); 57 | if(PHP_VERSION >= '5') 58 | { 59 | file_put_contents($filename,$data); 60 | } 61 | else 62 | { 63 | $handle = fopen($filename,'wb'); 64 | fwrite($handle,$data); 65 | fclose($handle); 66 | } 67 | return true; 68 | } 69 | 70 | public static function un_set($key=false,$d=false) 71 | { 72 | if(empty($key)) 73 | { 74 | return false; 75 | } 76 | $filename = self::get_filename($key,$d); 77 | @unlink($filename); 78 | return true; 79 | } 80 | 81 | public static function get_filename($key=false,$d=false) 82 | { 83 | if(empty($key)) 84 | { 85 | return false; 86 | } 87 | $dir = empty($d) ? self::$_cachedir : $d ; 88 | $key_md5 = md5($key); 89 | $filename = rtrim($dir,'/').'/'.substr($key_md5,0,2).'/'.substr($key_md5,2,2).'/'.substr($key_md5,4,2).'/'.$key_md5; 90 | return $filename; 91 | } 92 | 93 | public static function is_mkdir($dir='') 94 | { 95 | if(empty($dir)) 96 | { 97 | return false; 98 | } 99 | if(!is_writable($dir)) 100 | { 101 | if(!@mkdir($dir,0777,true)) 102 | { 103 | return false; 104 | } 105 | } 106 | return true; 107 | } 108 | 109 | } 110 | 111 | ?> -------------------------------------------------------------------------------- /Workflow-Searcher/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Workflow-Searcher/default.png -------------------------------------------------------------------------------- /Workflow-Searcher/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/Workflow-Searcher/icon.png -------------------------------------------------------------------------------- /Workflow-Searcher/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.workflowsearcher.hzlzh 7 | connections 8 | 9 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 10 | 11 | 12 | destinationuid 13 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | 19 | 20 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 21 | 22 | 23 | destinationuid 24 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 25 | modifiers 26 | 1048576 27 | modifiersubtext 28 | ⌘ > Only copy the link to Clipboard! 29 | 30 | 31 | destinationuid 32 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 33 | modifiers 34 | 0 35 | modifiersubtext 36 | 37 | 38 | 39 | destinationuid 40 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 41 | modifiers 42 | 1048576 43 | modifiersubtext 44 | ⌘ > Only copy the link to Clipboard! 45 | 46 | 47 | destinationuid 48 | A97E7797-7E7A-43C6-BFCE-863F4C2B3B4A 49 | modifiers 50 | 0 51 | modifiersubtext 52 | 53 | 54 | 55 | destinationuid 56 | 5C0825B6-635B-478A-839C-3457CD7772BE 57 | modifiers 58 | 0 59 | modifiersubtext 60 | 61 | 62 | 63 | 64 | createdby 65 | hzlzh 66 | description 67 | Search workflows from AlfredWorkflow.com List API 68 | disabled 69 | 70 | name 71 | Workflow Searcher 72 | objects 73 | 74 | 75 | config 76 | 77 | lastpathcomponent 78 | 79 | onlyshowifquerypopulated 80 | 81 | output 82 | 0 83 | removeextension 84 | 85 | sticky 86 | 87 | text 88 | {query} 89 | title 90 | Download Link copied! 91 | 92 | type 93 | alfred.workflow.output.notification 94 | uid 95 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 96 | version 97 | 0 98 | 99 | 100 | config 101 | 102 | plusspaces 103 | 104 | url 105 | {query} 106 | utf8 107 | 108 | 109 | type 110 | alfred.workflow.action.openurl 111 | uid 112 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 113 | version 114 | 0 115 | 116 | 117 | config 118 | 119 | autopaste 120 | 121 | clipboardtext 122 | {query} 123 | 124 | type 125 | alfred.workflow.output.clipboard 126 | uid 127 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 128 | version 129 | 0 130 | 131 | 132 | config 133 | 134 | action 135 | 0 136 | argument 137 | 1 138 | hotkey 139 | 0 140 | hotmod 141 | 0 142 | leftcursor 143 | 144 | modsmode 145 | 0 146 | 147 | type 148 | alfred.workflow.trigger.hotkey 149 | uid 150 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 151 | version 152 | 0 153 | 154 | 155 | config 156 | 157 | argumenttype 158 | 0 159 | escaping 160 | 63 161 | keyword 162 | wf 163 | runningsubtext 164 | Wait, searching … … on AlfredWorkflow.com API 165 | script 166 | /* 167 | # Project Source 168 | 169 | * API: https://github.com/hzlzh/AlfredWorkflow.com 170 | 171 | * Github: https://github.com/hzlzh/Alfred-Workflows 172 | * Blog Post: https://zlz.im/Alfred-Workflows/ 173 | 174 | # Contact 175 | 176 | * hzlzh (hzlzh.dev@gmail.com) 177 | * Twitter: https://twitter.com/hzlzh 178 | */ 179 | require_once('workflows.php'); 180 | require_once('FileCache.php'); 181 | 182 | function load_data($api) { 183 | 184 | $opts = array( 185 | 'http'=>array( 186 | 'method'=>"GET", 187 | 'timeout'=>10 188 | ) 189 | ); 190 | $context = stream_context_create($opts); 191 | $obj = false; 192 | 193 | 194 | $fck = md5('api2'); 195 | $data = FileCache::get($fck); 196 | if(!$data) 197 | { 198 | $xml = @file_get_contents( $api,false, $context); 199 | $data = $xml; 200 | FileCache::set($fck,$data,86400); 201 | } 202 | $obj=json_decode($data); 203 | 204 | return $obj; 205 | } 206 | 207 | $wf = new Workflows(); 208 | 209 | $orig = "{query}"; 210 | 211 | 212 | date_default_timezone_set('Asia/Shanghai'); 213 | if($orig){ 214 | $obj = load_data('https://raw.github.com/hzlzh/AlfredWorkflow.com/master/workflow_api.json'); 215 | 216 | $int = 1; 217 | if($obj != null): 218 | foreach( $obj as $key => $item ): 219 | if(!stristr($item -> workflow_name, $orig) && !stristr($item -> workflow_description_small, $orig) && !stristr($item -> workflow_author_name, $orig)) continue; 220 | 221 | $workflow_name = $item -> workflow_name; 222 | $workflow_version = $item -> workflow_version; 223 | $workflow_description_small = $item -> workflow_description_small; 224 | $workflow_type = $item -> workflow_type; 225 | $workflow_release_page = $item -> workflow_release_page; 226 | $workflow_type = $item -> workflow_type; 227 | $workflow_author_name = $item -> workflow_author_name; 228 | $workflow_author_site = $item -> workflow_author_site; 229 | $workflow_download_link = $item -> workflow_download_link; 230 | $workflow_file = $item -> workflow_file; 231 | $workflow_screenshot = $item -> workflow_screenshot; 232 | 233 | $wf->result( $workflow_name, $workflow_download_link, '[v'.$workflow_version.'] '.$workflow_name . ' — @'.$workflow_author_name, $workflow_description_small, 'default.png' ); 234 | $int++; 235 | endforeach; 236 | endif; 237 | } 238 | 239 | $results = $wf->results(); 240 | if ( count( $results ) == 0 ): 241 | $wf->result( 'alfredworkflow_500', 'Please make sure your internet works well.', 'No response, try again!', 'Please make sure your internet works well.', 'icon.png' ); 242 | endif; 243 | 244 | echo $wf->toxml(); 245 | subtext 246 | The result is from AlfredWorkflow.com API 247 | title 248 | Input keyword to search workflows. 249 | type 250 | 1 251 | withspace 252 | 253 | 254 | type 255 | alfred.workflow.input.scriptfilter 256 | uid 257 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 258 | version 259 | 0 260 | 261 | 262 | config 263 | 264 | lastpathcomponent 265 | 266 | onlyshowifquerypopulated 267 | 268 | output 269 | 0 270 | removeextension 271 | 272 | sticky 273 | 274 | text 275 | Also backup download avaliable on AlfredWorkflow.com 276 | title 277 | Download Link copied! 278 | 279 | type 280 | alfred.workflow.output.notification 281 | uid 282 | A97E7797-7E7A-43C6-BFCE-863F4C2B3B4A 283 | version 284 | 0 285 | 286 | 287 | config 288 | 289 | autopaste 290 | 291 | clipboardtext 292 | {query} 293 | 294 | type 295 | alfred.workflow.output.clipboard 296 | uid 297 | 5C0825B6-635B-478A-839C-3457CD7772BE 298 | version 299 | 0 300 | 301 | 302 | readme 303 | # Project Source 304 | 305 | * Github: https://github.com/hzlzh/Alfred-Workflows 306 | * Blog Post: https://zlz.im/Alfred-Workflows/ 307 | 308 | # Contact 309 | 310 | * hzlzh (hzlzh.dev@gmail.com) 311 | * Twitter: https://twitter.com/hzlzh 312 | uidata 313 | 314 | 2B3CC67B-A963-4638-BFCA-A3FE12BA5587 315 | 316 | ypos 317 | 10 318 | 319 | 5781539F-3A42-4724-BE8A-AF9E749F1FDE 320 | 321 | ypos 322 | 200 323 | 324 | 5C0825B6-635B-478A-839C-3457CD7772BE 325 | 326 | ypos 327 | 380 328 | 329 | 64842A1D-75E7-4103-BD08-4DCB0AA137AE 330 | 331 | ypos 332 | 10 333 | 334 | 741DB4F2-5EC9-478D-8CBB-463E10EFC171 335 | 336 | ypos 337 | 140 338 | 339 | A97E7797-7E7A-43C6-BFCE-863F4C2B3B4A 340 | 341 | ypos 342 | 260 343 | 344 | ABD9DFE8-DA6B-4F46-AD34-4F6926FE883C 345 | 346 | ypos 347 | 200 348 | 349 | 350 | webaddress 351 | http://zlz.im/ 352 | 353 | 354 | -------------------------------------------------------------------------------- /Workflow-Searcher/remote.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.2, 3 | "download_uri": "https://raw.github.com/hzlzh/Alfred-Workflows/master/Downloads/Workflow-Searcher.alfredworkflow", 4 | "description": "Version number added." 5 | } 6 | -------------------------------------------------------------------------------- /Workflow-Searcher/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.2, 3 | "remote_json": "https://raw.github.com/hzlzh/Alfred-Workflows/master/Workflow-Searcher/remote.json" 4 | } 5 | -------------------------------------------------------------------------------- /Workflow-Searcher/workflows.php: -------------------------------------------------------------------------------- 1 | path = exec('pwd'); 31 | $this->home = exec('printf $HOME'); 32 | 33 | if ( file_exists( 'info.plist' ) ): 34 | $this->bundle = $this->get( 'bundleid', 'info.plist' ); 35 | endif; 36 | 37 | if ( !is_null( $bundleid ) ): 38 | $this->bundle = $bundleid; 39 | endif; 40 | 41 | $this->cache = $this->home. "/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/".$this->bundle; 42 | $this->data = $this->home. "/Library/Application Support/Alfred 2/Workflow Data/".$this->bundle; 43 | 44 | if ( !file_exists( $this->cache ) ): 45 | exec("mkdir '".$this->cache."'"); 46 | endif; 47 | 48 | if ( !file_exists( $this->data ) ): 49 | exec("mkdir '".$this->data."'"); 50 | endif; 51 | 52 | $this->results = array(); 53 | } 54 | 55 | /** 56 | * Description: 57 | * Accepts no parameter and returns the value of the bundle id for the current workflow. 58 | * If no value is available, then false is returned. 59 | * 60 | * @param none 61 | * @return false if not available, bundle id value if available. 62 | */ 63 | public function bundle() 64 | { 65 | if ( is_null( $this->bundle ) ): 66 | return false; 67 | else: 68 | return $this->bundle; 69 | endif; 70 | } 71 | 72 | /** 73 | * Description: 74 | * Accepts no parameter and returns the value of the path to the cache directory for your 75 | * workflow if it is available. Returns false if the value isn't available. 76 | * 77 | * @param none 78 | * @return false if not available, path to the cache directory for your workflow if available. 79 | */ 80 | public function cache() 81 | { 82 | if ( is_null( $this->bundle ) ): 83 | return false; 84 | else: 85 | if ( is_null( $this->cache ) ): 86 | return false; 87 | else: 88 | return $this->cache; 89 | endif; 90 | endif; 91 | } 92 | 93 | /** 94 | * Description: 95 | * Accepts no parameter and returns the value of the path to the storage directory for your 96 | * workflow if it is available. Returns false if the value isn't available. 97 | * 98 | * @param none 99 | * @return false if not available, path to the storage directory for your workflow if available. 100 | */ 101 | public function data() 102 | { 103 | if ( is_null( $this->bundle ) ): 104 | return false; 105 | else: 106 | if ( is_null( $this->data ) ): 107 | return false; 108 | else: 109 | return $this->data; 110 | endif; 111 | endif; 112 | } 113 | 114 | /** 115 | * Description: 116 | * Accepts no parameter and returns the value of the path to the current directory for your 117 | * workflow if it is available. Returns false if the value isn't available. 118 | * 119 | * @param none 120 | * @return false if not available, path to the current directory for your workflow if available. 121 | */ 122 | public function path() 123 | { 124 | if ( is_null( $this->path ) ): 125 | return false; 126 | else: 127 | return $this->path; 128 | endif; 129 | } 130 | 131 | /** 132 | * Description: 133 | * Accepts no parameter and returns the value of the home path for the current user 134 | * Returns false if the value isn't available. 135 | * 136 | * @param none 137 | * @return false if not available, home path for the current user if available. 138 | */ 139 | public function home() 140 | { 141 | if ( is_null( $this->home ) ): 142 | return false; 143 | else: 144 | return $this->home; 145 | endif; 146 | } 147 | 148 | /** 149 | * Description: 150 | * Returns an array of available result items 151 | * 152 | * @param none 153 | * @return array - list of result items 154 | */ 155 | public function results() 156 | { 157 | return $this->results; 158 | } 159 | 160 | /** 161 | * Description: 162 | * Convert an associative array into XML format 163 | * 164 | * @param $a - An associative array to convert 165 | * @param $format - format of data being passed (json or array), defaults to array 166 | * @return - XML string representation of the array 167 | */ 168 | public function toxml( $a=null, $format='array' ) { 169 | 170 | if ( $format == 'json' ): 171 | $a = json_decode( $a, TRUE ); 172 | endif; 173 | 174 | if ( is_null( $a ) && !empty( $this->results ) ): 175 | $a = $this->results; 176 | elseif ( is_null( $a ) && empty( $this->results ) ): 177 | return false; 178 | endif; 179 | 180 | $items = new SimpleXMLElement(""); // Create new XML element 181 | 182 | foreach( $a as $b ): // Lop through each object in the array 183 | $c = $items->addChild( 'item' ); // Add a new 'item' element for each object 184 | $c_keys = array_keys( $b ); // Grab all the keys for that item 185 | foreach( $c_keys as $key ): // For each of those keys 186 | if ( $key == 'uid' ): 187 | $c->addAttribute( 'uid', $b[$key] ); 188 | elseif ( $key == 'arg' ): 189 | $c->addAttribute( 'arg', $b[$key] ); 190 | elseif ( $key == 'type' ): 191 | $c->addAttribute( 'type', $b[$key] ); 192 | elseif ( $key == 'valid' ): 193 | if ( $b[$key] == 'yes' || $b[$key] == 'no' ): 194 | $c->addAttribute( 'valid', $b[$key] ); 195 | endif; 196 | elseif ( $key == 'autocomplete' ): 197 | $c->addAttribute( 'autocomplete', $b[$key] ); 198 | elseif ( $key == 'icon' ): 199 | if ( substr( $b[$key], 0, 9 ) == 'fileicon:' ): 200 | $val = substr( $b[$key], 9 ); 201 | $c->$key = $val; 202 | $c->$key->addAttribute( 'type', 'fileicon' ); 203 | elseif ( substr( $b[$key], 0, 9 ) == 'filetype:' ): 204 | $val = substr( $b[$key], 9 ); 205 | $c->$key = $val; 206 | $c->$key->addAttribute( 'type', 'filetype' ); 207 | else: 208 | $c->$key = $b[$key]; 209 | endif; 210 | else: 211 | $c->$key = $b[$key]; 212 | endif; 213 | endforeach; 214 | endforeach; 215 | 216 | return $items->asXML(); // Return XML string representation of the array 217 | 218 | } 219 | 220 | /** 221 | * Description: 222 | * Remove all items from an associative array that do not have a value 223 | * 224 | * @param $a - Associative array 225 | * @return bool 226 | */ 227 | private function empty_filter( $a ) { 228 | if ( $a == '' || $a == null ): // if $a is empty or null 229 | return false; // return false, else, return true 230 | else: 231 | return true; 232 | endif; 233 | } 234 | 235 | /** 236 | * Description: 237 | * Save values to a specified plist. If the first parameter is an associative 238 | * array, then the second parameter becomes the plist file to save to. If the 239 | * first parameter is string, then it is assumed that the first parameter is 240 | * the label, the second parameter is the value, and the third parameter is 241 | * the plist file to save the data to. 242 | * 243 | * @param $a - associative array of values to save 244 | * @param $b - the value of the setting 245 | * @param $c - the plist to save the values into 246 | * @return string - execution output 247 | */ 248 | public function set( $a=null, $b=null, $c=null ) 249 | { 250 | if ( is_array( $a ) ): 251 | if ( file_exists( $b ) ): 252 | $b = $this->path."/".$b; 253 | elseif ( file_exists( $this->data."/".$b ) ): 254 | $b = $this->data."/".$b; 255 | elseif ( file_exists( $this->cache."/".$b ) ): 256 | $b = $this->cache."/".$b; 257 | else: 258 | $b = $this->data."/".$b; 259 | endif; 260 | else: 261 | if ( file_exists( $c ) ): 262 | $c = $this->path."/".$c; 263 | elseif ( file_exists( $this->data."/".$c ) ): 264 | $c = $this->data."/".$c; 265 | elseif ( file_exists( $this->cache."/".$c ) ): 266 | $c = $this->cache."/".$c; 267 | else: 268 | $c = $this->data."/".$c; 269 | endif; 270 | endif; 271 | 272 | if ( is_array( $a ) ): 273 | foreach( $a as $k => $v ): 274 | exec( 'defaults write "'. $b .'" '. $k .' "'. $v .'"'); 275 | endforeach; 276 | else: 277 | exec( 'defaults write "'. $c .'" '. $a .' "'. $b .'"'); 278 | endif; 279 | } 280 | 281 | /** 282 | * Description: 283 | * Read a value from the specified plist 284 | * 285 | * @param $a - the value to read 286 | * @param $b - plist to read the values from 287 | * @return bool false if not found, string if found 288 | */ 289 | public function get( $a, $b ) { 290 | 291 | if ( file_exists( $b ) ): 292 | $b = $this->path."/".$b; 293 | elseif ( file_exists( $this->data."/".$b ) ): 294 | $b = $this->data."/".$b; 295 | elseif ( file_exists( $this->cache."/".$b ) ): 296 | $b = $this->cache."/".$b; 297 | else: 298 | return false; 299 | endif; 300 | 301 | exec( 'defaults read "'. $b .'" '.$a, $out ); // Execute system call to read plist value 302 | 303 | if ( $out == "" ): 304 | return false; 305 | endif; 306 | 307 | $out = $out[0]; 308 | return $out; // Return item value 309 | } 310 | 311 | /** 312 | * Description: 313 | * Read data from a remote file/url, essentially a shortcut for curl 314 | * 315 | * @param $url - URL to request 316 | * @param $options - Array of curl options 317 | * @return result from curl_exec 318 | */ 319 | public function request( $url=null, $options=null ) 320 | { 321 | if ( is_null( $url ) ): 322 | return false; 323 | endif; 324 | 325 | $defaults = array( // Create a list of default curl options 326 | CURLOPT_RETURNTRANSFER => true, // Returns the result as a string 327 | CURLOPT_URL => $url, // Sets the url to request 328 | CURLOPT_FRESH_CONNECT => true 329 | ); 330 | 331 | if ( $options ): 332 | foreach( $options as $k => $v ): 333 | $defaults[$k] = $v; 334 | endforeach; 335 | endif; 336 | 337 | array_filter( $defaults, // Filter out empty options from the array 338 | array( $this, 'empty_filter' ) ); 339 | 340 | $ch = curl_init(); // Init new curl object 341 | curl_setopt_array( $ch, $defaults ); // Set curl options 342 | $out = curl_exec( $ch ); // Request remote data 343 | $err = curl_error( $ch ); 344 | curl_close( $ch ); // End curl request 345 | 346 | if ( $err ): 347 | return $err; 348 | else: 349 | return $out; 350 | endif; 351 | } 352 | 353 | /** 354 | * Description: 355 | * Allows searching the local hard drive using mdfind 356 | * 357 | * @param $query - search string 358 | * @return array - array of search results 359 | */ 360 | public function mdfind( $query ) 361 | { 362 | exec('mdfind "'.$query.'"', $results); 363 | return $results; 364 | } 365 | 366 | /** 367 | * Description: 368 | * Accepts data and a string file name to store data to local file as cache 369 | * 370 | * @param array - data to save to file 371 | * @param file - filename to write the cache data to 372 | * @return none 373 | */ 374 | public function write( $a, $b ) 375 | { 376 | if ( file_exists( $b ) ): 377 | $b = $this->path."/".$b; 378 | elseif ( file_exists( $this->data."/".$b ) ): 379 | $b = $this->data."/".$b; 380 | elseif ( file_exists( $this->cache."/".$b ) ): 381 | $b = $this->cache."/".$b; 382 | else: 383 | $b = $this->data."/".$b; 384 | endif; 385 | 386 | if ( is_array( $a ) ): 387 | $a = json_encode( $a ); 388 | file_put_contents( $b, $a ); 389 | return true; 390 | elseif ( is_string( $a ) ): 391 | file_put_contents( $b, $a ); 392 | return true; 393 | else: 394 | return false; 395 | endif; 396 | } 397 | 398 | /** 399 | * Description: 400 | * Returns data from a local cache file 401 | * 402 | * @param file - filename to read the cache data from 403 | * @return false if the file cannot be found, the file data if found. If the file 404 | * format is json encoded, then a json object is returned. 405 | */ 406 | public function read( $a ) 407 | { 408 | if ( file_exists( $a ) ): 409 | $a = $this->path."/".$a; 410 | elseif ( file_exists( $this->data."/".$a ) ): 411 | $a = $this->data."/".$a; 412 | elseif ( file_exists( $this->cache."/".$a ) ): 413 | $a = $this->cache."/".$a; 414 | else: 415 | return false; 416 | endif; 417 | 418 | $out = file_get_contents( $a ); 419 | if ( !is_null( json_decode( $out ) ) ): 420 | $out = json_decode( $out ); 421 | endif; 422 | 423 | return $out; 424 | } 425 | 426 | /** 427 | * Description: 428 | * Helper function that just makes it easier to pass values into a function 429 | * and create an array result to be passed back to Alfred 430 | * 431 | * @param $uid - the uid of the result, should be unique 432 | * @param $arg - the argument that will be passed on 433 | * @param $title - The title of the result item 434 | * @param $sub - The subtitle text for the result item 435 | * @param $icon - the icon to use for the result item 436 | * @param $valid - sets whether the result item can be actioned 437 | * @param $auto - the autocomplete value for the result item 438 | * @return array - array item to be passed back to Alfred 439 | */ 440 | public function result( $uid, $arg, $title, $sub, $icon, $valid='yes', $auto=null, $type=null ) 441 | { 442 | $temp = array( 443 | 'uid' => $uid, 444 | 'arg' => $arg, 445 | 'title' => $title, 446 | 'subtitle' => $sub, 447 | 'icon' => $icon, 448 | 'valid' => $valid, 449 | 'autocomplete' => $auto, 450 | 'type' => $type 451 | ); 452 | 453 | if ( is_null( $type ) ): 454 | unset( $temp['type'] ); 455 | endif; 456 | 457 | array_push( $this->results, $temp ); 458 | 459 | return $temp; 460 | } 461 | 462 | } -------------------------------------------------------------------------------- /XAMPP-Control/README.md: -------------------------------------------------------------------------------- 1 | # Alfred-Extensions 2 | 3 | Make your Alfred more powerful. 4 | 5 | * * * 6 | 7 | ![XAMPP Control Logo][1] 8 | 9 | **XAMPP-Control** *(v1.1)* - [download here][2] 10 | 11 | Start/Stop Apache & MySQL & FTP of XAMPP in Alfred with PowerPack. From now on you will be no longer launch XAMPP in your Dock continually. 12 | 13 | *Note:* # Note: You may need to input your admin **ROOT** password just once when using this extension. To reset your **ROOT** password just run `xampp root` 14 | 15 | run `xampp {query}` from the command chart below. 16 | 17 | start Start XAMPP (Apache, MySQL and eventually others) 18 | startapache Start only Apache 19 | startmysql Start only MySQL 20 | startftp Start only ProFTPD 21 | 22 | stop Stop XAMPP (Apache, MySQL and eventually others) 23 | stopapache Stop only Apache 24 | stopmysql Stop only MySQL 25 | stopftp Stop only ProFTPD 26 | 27 | reload Reload XAMPP (Apache, MySQL and eventually others) 28 | reloadapache Reload only Apache 29 | reloadmysql Reload only MySQL 30 | reloadftp Reload only ProFTPD 31 | 32 | restart Stop and start XAMPP 33 | security Check XAMPP's security 34 | 35 | enablessl Enable SSL support for Apache 36 | disablessl Disable SSL support for Apache 37 | 38 | backup Make backup file of your XAMPP config, log and data files 39 | 40 | fix_rights Resets file permissions. 41 | 42 | 43 | ![XAMPP Control Screenshot][3] 44 | 45 | * * * 46 | 47 | Release Note 48 | 49 | `v1.1` 50 | 51 | * Authenticate.app supported & root password auto-saved 52 | * Extension Updater supported 53 | 54 | [1]: https://github.com/hzlzh/Alfred-Extensions/raw/master/XAMPP-Control/icon.png "XAMPP Control for Alfred Logo" 55 | [2]: https://github.com/hzlzh/Alfred-Extensions/raw/master/XAMPP-Control.alfredextension "XAMPP Control Download Link" 56 | [3]: https://github.com/hzlzh/Alfred-Extensions/raw/master/XAMPP-Control/screenshot.png "XAMPP Control for Alfred Screenshot" -------------------------------------------------------------------------------- /XAMPP-Control/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/XAMPP-Control/icon.png -------------------------------------------------------------------------------- /XAMPP-Control/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | action 6 | 7 | category 8 | SCRIPTS 9 | command 10 | # Note: You may need to input your ROOT password just once when using this extension. 11 | # To reset your ROOT password just run `xampp root` 12 | 13 | # start Start XAMPP (Apache, MySQL and eventually others) 14 | # startapache Start only Apache 15 | # startmysql Start only MySQL 16 | # startftp Start only ProFTPD 17 | 18 | # stop Stop XAMPP (Apache, MySQL and eventually others) 19 | # stopapache Stop only Apache 20 | # stopmysql Stop only MySQL 21 | # stopftp Stop only ProFTPD 22 | 23 | # reload Reload XAMPP (Apache, MySQL and eventually others) 24 | # reloadapache Reload only Apache 25 | # reloadmysql Reload only MySQL 26 | # reloadftp Reload only ProFTPD 27 | 28 | # restart Stop and start XAMPP 29 | # security Check XAMPP's security 30 | 31 | # enablessl Enable SSL support for Apache 32 | # disablessl Disable SSL support for Apache 33 | 34 | # backup Make backup file of your XAMPP config, log and data files 35 | 36 | # fix_rights Resets file permissions. 37 | INPUT=`echo "{query}" | tr A-Z a-z` 38 | 39 | PASS=$(Authenticate.app/Contents/MacOS/Authenticate -get password) 40 | if [ $PASS = '' ] || [ $INPUT = 'root' ] 41 | then 42 | Authenticate.app/Contents/MacOS/Authenticate 43 | else 44 | PASS =$(Authenticate.app/Contents/MacOS/Authenticate -get password) 45 | echo "Load Admin password successfully!" 46 | echo $PASS | sudo -S sh -c "/Applications/XAMPP/xamppfiles/xampp {query}" 47 | fi 48 | disabled 49 | 50 | escapedollar 51 | 52 | escapequery 53 | 54 | escapequerybackquotes 55 | 56 | escapequerybrackets 57 | 58 | escapequeryquotes 59 | 60 | escapequerysemicolons 61 | 62 | growloutput 63 | 64 | growloutputsticky 65 | 66 | keyword 67 | xampp 68 | logging 69 | 70 | multifileargs 71 | 72 | parameter 73 | 3 74 | silent 75 | 76 | subtitle 77 | Start/Stop Apache & MySQL & FTP of XAMPP in Alfred. 78 | title 79 | XAMPP-Control 80 | 81 | 82 | -------------------------------------------------------------------------------- /XAMPP-Control/kudos.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | creator 6 | hzlzh 7 | website 8 | http://zlz.im/alfred-extension-xampp-control/ 9 | 10 | 11 | -------------------------------------------------------------------------------- /XAMPP-Control/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzlzh/Alfred-Workflows/9e98c13f195ec27243bfbd4f2db2ac84a3ad5fe8/XAMPP-Control/screenshot.png -------------------------------------------------------------------------------- /XAMPP-Control/update.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.1 4 | https://raw.github.com/hzlzh/Alfred-Extensions/master/XAMPP-Control/version.xml 5 | -------------------------------------------------------------------------------- /XAMPP-Control/version.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.1 4 | https://github.com/hzlzh/Alfred-Extensions/raw/master/XAMPP-Control.alfredextension 5 | #Authenticate.app supported + root password auto-saved #Extension Updater supported 6 | --------------------------------------------------------------------------------