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

Add Script to Update emojis from Slackmoji.com #123

Merged
merged 12 commits into from
Jul 28, 2017
Merged

Add Script to Update emojis from Slackmoji.com #123

merged 12 commits into from
Jul 28, 2017

Conversation

flamableconcrete
Copy link
Contributor

This should resolve #122, which I just wrote up.

@flamableconcrete
Copy link
Contributor Author

Well, apparently this is a WIP, since it is failing on 220 of them since they are defined elsewhere or are too large, etc.

@hugovk
Copy link
Collaborator

hugovk commented Jul 25, 2017

The too-large emojis should be reported back upstream to Slackmoji, as they won't be able to import them either!

@gtback
Copy link

gtback commented Jul 25, 2017

You might want to rename some of the slackmojis to include the pack name. The conflict between the NFL Giants and MLB Giants immediately comes to mind.

@flamableconcrete
Copy link
Contributor Author

i have some more local edits that i haven't pushed yet, but am also looking for a place to send feedback to the slackmojis.com maintainer. I started with a tweet though - https://twitter.com/jondrice/status/889925917602172928

@zachfeldman
Copy link
Contributor

Retweeted you. LMK where I can help and when this is ready 2 merge!

@flamableconcrete
Copy link
Contributor Author

Will do! I actually bothered to set up a local test environment too, so I don't have to rely on Travis to tell me I goofed. Whenever it is, the next commit that passes Travis should be good to go, but I'll post here too.

@flamableconcrete
Copy link
Contributor Author

Yay, it passed CI! I personally think it is ready to merge, but would like you to take a look first - at least at the subfolder in the packs directory and tell me what you think. I was thinking alternately they could be named slackmoji-<category>.yaml. Thoughts?

@flamableconcrete
Copy link
Contributor Author

I slept on it, and decided to make it a flat structure - so I took care of that this morning. I also addressed sports as special cases per @gtback's suggestion, so all teams are e.g. :nfl-giants: instead of just :giants:. This will make them easier to search for in Slack as well. Everything else that is duplicated just has an incrementing number at the end.

I also reported the too-large emojis from slackmojis.com per @hugovk's suggestion and they have been removed/resized by the maintainer.

I'd say this is for real ready to merge!

@zachfeldman
Copy link
Contributor

I haven't tested this myself but if the tests pass, I'm for it. The code looks well organized and like it should be doing what you claim!

@hugovk any thoughts before I merge? I know you were looking at this too.

Copy link
Collaborator

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Just a few comments.

Also a few not-so-important style things:

update_slackmojis.py:11:80: E501 line too long (84 > 79 characters)
update_slackmojis.py:12:1: E302 expected 2 blank lines, found 1
update_slackmojis.py:17:1: E302 expected 2 blank lines, found 1
update_slackmojis.py:48:80: E501 line too long (83 > 79 characters)
update_slackmojis.py:50:5: E265 block comment should start with '# '
update_slackmojis.py:75:27: E201 whitespace after '{'
update_slackmojis.py:75:40: E202 whitespace before '}'
update_slackmojis.py:90:80: E501 line too long (83 > 79 characters)
update_slackmojis.py:110:80: E501 line too long (82 > 79 characters)
update_slackmojis.py:139:5: E265 block comment should start with '# '

README.md Outdated
- [Shiba Stickers](https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/shiba.yaml) (from Messenger)
- [gamedevmoji](https://raw.githubusercontent.com/niksudan/gamedevmoji/master/gamedevicons.yaml)
- [AWS simple icons](https://raw.githubusercontent.com/Surgo/aws_emojipacks/master/noprefix-emojipacks.yml)

### Emoji packs from [slackmojis.com](http://www.slackmojis.com)

- [Uncategorized](https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/slackmojis-.yaml)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really slackmojis-uncategorized.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

import io
import json
import os
from pprint import pprint
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'pprint.pprint' imported but unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed!

import json
import os
from pprint import pprint
import sys
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'sys' imported but unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed!


def remove_file(f):
try:
print 'removing file', f
Copy link
Collaborator

@hugovk hugovk Jul 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not essential, but add from __future__ import print_function at the top and we can use the print() function in Python 2 as well as Python 3. It's good to be ready for both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

yaml.dump(data, f, Dumper=MyDumper, default_flow_style=False)


def create_dirs(dir):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some duplicate code shared in this file and image-checker.py. Should we put common things in a utlis.py, and maybe put all the scripts in the same directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ummmm, I'll leave that up to someone else - or future me? seems like it could be a different pull request/issue.

@zachfeldman
Copy link
Contributor

@hugovk thanks so much for reviewing!

@flamableconcrete
Copy link
Contributor Author

yes, thanks for the code review. I'll tackle some of these later. The fixes should be pretty straightforward.

@zachfeldman
Copy link
Contributor

@hugovk , I'm down to merge if you are.

@hugovk
Copy link
Collaborator

hugovk commented Jul 28, 2017

Make it so! Thanks!

@zachfeldman
Copy link
Contributor

image

@zachfeldman zachfeldman merged commit b7773f2 into lambtron:master Jul 28, 2017
@gtback
Copy link

gtback commented Jul 30, 2017

I know this was already merged, but would it be better for the scrabble pack to use :scrabble- prefixes as well (like sports teams)? Might help with discoverability along with reducing potential conflicts.

@flamableconcrete
Copy link
Contributor Author

I was thinking the same thing with facebook ones to start with the :fb- prefix. Maybe start another issue to map slackmoji categories to possible prefixes?

camalot added a commit to bit13labs/emojipacks that referenced this pull request Feb 3, 2018
* 'master' of ssh://github.com/lambtron/emojipacks: (30 commits)
  Added export json conversion script to easily transfer emojis between slacks (lambtron#141)
  introducing pumpkinparrot and angelparrot (lambtron#140)
  CI: Only print summary if errors (lambtron#138)
  Add pack with German states' (Bundesländer) coats of arms (lambtron#137)
  Fix pokemon to fix CI (lambtron#139)
  five new parrots (lambtron#136)
  add luckyparrot and rotatingparrot (lambtron#133)
  Delete hipchat.yaml (lambtron#135)
  Update README.md with 2FA (lambtron#132)
  Added in ryangoslingparrot and tacoparrot (lambtron#131)
  Add Slackmoji prefixes (lambtron#127)
  added 11 new parrots (lambtron#128)
  Add Script to Update emojis from Slackmoji.com (lambtron#123)
  Updated file extension to fit with convention (lambtron#124)
  Add AWS Simple icons (lambtron#120)
  Update Finland pack with new emoji (lambtron#121)
  Revert "created an all emoji file (lambtron#118)" (lambtron#119)
  created an all emoji file (lambtron#118)
  Added prefix to occupy emoji. [lambtron#116] (lambtron#116)
  Adds Political Pack of Emojis (lambtron#115)
  ...
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.

Write a script to update slackmojis.com emojis
5 participants