├── .gitignore ├── .gitattributes ├── .travis.yml ├── icon.png ├── movie.png ├── openThunder.scpt ├── 48243082-22E2-45D4-ACF6-290FA6AFAD95.png ├── 6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903.png ├── .yo-rc.json ├── .editorconfig ├── thunder.js ├── index.js ├── index_name.js ├── readme.md ├── package.json ├── license └── info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.js text eol=lf 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '6' 4 | - '4' 5 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TalkWIthKeyboard/moogle/HEAD/icon.png -------------------------------------------------------------------------------- /movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TalkWIthKeyboard/moogle/HEAD/movie.png -------------------------------------------------------------------------------- /openThunder.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TalkWIthKeyboard/moogle/HEAD/openThunder.scpt -------------------------------------------------------------------------------- /48243082-22E2-45D4-ACF6-290FA6AFAD95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TalkWIthKeyboard/moogle/HEAD/48243082-22E2-45D4-ACF6-290FA6AFAD95.png -------------------------------------------------------------------------------- /6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TalkWIthKeyboard/moogle/HEAD/6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903.png -------------------------------------------------------------------------------- /.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-alfred": { 3 | "promptValues": { 4 | "githubUsername": "TalkWithKeyboard", 5 | "website": "http://sw77.live" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{package.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /thunder.js: -------------------------------------------------------------------------------- 1 | const cp = require('child_process') 2 | const path = require('path') 3 | const alfy = require('alfy') 4 | 5 | try { 6 | cp.spawnSync('pbcopy', { 7 | encoding: 'utf8', 8 | input: alfy.input, 9 | }) 10 | cp.execSync(`/usr/bin/osascript ${path.join(__dirname, 'openThunder.scpt')}`) 11 | } catch (err) { 12 | console.log(err) 13 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const alfy = require('alfy') 2 | 3 | const latestUri = '122.152.219.33:5000/latest' 4 | 5 | alfy.fetch(latestUri).then(data => { 6 | const items = [] 7 | for (let index = 0; index < data.length; index += 1) { 8 | if (data[index]) { 9 | items.push({ 10 | title: data[index].name, 11 | subtitle: data[index].introduction, 12 | arg: data[index].uri, 13 | icon: { 14 | path: "" 15 | } 16 | }) 17 | } 18 | } 19 | alfy.output(items) 20 | }) 21 | -------------------------------------------------------------------------------- /index_name.js: -------------------------------------------------------------------------------- 1 | const alfy = require('alfy') 2 | const urlencode = require('urlencode') 3 | 4 | let name = alfy.input 5 | const latestUri = '122.152.219.33:5000/search?name=' + urlencode(name) 6 | 7 | alfy.fetch(latestUri).then(data => { 8 | const items = [] 9 | for (let index = 0; index < data.length; index += 1) { 10 | if (data[index]) { 11 | items.push({ 12 | title: data[index].name, 13 | subtitle: data[index].introduction, 14 | arg: data[index].uri, 15 | icon: { 16 | path: "" 17 | } 18 | }) 19 | } 20 | } 21 | alfy.output(items) 22 | }) 23 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # alfred-moogle [![Build Status](https://travis-ci.org/TalkWithKeyboard/alfred-moogle.svg?branch=master)](https://travis-ci.org/TalkWithKeyboard/alfred-moogle) 2 | 3 | > The workflow tool in alfred 3 to search and download movies. 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --global alfred-moogle 10 | ``` 11 | 12 | **Require:** 13 | 14 | + `NodeJS` > 4.0 15 | + `Alfred` 3.0 16 | + 低版本 `Thunder for Mac`,推荐 [3.0.1](http://down.sandai.net/mac/thunder_dl3.0.1.2548_Beta.dmg) 17 | 18 | 19 | ## Usage 20 | 21 | 打开 `Alfred`: 22 | 23 | + 输入 `mla` 显示最近的热门电影 24 | + 输入 `mna` 加上电影名字(或关键词),显示所有符合条件的电影 25 | 26 | 选中后回车,会自动打开迅雷,并复制好链接 27 | 28 | ![mla](http://oj7mt8loy.bkt.clouddn.com/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-05-20%20%E4%B8%8B%E5%8D%8811.55.07.png) 29 | 30 | ![mna](http://oj7mt8loy.bkt.clouddn.com/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-05-20%20%E4%B8%8B%E5%8D%8811.55.32.png) 31 | 32 | ## License 33 | 34 | MIT © [Wei Song](http://sw77.live) 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "alfred-moogle", 3 | "version": "3.1.0", 4 | "description": "The workflow tool in alfred 3 to search and download movies.", 5 | "license": "MIT", 6 | "repository": "TalkWithKeyboard/moogle", 7 | "author": { 8 | "name": "Wei Song", 9 | "email": "songwei@ruguoapp.com", 10 | "url": "sw77.live" 11 | }, 12 | "engines": { 13 | "node": ">=4" 14 | }, 15 | "scripts": { 16 | "test": "xo && ava", 17 | "postinstall": "alfy-init", 18 | "preuninstall": "alfy-cleanup" 19 | }, 20 | "files": [ 21 | "index.js", 22 | "index_name.js", 23 | "openThunder.scpt", 24 | "icon.png", 25 | "info.plist", 26 | "thunder.js", 27 | "6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903.png", 28 | "48243082-22E2-45D4-ACF6-290FA6AFAD95.png" 29 | ], 30 | "keywords": [ 31 | "alfred", 32 | "workflow", 33 | "alfy" 34 | ], 35 | "dependencies": { 36 | "alfy": "^0.6.0", 37 | "jxa": "^2.0.3", 38 | "urlencode": "^1.1.0" 39 | }, 40 | "devDependencies": { 41 | "alfy-test": "^0.3.0", 42 | "ava": "^0.18.0", 43 | "xo": "^0.17.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Wei Song (sw77.live) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | live.sw77.moogle 7 | category 8 | Tools 9 | connections 10 | 11 | 48243082-22E2-45D4-ACF6-290FA6AFAD95 12 | 13 | 14 | destinationuid 15 | 5D1AD2CA-4D19-491F-94C4-94639C56F4A0 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | 5D1AD2CA-4D19-491F-94C4-94639C56F4A0 25 | 26 | 6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903 27 | 28 | 29 | destinationuid 30 | 5D1AD2CA-4D19-491F-94C4-94639C56F4A0 31 | modifiers 32 | 0 33 | modifiersubtext 34 | 35 | vitoclose 36 | 37 | 38 | 39 | 40 | createdby 41 | Wei Song 42 | description 43 | Search and download movies. 44 | disabled 45 | 46 | name 47 | moogle 48 | objects 49 | 50 | 51 | config 52 | 53 | concurrently 54 | 55 | escaping 56 | 102 57 | script 58 | ./node_modules/.bin/run-node thunder.js "$1" 59 | scriptargtype 60 | 1 61 | scriptfile 62 | 63 | type 64 | 0 65 | 66 | type 67 | alfred.workflow.action.script 68 | uid 69 | 5D1AD2CA-4D19-491F-94C4-94639C56F4A0 70 | version 71 | 2 72 | 73 | 74 | config 75 | 76 | alfredfiltersresults 77 | 78 | alfredfiltersresultsmatchmode 79 | 0 80 | argumenttrimmode 81 | 0 82 | argumenttype 83 | 0 84 | escaping 85 | 102 86 | keyword 87 | mna 88 | queuedelaycustom 89 | 3 90 | queuedelayimmediatelyinitially 91 | 92 | queuedelaymode 93 | 0 94 | queuemode 95 | 2 96 | runningsubtext 97 | Searching... 98 | script 99 | ./node_modules/.bin/run-node index_name.js "$1" 100 | scriptargtype 101 | 1 102 | scriptfile 103 | index.js 104 | subtext 105 | 106 | title 107 | 通过电影名字进行搜索 108 | type 109 | 0 110 | withspace 111 | 112 | 113 | type 114 | alfred.workflow.input.scriptfilter 115 | uid 116 | 6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903 117 | version 118 | 2 119 | 120 | 121 | config 122 | 123 | alfredfiltersresults 124 | 125 | alfredfiltersresultsmatchmode 126 | 0 127 | argumenttrimmode 128 | 0 129 | argumenttype 130 | 2 131 | escaping 132 | 102 133 | keyword 134 | mla 135 | queuedelaycustom 136 | 3 137 | queuedelayimmediatelyinitially 138 | 139 | queuedelaymode 140 | 0 141 | queuemode 142 | 2 143 | runningsubtext 144 | Searching... 145 | script 146 | ./node_modules/.bin/run-node index.js "$1" 147 | scriptargtype 148 | 1 149 | scriptfile 150 | index.js 151 | subtext 152 | 153 | title 154 | 最近的热门电影 155 | type 156 | 0 157 | withspace 158 | 159 | 160 | type 161 | alfred.workflow.input.scriptfilter 162 | uid 163 | 48243082-22E2-45D4-ACF6-290FA6AFAD95 164 | version 165 | 2 166 | 167 | 168 | readme 169 | 170 | uidata 171 | 172 | 48243082-22E2-45D4-ACF6-290FA6AFAD95 173 | 174 | xpos 175 | 270 176 | ypos 177 | 280 178 | 179 | 5D1AD2CA-4D19-491F-94C4-94639C56F4A0 180 | 181 | xpos 182 | 490 183 | ypos 184 | 110 185 | 186 | 6B1E26C6-0BD9-4EEA-B530-8A94CE6BB903 187 | 188 | xpos 189 | 270 190 | ypos 191 | 110 192 | 193 | 194 | version 195 | 3.0.0 196 | webaddress 197 | https://github.com/TalkWithKeyboard/moogle#readme 198 | 199 | 200 | --------------------------------------------------------------------------------