├── .gitignore
├── LICENSE
├── README.md
└── src
├── .DS_Store
├── icon.png
├── images
├── bus.png
├── circle_green.png
├── circle_grey.png
├── cross_mark.png
├── face_with_thermometer.png
├── house_with_garden.png
├── palm_tree.png
└── spiral_calendar.png
├── info.plist
├── public
├── assets
│ ├── img
│ │ ├── alfred.png
│ │ └── slack.png
│ ├── script.js
│ └── style.css
└── index.html
└── scripts
├── composer.json
├── composer.lock
├── composer.phar
├── config
├── emojis.json
└── routes.php
├── controllers
├── ChannelController.php
├── ConfigController.php
├── Controller.php
└── SlackController.php
├── helpers
├── core
│ └── CustomCommander.php
├── http
│ └── MultiCurlInteractor.php
└── service
│ ├── MultiTeamSlackService.php
│ ├── SingleTeamSlackService.php
│ └── SlackServiceInterface.php
├── index.php
├── libs
├── Bootstrap.php
├── Emoji.php
├── Query.php
├── Route.php
├── Router.php
├── SlackRouter.php
├── Utils.php
└── Workflows.php
└── models
├── AuthModel.php
├── ChannelModel.php
├── ChatInterface.php
├── FileModel.php
├── GroupModel.php
├── ImModel.php
├── MessageModel.php
├── Model.php
├── ModelFactory.php
├── StatusModel.php
└── UserModel.php
/.gitignore:
--------------------------------------------------------------------------------
1 | src/scripts/vendor/
2 | src/.idea
3 | .idea
4 | Slack.alfredworkflow
5 | .DS_Store
6 | src/cache/
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | alfred-slack
2 | ============
3 |
4 | [](https://gitter.im/yannickglt/alfred-slack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
5 |
6 | Open conversation with a contact in Slack
7 |
8 | # To start
9 | 1. Download and install [Slack.alfredworkflow](https://github.com/packal/repository/raw/master/com.yannickglt.alfred2.slack/slack.alfredworkflow)
10 | 2. Create a custom app for your team following [these steps](#create-an-app-for-your-team).
11 | 3. Once you have your client ID and Secret, visit the address [https://yannickglt.github.io/alfred-slack/](https://yannickglt.github.io/alfred-slack/) to generate a unique code for authentication in the Workflow.
12 |
13 | 1. Enter your team name in the first field and your client ID in the second one, then click on the button "Generate code".
14 |
15 | 
16 |
17 | 2. Authorize the app to access your Slack team with the rights below.
18 |
19 | 
20 |
21 | 3. Copy your generated unique code in your clipboard.
22 |
23 | 
24 |
25 | 4. Launch the slack workflow with the parameter `--add-client` followed by the concatenation of the generated unique code and client Secret separated by a colon (e.g.: `UNIQUE_CODE:CLIENT_SECRET`).
26 | You can add several clients if you want to collaborate with several teams. You just need to repeat the two last steps.
27 |
28 | Example:
29 | ```
30 | slack --add-client 1234567890.123456789012|1234567890.123456789012.abcdef1234:1234567890abcdef1234567890abcdef
31 | ```
32 | 5. Launch the cache refresh by taping the command `--refresh`.
33 |
34 | Example:
35 | ```
36 | slack --refresh
37 | ```
38 | **The cache refresh may take up to several minutes depending on your organization size.**
39 |
40 | 6. Enjoy!
41 |
42 | Note: install the [Packal Updater](http://www.packal.org/workflow/packal-updater) workflow if you want automatic updates.
43 |
44 | # How to use
45 | - List channels or groups to open in the Slack app:
46 |
47 | ```
48 | slack
49 | ```
50 | 
51 |
52 |
53 | - List users to open in the Slack app:
54 |
55 | ```
56 | slack
57 | ```
58 | 
59 |
60 | - Open a channel, group or user in the Slack app:
61 |
62 | ```
63 | slack
64 | ```
65 | 
66 |
67 | - List messages from a specific channel, group or user:
68 |
69 | ```
70 | slack
71 | ```
72 | 
73 |
74 | - Send a message to a channel, group or user:
75 |
76 | ```
77 | slack
78 | ```
79 | 
80 |
81 | - Mark all channels as read
82 |
83 | ```
84 | slack --mark
85 | ```
86 |
87 | - List the files within the team
88 |
89 | ```
90 | slack --files
91 | ```
92 |
93 | - List the items starred
94 |
95 | ```
96 | slack --stars
97 | ```
98 |
99 | - Search both messages and files
100 |
101 | ```
102 | slack --search
103 | ```
104 |
105 | - Set the user presence (either active or away)
106 |
107 | ```
108 | slack --presence
109 | ```
110 |
111 | - Set the custom status
112 |
113 | ```
114 | slack --status
115 | ```
116 |
117 | ### Create an app for your team
118 | 1. Go to the URL [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and click on the button `Create a Slack app`.
119 |
120 | 
121 |
122 | 2. Give it an app name e.g.: "Alfred Workflow", select your team in the list and click on the button `Create App`.
123 |
124 | 
125 |
126 | 3. Note the client ID and Secret!
127 |
128 | 
129 |
130 | > :warning: Never share the client secret on the web or on public repository
131 |
132 | 4. Go to the section OAuth & Permissions (under the Features category), add the two redirect URLs `http://yannickglt.github.io/alfred-slack/` and `https://yannickglt.github.io/alfred-slack/` and click on `Save URLs`.
133 |
134 | 
135 |
--------------------------------------------------------------------------------
/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/.DS_Store
--------------------------------------------------------------------------------
/src/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/icon.png
--------------------------------------------------------------------------------
/src/images/bus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/bus.png
--------------------------------------------------------------------------------
/src/images/circle_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/circle_green.png
--------------------------------------------------------------------------------
/src/images/circle_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/circle_grey.png
--------------------------------------------------------------------------------
/src/images/cross_mark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/cross_mark.png
--------------------------------------------------------------------------------
/src/images/face_with_thermometer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/face_with_thermometer.png
--------------------------------------------------------------------------------
/src/images/house_with_garden.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/house_with_garden.png
--------------------------------------------------------------------------------
/src/images/palm_tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/palm_tree.png
--------------------------------------------------------------------------------
/src/images/spiral_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/images/spiral_calendar.png
--------------------------------------------------------------------------------
/src/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bundleid
6 | com.yannickglt.alfred2.slack
7 | category
8 | Productivity
9 | connections
10 |
11 | BE4D4090-FF1C-4FF4-849C-958AFD57A03F
12 |
13 |
14 | destinationuid
15 | 43648B07-3CF9-4E47-B15C-042D2EABCDDB
16 | modifiers
17 | 0
18 | modifiersubtext
19 |
20 | vitoclose
21 |
22 |
23 |
24 | slack
25 |
26 |
27 | destinationuid
28 | BE4D4090-FF1C-4FF4-849C-958AFD57A03F
29 | modifiers
30 | 0
31 | modifiersubtext
32 |
33 | vitoclose
34 |
35 |
36 |
37 |
38 | createdby
39 | Yannick Galatol
40 | description
41 | Interact with slack through Alfred
42 | disabled
43 |
44 | name
45 | Slack
46 | objects
47 |
48 |
49 | config
50 |
51 | lastpathcomponent
52 |
53 | onlyshowifquerypopulated
54 |
55 | removeextension
56 |
57 | text
58 |
59 | title
60 | {query}
61 |
62 | type
63 | alfred.workflow.output.notification
64 | uid
65 | 43648B07-3CF9-4E47-B15C-042D2EABCDDB
66 | version
67 | 1
68 |
69 |
70 | config
71 |
72 | alfredfiltersresults
73 |
74 | alfredfiltersresultsmatchmode
75 | 0
76 | argumenttreatemptyqueryasnil
77 |
78 | argumenttrimmode
79 | 0
80 | argumenttype
81 | 0
82 | escaping
83 | 68
84 | keyword
85 | slack
86 | queuedelaycustom
87 | 3
88 | queuedelayimmediatelyinitially
89 |
90 | queuedelaymode
91 | 0
92 | queuemode
93 | 2
94 | runningsubtext
95 | Loading...
96 | script
97 | $query = "{query}";
98 | $input = true;
99 | require_once 'scripts/index.php';
100 |
101 | scriptargtype
102 | 0
103 | scriptfile
104 |
105 | subtext
106 | Slack workflow
107 | title
108 | Slack Workflow
109 | type
110 | 1
111 | withspace
112 |
113 |
114 | type
115 | alfred.workflow.input.scriptfilter
116 | uid
117 | slack
118 | version
119 | 3
120 |
121 |
122 | config
123 |
124 | concurrently
125 |
126 | escaping
127 | 68
128 | script
129 | $input = false;
130 | $query = "{query}";
131 | require_once 'scripts/index.php';
132 | scriptargtype
133 | 0
134 | scriptfile
135 |
136 | type
137 | 1
138 |
139 | type
140 | alfred.workflow.action.script
141 | uid
142 | BE4D4090-FF1C-4FF4-849C-958AFD57A03F
143 | version
144 | 2
145 |
146 |
147 | readme
148 |
149 | uidata
150 |
151 | 43648B07-3CF9-4E47-B15C-042D2EABCDDB
152 |
153 | xpos
154 | 700
155 | ypos
156 | 10
157 |
158 | BE4D4090-FF1C-4FF4-849C-958AFD57A03F
159 |
160 | xpos
161 | 500
162 | ypos
163 | 10
164 |
165 | slack
166 |
167 | xpos
168 | 300
169 | ypos
170 | 10
171 |
172 |
173 | variablesdontexport
174 |
175 | version
176 | 4.2.2
177 | webaddress
178 | https://github.com/yannickglt/alfred-slack
179 |
180 |
181 |
--------------------------------------------------------------------------------
/src/public/assets/img/alfred.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/public/assets/img/alfred.png
--------------------------------------------------------------------------------
/src/public/assets/img/slack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yannickglt/alfred-slack/197d1c2ac9e170e7e1e9312a7b06517e1594e914/src/public/assets/img/slack.png
--------------------------------------------------------------------------------
/src/public/assets/script.js:
--------------------------------------------------------------------------------
1 | (function (window) {
2 |
3 | var REDIRECT_URI = 'https://yannickglt.github.io/alfred-slack/';
4 | var SCOPE = [
5 | 'channels:history',
6 | 'channels:write',
7 | 'channels:read',
8 | 'chat:write:bot',
9 | 'chat:write:user',
10 | 'groups:history',
11 | 'groups:read',
12 | 'groups:write',
13 | 'files:read',
14 | 'files:write:user',
15 | 'im:history',
16 | 'im:read',
17 | 'im:write',
18 | 'search:read',
19 | 'stars:read',
20 | 'team:read',
21 | 'users.profile:write',
22 | 'users:read',
23 | 'users:write'
24 | ];
25 | var OAUTH_URL = 'https://slack.com/oauth/authorize?client_id=__CLIENT_ID__&scope=__SCOPE__&team=__TEAM__&redirect_uri=__REDIRECT_URI__';
26 |
27 | window.addEventListener('load', function () {
28 |
29 | var step = (getParameterByName('code') !== null) ? 2 : 1;
30 | if (step === 1) {
31 | document.getElementById('step-1').style.display = 'block';
32 | document.getElementById('step-2').style.display = 'none';
33 | } else {
34 | document.getElementById('step-1').style.display = 'none';
35 | document.getElementById('step-2').style.display = 'block';
36 | fillCode();
37 | }
38 |
39 | var clipboard = new Clipboard('#code-btn');
40 | clipboard.on('success', function (e) {
41 | e.clearSelection();
42 | showTooltip(e.trigger, 'Copied!');
43 | });
44 | document
45 | .getElementById('code-btn')
46 | .addEventListener('mouseleave', function (e) {
47 | e.currentTarget.setAttribute('class', 'btn');
48 | e.currentTarget.removeAttribute('aria-label');
49 | });
50 | });
51 |
52 | function showTooltip(elem, msg) {
53 | elem.setAttribute('class', 'btn tooltipped tooltipped-s');
54 | elem.setAttribute('aria-label', msg);
55 | }
56 |
57 | function generateCode() {
58 | var team = document.getElementById('team').value.toLowerCase();
59 | var clientId = document.getElementById('client_id').value;
60 | var redirectUrl = encodeURIComponent(REDIRECT_URI + '?client_id=' + clientId);
61 | var scope = encodeURIComponent(SCOPE.join(' '));
62 | var url = OAUTH_URL.replace(/__TEAM__/g, team).replace(/__CLIENT_ID__/g, clientId).replace(/__REDIRECT_URI__/g, redirectUrl).replace(/__SCOPE__/g, scope);
63 | window.open(url, '_self');
64 | }
65 |
66 | function fillCode() {
67 | var code = getParameterByName('client_id') + '|' + getParameterByName('code');
68 | document.getElementById('code').value = code;
69 | }
70 |
71 | function getParameterByName(name, url) {
72 | if (!url) {
73 | url = window.location.href;
74 | }
75 | name = name.replace(/[\[\]]/g, '\\$&');
76 | var regex = new RegExp('[?&]' + name + '(=([^]*)|&|#|$)'),
77 | results = regex.exec(url);
78 | if (!results) {
79 | return null;
80 | }
81 | if (!results[2]) {
82 | return '';
83 | }
84 | return decodeURIComponent(results[2].replace(/\+/g, ' '));
85 | }
86 |
87 | window.alfredSlack = {
88 | generateCode: generateCode
89 | };
90 |
91 | })(window);
92 |
--------------------------------------------------------------------------------
/src/public/assets/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: 'Open Sans', sans-serif;
4 | }
5 |
6 | .container {
7 | background-color: #9b59b6;
8 | background-image: linear-gradient(to bottom, #8e44ad 0, #9b59b6 100%);
9 | padding: 100px 0;
10 | }
11 |
12 | h1 {
13 | color: white;
14 | font-weight: normal;
15 | font-size: 70px;
16 | text-align: center;
17 | margin-bottom: 30px;
18 | }
19 |
20 | .images {
21 | text-align: center;
22 | margin: 20px 0;
23 | }
24 |
25 | .images img {
26 | width: 80px;
27 | background-color: white;
28 | padding: 30px;
29 | border-radius: 50%;
30 | margin: 0 10px;
31 | }
32 |
33 | .images .image-alfred {
34 | padding: 36.9px 30px;
35 | }
36 |
37 | .input {
38 | text-align: center;
39 | }
40 |
41 | .input input {
42 | width: 800px;
43 | height: 60px;
44 | font-size: 1.5rem;
45 | text-align: center;
46 | border-radius: 3px;
47 | border: 1px solid #ddd;
48 | }
49 |
50 | .btn {
51 | position: relative;
52 | margin: 20px auto;
53 | display: block;
54 | padding: 15px 30px;
55 | font-size: 20px;
56 | font-weight: bold;
57 | line-height: 20px;
58 | color: white;
59 | white-space: nowrap;
60 | vertical-align: middle;
61 | cursor: pointer;
62 | background-color: transparent;
63 | border: 1px solid white;
64 | border-radius: 3px;
65 | -webkit-user-select: none;
66 | -moz-user-select: none;
67 | -ms-user-select: none;
68 | user-select: none;
69 | -webkit-appearance: none;
70 | }
71 |
72 | .btn:hover, .btn:active {
73 | text-decoration: none;
74 | background-color: white;
75 | color: #9b59b6;
76 | border-color: #ccc;
77 | }
78 |
79 | .help {
80 | text-align: center;
81 | color: white;
82 | margin: 60px 0 20px;
83 | font-size: 18px;
84 | }
85 |
86 | .github-buttons {
87 | text-align: center;
88 | transform: translateY(100%);
89 | }
90 |
91 | .step {
92 | display: none;
93 | }
94 |
95 | #step-1 input {
96 | display: block;
97 | margin: 20px auto;
98 | width: 450px;
99 | height: 50px;
100 | font-size: 1.5rem;
101 | text-align: center;
102 | border-radius: 3px;
103 | border: 1px solid #ddd;
104 | }
105 |
106 | .tooltipped {
107 | position: relative
108 | }
109 |
110 | .tooltipped:after {
111 | position: absolute;
112 | z-index: 1000000;
113 | display: none;
114 | padding: 5px 8px;
115 | font: normal normal 16px/1.5 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
116 | color: #fff;
117 | text-align: center;
118 | text-decoration: none;
119 | text-shadow: none;
120 | text-transform: none;
121 | letter-spacing: normal;
122 | word-wrap: break-word;
123 | white-space: pre;
124 | pointer-events: none;
125 | content: attr(aria-label);
126 | background: rgba(0, 0, 0, 0.8);
127 | border-radius: 3px;
128 | -webkit-font-smoothing: subpixel-antialiased
129 | }
130 |
131 | .tooltipped:before {
132 | position: absolute;
133 | z-index: 1000001;
134 | display: none;
135 | width: 0;
136 | height: 0;
137 | color: rgba(0, 0, 0, 0.8);
138 | pointer-events: none;
139 | content: "";
140 | border: 5px solid transparent
141 | }
142 |
143 | .tooltipped:hover:before, .tooltipped:hover:after, .tooltipped:active:before, .tooltipped:active:after, .tooltipped:focus:before, .tooltipped:focus:after {
144 | display: inline-block;
145 | text-decoration: none
146 | }
147 |
148 | .tooltipped-multiline:hover:after, .tooltipped-multiline:active:after, .tooltipped-multiline:focus:after {
149 | display: table-cell
150 | }
151 |
152 | .tooltipped-s:after, .tooltipped-se:after, .tooltipped-sw:after {
153 | top: 100%;
154 | right: 50%;
155 | margin-top: 5px
156 | }
157 |
158 | .tooltipped-s:before, .tooltipped-se:before, .tooltipped-sw:before {
159 | top: auto;
160 | right: 50%;
161 | bottom: -5px;
162 | margin-right: -5px;
163 | border-bottom-color: rgba(0, 0, 0, 0.8)
164 | }
165 |
166 | .tooltipped-se:after {
167 | right: auto;
168 | left: 50%;
169 | margin-left: -15px
170 | }
171 |
172 | .tooltipped-sw:after {
173 | margin-right: -15px
174 | }
175 |
176 | .tooltipped-n:after, .tooltipped-ne:after, .tooltipped-nw:after {
177 | right: 50%;
178 | bottom: 100%;
179 | margin-bottom: 5px
180 | }
181 |
182 | .tooltipped-n:before, .tooltipped-ne:before, .tooltipped-nw:before {
183 | top: -5px;
184 | right: 50%;
185 | bottom: auto;
186 | margin-right: -5px;
187 | border-top-color: rgba(0, 0, 0, 0.8)
188 | }
189 |
190 | .tooltipped-ne:after {
191 | right: auto;
192 | left: 50%;
193 | margin-left: -15px
194 | }
195 |
196 | .tooltipped-nw:after {
197 | margin-right: -15px
198 | }
199 |
200 | .tooltipped-s:after, .tooltipped-n:after {
201 | -webkit-transform: translateX(50%);
202 | -ms-transform: translateX(50%);
203 | transform: translateX(50%)
204 | }
205 |
206 | .tooltipped-w:after {
207 | right: 100%;
208 | bottom: 50%;
209 | margin-right: 5px;
210 | -webkit-transform: translateY(50%);
211 | -ms-transform: translateY(50%);
212 | transform: translateY(50%)
213 | }
214 |
215 | .tooltipped-w:before {
216 | top: 50%;
217 | bottom: 50%;
218 | left: -5px;
219 | margin-top: -5px;
220 | border-left-color: rgba(0, 0, 0, 0.8)
221 | }
222 |
223 | .tooltipped-e:after {
224 | bottom: 50%;
225 | left: 100%;
226 | margin-left: 5px;
227 | -webkit-transform: translateY(50%);
228 | -ms-transform: translateY(50%);
229 | transform: translateY(50%)
230 | }
231 |
232 | .tooltipped-e:before {
233 | top: 50%;
234 | right: -5px;
235 | bottom: 50%;
236 | margin-top: -5px;
237 | border-right-color: rgba(0, 0, 0, 0.8)
238 | }
239 |
240 | .tooltipped-multiline:after {
241 | width: -webkit-max-content;
242 | width: -moz-max-content;
243 | width: max-content;
244 | max-width: 250px;
245 | word-break: break-word;
246 | word-wrap: normal;
247 | white-space: pre-line;
248 | border-collapse: separate
249 | }
250 |
251 | .tooltipped-multiline.tooltipped-s:after, .tooltipped-multiline.tooltipped-n:after {
252 | right: auto;
253 | left: 50%;
254 | -webkit-transform: translateX(-50%);
255 | -ms-transform: translateX(-50%);
256 | transform: translateX(-50%)
257 | }
258 |
259 | .tooltipped-multiline.tooltipped-w:after, .tooltipped-multiline.tooltipped-e:after {
260 | right: 100%
261 | }
262 |
--------------------------------------------------------------------------------
/src/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
Alfred Slack Workflow
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
Copy the code below and add it to your client ID and secret.