Libraryless. Click here for Pure Java version (919L/7K/22K).
!752 static S token; static S channelID = "C0FH9PY8J"; // #talkingbots static S timestamp = "1449606813.001101"; p { token = loadSecretTextFileMandatory("#1001889", "relp-slack-botstuff-token").trim(); S url = "https://slack.com/api/reactions.get"; S postData = "token=" + urlencode(token) + "&channel=" + urlencode(channelID) + "×tamp=" + urlencode(timestamp); S data = doPost(postData, url); print(data); Map map = jsonDecodeMap(data); Map msg = cast map.get("message"); printStructure(msg); L<Map> reactions = cast msg.get("reactions"); printStructure(reactions); for (Map r : reactions) { S name = cast r.get("name"); if (litlist("+1").contains(name)) print("+1!"); } }
Began life as a copy of #1001889
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1001938 |
Snippet name: | Test querying Slack reactions |
Eternal ID of this version: | #1001938/1 |
Text MD5: | bba9917ad3acfddbb47fbabb80fc4d9c |
Transpilation MD5: | 26621e3d6be5e60f91f8771771457742 |
Author: | stefan |
Category: | |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-12-08 21:49:54 |
Source code size: | 742 bytes / 23 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 750 / 740 |
Referenced in: | [show references] |