Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot saves drawing submissions #30

Merged
merged 4 commits into from
Jul 27, 2017

Conversation

adamsullovey
Copy link
Contributor

this allows the bot to save images DM'd to it for later.

drawings.json will look like this when there are 2 submissions saved:

[
  {
    "id": "F6FS50HFZ",
    "created": 1501191603,
    "timestamp": 1501191603,
    "name": "giphy-downsized.gif",
    "title": "giphy-downsized.gif",
    "mimetype": "image/gif",
    "filetype": "gif",
    "pretty_type": "GIF",
    "user": "U64CZMLAE",
    "editable": false,
    "size": 1811685,
    "mode": "hosted",
    "is_external": false,
    "external_type": "",
    "is_public": false,
    "public_url_shared": false,
    "display_as_bot": false,
    "username": "",
    "url_private": "https://files.slack.com/files-pri/T5ZRMFDBR-F6FS50HFZ/giphy-downsized.gif",
    "url_private_download": "https://files.slack.com/files-pri/T5ZRMFDBR-F6FS50HFZ/download/giphy-downsized.gif",
    "thumb_64": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_64.png",
    "thumb_80": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_80.png",
    "thumb_360": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_360.png",
    "thumb_360_w": 236,
    "thumb_360_h": 360,
    "thumb_480": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_480.png",
    "thumb_480_w": 315,
    "thumb_480_h": 480,
    "thumb_160": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_160.png",
    "thumb_360_gif": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_360.gif",
    "thumb_480_gif": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_480.gif",
    "image_exif_rotation": 1,
    "original_w": 320,
    "original_h": 488,
    "deanimate_gif": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS50HFZ-a990941500/giphy-downsized_deanimate_gif.png",
    "permalink": "https://theheap.slack.com/files/adamsullovey/F6FS50HFZ/giphy-downsized.gif",
    "permalink_public": "https://slack-files.com/T5ZRMFDBR-F6FS50HFZ-1f5d04f1bc",
    "channels": [],
    "groups": [],
    "ims": [],
    "comments_count": 1,
    "initial_comment": {
      "id": "Fc6EQYQBK6",
      "created": 1501191603,
      "timestamp": 1501191603,
      "user": "U64CZMLAE",
      "is_intro": true,
      "comment": "submit drawing"
    }
  },
  {
    "id": "F6FS6F0KH",
    "created": 1501191797,
    "timestamp": 1501191797,
    "name": "power-of-play-1.jpg",
    "title": "power-of-play-1.jpg",
    "mimetype": "image/jpeg",
    "filetype": "jpg",
    "pretty_type": "JPEG",
    "user": "U64CZMLAE",
    "editable": false,
    "size": 54492,
    "mode": "hosted",
    "is_external": false,
    "external_type": "",
    "is_public": false,
    "public_url_shared": false,
    "display_as_bot": false,
    "username": "",
    "url_private": "https://files.slack.com/files-pri/T5ZRMFDBR-F6FS6F0KH/power-of-play-1.jpg",
    "url_private_download": "https://files.slack.com/files-pri/T5ZRMFDBR-F6FS6F0KH/download/power-of-play-1.jpg",
    "thumb_64": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_64.jpg",
    "thumb_80": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_80.jpg",
    "thumb_360": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_360.jpg",
    "thumb_360_w": 360,
    "thumb_360_h": 270,
    "thumb_480": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_480.jpg",
    "thumb_480_w": 480,
    "thumb_480_h": 360,
    "thumb_160": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_160.jpg",
    "thumb_720": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_720.jpg",
    "thumb_720_w": 720,
    "thumb_720_h": 540,
    "thumb_800": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_800.jpg",
    "thumb_800_w": 800,
    "thumb_800_h": 600,
    "thumb_960": "https://files.slack.com/files-tmb/T5ZRMFDBR-F6FS6F0KH-3bc019b63b/power-of-play-1_960.jpg",
    "thumb_960_w": 960,
    "thumb_960_h": 720,
    "image_exif_rotation": 1,
    "original_w": 1000,
    "original_h": 750,
    "permalink": "https://theheap.slack.com/files/adamsullovey/F6FS6F0KH/power-of-play-1.jpg",
    "permalink_public": "https://slack-files.com/T5ZRMFDBR-F6FS6F0KH-1807e93b20",
    "channels": [],
    "groups": [],
    "ims": [],
    "comments_count": 1,
    "initial_comment": {
      "id": "Fc6EP9FM1Q",
      "created": 1501191797,
      "timestamp": 1501191797,
      "user": "U64CZMLAE",
      "is_intro": true,
      "comment": "submit drawing"
    }
  }
]

maybe those objects can be trimmed down, but I'm not sure what's important yet.

@adamsullovey
Copy link
Contributor Author

closes #27, relates to #23

@teesloane
Copy link
Contributor

Dang, this is great. For some reason, I thought we'd have to take the submissions and send them off to another server to create the image gallery; but with the json file we can just grab a gallery of images within x -> y time. In this sense, we could just write another chrone function that is going to get the gallery and post it in #draw-it.

great work! merging now.

@teesloane teesloane merged commit 90f110b into the-heap:master Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants